From patchwork Tue Oct 23 01:10:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leonardo Bras X-Patchwork-Id: 10652647 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4A48917D4 for ; Tue, 23 Oct 2018 01:10:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9218828D1C for ; Tue, 23 Oct 2018 01:10:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 83D4928E1C; Tue, 23 Oct 2018 01:10:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,FROM_EXCESS_BASE64,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 26B8928D1C for ; Tue, 23 Oct 2018 01:10:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726286AbeJWJb3 (ORCPT ); Tue, 23 Oct 2018 05:31:29 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:35613 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725883AbeJWJb3 (ORCPT ); Tue, 23 Oct 2018 05:31:29 -0400 Received: by mail-qk1-f196.google.com with SMTP id v68-v6so26656971qka.2; Mon, 22 Oct 2018 18:10:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:user-agent; bh=reoZw2EkBU8/NGU6BCm+2JztCf8UNgy8iBR4BKrH64U=; b=EA/j+LYBkM+RBFZU5keaLDcsqOpcchNN/uKTn8MEvNJ/RcrESKtM8A8TMSRltoGlRs 0AEr4IU0cR3CelZZaPsUcrVqZoLTyuCU4Ix32imUECzRp0hejG0krYen7Oqo/Yn0GQs6 Q9wTEjdD4DXZXpgOE/cfGlzZSn38yYY2xm/TDNPqGn6q6OFilHtUnP7mm9LBm0198/EF 0YKio5TzxSxhKPUm8iIl8uMSYZQLBGsptUUBH0jnwyyTqu7nVIus0HT5yq2sXMm2pCdm Yyb0ythWLxbkhwHs89kFXQUiQQW0caWModhJ9zklk0blbi0ryr/+BBxqA4tnNV2zypdv FrZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:user-agent; bh=reoZw2EkBU8/NGU6BCm+2JztCf8UNgy8iBR4BKrH64U=; b=o+qLFhr4Ivpp+LCw0MWtT0vDHrHL9m53Bu2bKnTNM8GxNxNJkKwXb9wo2umDZN/bfA xeyjgJjZnXjT8W4MlT5WRzMxS+nxFTMt3U9ElB2kN8XHFbmaKJsygvNBM5bqQvcIpQyN OIwzxtnRCLPm1yaLWFfwwNbfRoY07YybgbvhFAE7IqEGYnstRzMvw503NJJ7xmKAFdB3 EdT3/POZRq23mZE+s+mOif6dn6eOk2ppeg1S/nS8XKHFQaQg1+ClCIgBVS22c/hZyadO eqph4c4ij6jalDQ9lapoYoZ4PAVrTHq0suOWzvDdOFdapXt8GQCbwVtks1XO6Kb9tp2I TlVg== X-Gm-Message-State: AGRZ1gIRidKFmdK/Lz0sB4xu8ARbZV8LWlTqXH5ZZt+/DoxEiZq4470f 3j94gL7+YL+7IM3Dbqpl46Q= X-Google-Smtp-Source: AJdET5fn72VDC7tABC9mL7qYTi8BDoOi6Df/QIRiHu5zFkt6H2KzWGLEU5Sb7M0jm47M6vOp8JBfQw== X-Received: by 2002:a37:d87:: with SMTP id 129-v6mr9625516qkn.212.1540257029355; Mon, 22 Oct 2018 18:10:29 -0700 (PDT) Received: from WindFlash ([179.159.21.48]) by smtp.gmail.com with ESMTPSA id 82-v6sm11379958qkg.16.2018.10.22.18.10.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Oct 2018 18:10:28 -0700 (PDT) Date: Mon, 22 Oct 2018 22:10:22 -0300 From: Leonardo =?utf-8?b?QnLDoXM=?= To: lkcamp@lists.libreplanetbr.org Cc: Borislav Petkov , David.Laight@aculab.com, Andy Lutomirski , Ingo Molnar , helen@koikeco.de, Masahiro Yamada , Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/5] x86/vdso: Renames variable to fix shadow warning. Message-ID: <20181023011022.GA6574@WindFlash> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Renames the char variable to avoid shadowing a variable previously declared on this function. Signed-off-by: Leonardo Brás --- arch/x86/entry/vdso/vdso2c.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/arch/x86/entry/vdso/vdso2c.h b/arch/x86/entry/vdso/vdso2c.h index fa847a620f40..a20b134de2a8 100644 --- a/arch/x86/entry/vdso/vdso2c.h +++ b/arch/x86/entry/vdso/vdso2c.h @@ -7,7 +7,7 @@ static void BITSFUNC(go)(void *raw_addr, size_t raw_len, void *stripped_addr, size_t stripped_len, - FILE *outfile, const char *name) + FILE *outfile, const char *image_name) { int found_load = 0; unsigned long load_size = -1; /* Work around bogus warning */ @@ -93,11 +93,12 @@ static void BITSFUNC(go)(void *raw_addr, size_t raw_len, int k; ELF(Sym) *sym = raw_addr + GET_LE(&symtab_hdr->sh_offset) + GET_LE(&symtab_hdr->sh_entsize) * i; - const char *name = raw_addr + GET_LE(&strtab_hdr->sh_offset) + - GET_LE(&sym->st_name); + const char *sym_name = raw_addr + + GET_LE(&strtab_hdr->sh_offset) + + GET_LE(&sym->st_name); for (k = 0; k < NSYMS; k++) { - if (!strcmp(name, required_syms[k].name)) { + if (!strcmp(sym_name, required_syms[k].name)) { if (syms[k]) { fail("duplicate symbol %s\n", required_syms[k].name); @@ -134,7 +135,7 @@ static void BITSFUNC(go)(void *raw_addr, size_t raw_len, if (syms[sym_vvar_start] % 4096) fail("vvar_begin must be a multiple of 4096\n"); - if (!name) { + if (!image_name) { fwrite(stripped_addr, stripped_len, 1, outfile); return; } @@ -157,7 +158,7 @@ static void BITSFUNC(go)(void *raw_addr, size_t raw_len, } fprintf(outfile, "\n};\n\n"); - fprintf(outfile, "const struct vdso_image %s = {\n", name); + fprintf(outfile, "const struct vdso_image %s = {\n", image_name); fprintf(outfile, "\t.data = raw_data,\n"); fprintf(outfile, "\t.size = %lu,\n", mapping_size); if (alt_sec) { From patchwork Tue Oct 23 01:10:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leonardo Bras X-Patchwork-Id: 10652649 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 22E2317D4 for ; Tue, 23 Oct 2018 01:10:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7349028D1C for ; Tue, 23 Oct 2018 01:10:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 672F628E1C; Tue, 23 Oct 2018 01:10:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,FROM_EXCESS_BASE64,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DE6528D1C for ; Tue, 23 Oct 2018 01:10:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727226AbeJWJbj (ORCPT ); Tue, 23 Oct 2018 05:31:39 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:36218 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725883AbeJWJbj (ORCPT ); Tue, 23 Oct 2018 05:31:39 -0400 Received: by mail-qt1-f193.google.com with SMTP id u34-v6so48717091qth.3; Mon, 22 Oct 2018 18:10:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:user-agent; bh=3nnNuMN0DgpLvFEqoDh+yamiGrzV6ATAjSjzW+TOOZ4=; b=nC+hhINNkswG+e80IHjAG8bda0ldKWXoFt5/UFsVEfA13jxY0aIkdRAjzypFDrpKmH ov/7mKYiA7SSbg/WmurDOb6T1OygHY6BZmAIz55pPAxl9dfK/ivuOruSwNlIDZE+eJJN PH/uDDAC9VaVohPsKTcewrywuMCKjAwD3hep9kNTjsYLCqOm1aGgKBEjy9+W8/a111i4 IyBLRFrU3zRbyHdPvjeWyypvyyUa+A+kqHgDyDmcNCBDdv7HvGKP7mQq5UFVlHOU0xaG CAbeIz7vXCsX582aOrd7BfwnkIirhaL7SNpsS430+8QWx81C0+OifEyG6J7ma52PId3+ K8BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:user-agent; bh=3nnNuMN0DgpLvFEqoDh+yamiGrzV6ATAjSjzW+TOOZ4=; b=QaNhtzgSY0jD4QxcUVT8ruTRbxJSeCd0K4JXFggyd6y6c2Zjp/hrvYPvPdxc+7rNpS WcYd6TvVN+A64ojOfqaXOszpm+BTibqqMYiK5ao+m7XhvQW/SZqirF7Lg0Glw0QXReBg sF5wA7FFgs0cYdZ7InrMUyv+WFcXMzno3tEjMcZzQ5VrECbvMqvUv3eZvwHX7NvJ1qqT KQCP0FGeUg2itFqFwMdmkrEg1Cxwrq7dN5vzIc51tL11CdGHlliofWMGf9XsSJqjv2Pe 0GF0gqGmlGo4LST+TjAGj60qKjCdSphTiFUaovvFRn8/Wa50LabmULWuTHmMUsub6x0O W/Sg== X-Gm-Message-State: ABuFfoje1C9RCB9DMypj8ddENfqfzIzdJzmDECvB3bwFMZViBkr6Sxr2 I/m87IxAzFL1evTcUJ/hGtU= X-Google-Smtp-Source: ACcGV609dBDCVIqSnThpw+YX2gzunlpiWy2jq3yElfnXmqwE+2cweQjnva+XUEgq/RcSIvpbV5fssg== X-Received: by 2002:aed:229a:: with SMTP id p26-v6mr46080540qtc.148.1540257039806; Mon, 22 Oct 2018 18:10:39 -0700 (PDT) Received: from WindFlash ([179.159.21.48]) by smtp.gmail.com with ESMTPSA id h4-v6sm19118406qkg.95.2018.10.22.18.10.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Oct 2018 18:10:39 -0700 (PDT) Date: Mon, 22 Oct 2018 22:10:33 -0300 From: Leonardo =?utf-8?b?QnLDoXM=?= To: lkcamp@lists.libreplanetbr.org Cc: Borislav Petkov , David.Laight@aculab.com, Andy Lutomirski , Ingo Molnar , helen@koikeco.de, Masahiro Yamada , Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/5] kbuild: Removes unnecessary shadowed local variable. Message-ID: <20181023011033.GA6580@WindFlash> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Removes an unnecessary shadowed local variable (start). It was used only once, with the same value it was started before the if block. Signed-off-by: Leonardo Brás --- scripts/asn1_compiler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/asn1_compiler.c b/scripts/asn1_compiler.c index c146020fc783..1b28787028d3 100644 --- a/scripts/asn1_compiler.c +++ b/scripts/asn1_compiler.c @@ -413,7 +413,7 @@ static void tokenise(char *buffer, char *end) /* Handle string tokens */ if (isalpha(*p)) { - const char **dir, *start = p; + const char **dir; /* Can be a directive, type name or element * name. Find the end of the name. From patchwork Tue Oct 23 01:10:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leonardo Bras X-Patchwork-Id: 10652651 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A705614DE for ; Tue, 23 Oct 2018 01:10:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 023A228D1C for ; Tue, 23 Oct 2018 01:10:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E74B028E1C; Tue, 23 Oct 2018 01:10:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,FROM_EXCESS_BASE64,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8882928D1C for ; Tue, 23 Oct 2018 01:10:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727323AbeJWJbt (ORCPT ); Tue, 23 Oct 2018 05:31:49 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:41941 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725883AbeJWJbt (ORCPT ); Tue, 23 Oct 2018 05:31:49 -0400 Received: by mail-qt1-f194.google.com with SMTP id l41-v6so48684758qtl.8; Mon, 22 Oct 2018 18:10:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:user-agent; bh=L46EcQJ+O0hl3e5uDfhzLkvgGNrA7UN6EpC8xsyT0FY=; b=CSlBOavx0UlhIrISkkDHA4kCNCT+CH/XOam/TlKnbL8/aBBNxuVlL9xBhZTJczWrro ytEuerpOzEPyItkG0b11HhcbCTUyXsMB4QUYMmmnNau6agHQx0HkF00oOni4SP8EkKmu Ot0hYh6HLcK4O3yT3bLvilXVpPByE5pcDJyV8OgiCX4kHYIwiB3yY0HxFLmB8+Qku277 4kSik+hUeb0ETjSAgEEvgIB7BTHVKX2RMc6XTEw1efctoI6xj2AV8qKDy++iYYx8Bew1 SapvDsYONr+dB99TNXSbb9ew8ZkmDOTQ1PFDup4A1RVHy31q/i4ew7T5aPcbjDdlyydl HPew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:user-agent; bh=L46EcQJ+O0hl3e5uDfhzLkvgGNrA7UN6EpC8xsyT0FY=; b=YJObeGoxbTD+3BlZwz9LzeIzYxyAg8ofzgnHcwcQe/7KF/o/ukMuBp3xPVsxHxBlcM XCeSVTj8boY0hH0uR4nDnvBBomDvN7VIhSn4lUpn7lK3ayXkH3LW0NJ9PLkFbxpXJ+9L E3W0icrzA0kX8TS/mYJsAFZKsTC9F4x5dBeYVlURDyZJC1UOnh25HrlBAfs/7oxPF/Il F0scdBUks8X0+7EVI+sYgi4LHAm9KQIMGFja9weS1lTVNJhfrtJPbCau9N7JA1SUHyaR sgsHyTtE2thnbXqTYrvpAHll0j9kmfoICv8n6YTrFaXxbqr2ruZM2kVUMoiOjTyDQlN8 t8ig== X-Gm-Message-State: ABuFfohCgkaAteNaL3IoDxj/U2eqF86SVFaJsIaJKYKvaNkszdTBlNRn Ss2y6ux2L+uPbmgArTSyrLA= X-Google-Smtp-Source: ACcGV63ynAj8tkskw8CjzxaP3UE/TxFFaWo9UI+H4PaQsj6pHTX9+lgsRO7UMkzHS9P/qCFeMkzv0Q== X-Received: by 2002:aed:2d05:: with SMTP id h5-v6mr46169920qtd.291.1540257049425; Mon, 22 Oct 2018 18:10:49 -0700 (PDT) Received: from WindFlash ([179.159.21.48]) by smtp.gmail.com with ESMTPSA id c85-v6sm21153702qke.89.2018.10.22.18.10.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Oct 2018 18:10:49 -0700 (PDT) Date: Mon, 22 Oct 2018 22:10:42 -0300 From: Leonardo =?utf-8?b?QnLDoXM=?= To: lkcamp@lists.libreplanetbr.org Cc: Borislav Petkov , David.Laight@aculab.com, Andy Lutomirski , Ingo Molnar , helen@koikeco.de, Masahiro Yamada , Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/5] Creates macro to avoid variable shadowing Message-ID: <20181023011042.GA6582@WindFlash> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Creates DEF_FIELD_ADDR_VAR as a more generic version of the DEF_FIELD_ADD macro, allowing usage of a variable name other than the struct element name. Also, sets DEF_FIELD_ADDR as a specific usage of DEF_FILD_ADDR_VAR in which the var name is the same as the struct element name. Signed-off-by: Leonardo Brás --- scripts/mod/file2alias.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 7be43697ff84..3015c0bdecb2 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -95,12 +95,20 @@ extern struct devtable *__start___devtable[], *__stop___devtable[]; */ #define DEF_FIELD(m, devid, f) \ typeof(((struct devid *)0)->f) f = TO_NATIVE(*(typeof(f) *)((m) + OFF_##devid##_##f)) + +/* Define a variable v that holds the address of field f of struct devid + * based at address m. Due to the way typeof works, for a field of type + * T[N] the variable has type T(*)[N], _not_ T*. + */ +#define DEF_FIELD_ADDR_VAR(m, devid, f, v) \ + typeof(((struct devid *)0)->f) *v = ((m) + OFF_##devid##_##f) + /* Define a variable f that holds the address of field f of struct devid * based at address m. Due to the way typeof works, for a field of type * T[N] the variable has type T(*)[N], _not_ T*. */ #define DEF_FIELD_ADDR(m, devid, f) \ - typeof(((struct devid *)0)->f) *f = ((m) + OFF_##devid##_##f) + DEF_FIELD_ADDR_VAR(m, devid, f, f) /* Add a table entry. We test function type matches while we're here. */ #define ADD_TO_DEVTABLE(device_id, type, function) \ @@ -641,25 +649,27 @@ static void do_pnp_card_entries(void *symval, unsigned long size, unsigned int i; device_id_check(mod->name, "pnp", size, id_size, symval); + DEF_FIELD_ADDR(symval, pnp_card_device_id, devs); + typeof(devs) devs_last; for (i = 0; i < count; i++) { unsigned int j; - DEF_FIELD_ADDR(symval + i*id_size, pnp_card_device_id, devs); + devs_last = devs + i * id_size; for (j = 0; j < PNP_MAX_DEVICES; j++) { - const char *id = (char *)(*devs)[j].id; - int i2, j2; + const char *id = (char *)(*devs_last)[j].id; + int j2; int dup = 0; if (!id[0]) break; /* find duplicate, already added value */ - for (i2 = 0; i2 < i && !dup; i2++) { - DEF_FIELD_ADDR(symval + i2*id_size, pnp_card_device_id, devs); + while ((devs_last -= id_size) >= devs && !dup) { for (j2 = 0; j2 < PNP_MAX_DEVICES; j2++) { - const char *id2 = (char *)(*devs)[j2].id; + const char *id2 = + (char *)(*devs_last)[j2].id; if (!id2[0]) break; From patchwork Tue Oct 23 01:10:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leonardo Bras X-Patchwork-Id: 10652653 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7042217D4 for ; Tue, 23 Oct 2018 01:11:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BFE8128D1C for ; Tue, 23 Oct 2018 01:11:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B410F28E1C; Tue, 23 Oct 2018 01:11:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,FROM_EXCESS_BASE64,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EDBA28D1C for ; Tue, 23 Oct 2018 01:11:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727799AbeJWJb6 (ORCPT ); Tue, 23 Oct 2018 05:31:58 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:42465 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725883AbeJWJb6 (ORCPT ); Tue, 23 Oct 2018 05:31:58 -0400 Received: by mail-qk1-f195.google.com with SMTP id u20-v6so12087587qkk.9; Mon, 22 Oct 2018 18:10:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:user-agent; bh=FBQw2s4pCChAO/X8Yk6XewgTMXo6hSZSprD6cHrH444=; b=dVaqH2z8f6Jr79Bm1JILsdyPdTPdyp/GDElric1ill4oJ0DfHXlgnJH+y5h71rwDqU 6lpoOARFbx/VBY5f6ystB6ZazCRHH6EeJd+J+2ohn14RZylTFH30rLJ7pRTbompquGt2 TbjUc/afAJ5OhxQ1SKcjbhfNan3KII2rFx92+7ra62D3ULcx+/XTptHXvGHm0aQcB/Yg IUkLo/r2/nT4qJYu9OSuJuGCKmA8t90FEklldEAsAraZl4KVRQRq46JTP7jb6OFYkpKp 9EFsqKACWd07cXUtjx1mFGa41Au2lChWW80LqnrjGAVRnX6aaD2YC9ApN2fz0OVEJkDM Ugaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:user-agent; bh=FBQw2s4pCChAO/X8Yk6XewgTMXo6hSZSprD6cHrH444=; b=nJ8NTFLqJEPGUT9++OV9txZkEGnklzZ37hD6B/EickxnXrgF3k8wkzbOm24v35Lefe 6XcRGDjBzxuc67HMxuBnsJ0UBKzmi6WTSdROxkKu3NepN+lZx6/EVaFKeq5Iiy+jE2r+ E58BphD/rbBCn6aY7GyDVScSvkA7iOXTuz7dXDmUhdOrbjZ3lP1pwEcG0M35B+tzukPY qzYGYzFO98nVVB+TBhInyHOuPcR3tRtUfXS7eZuzUU59sAJ0D4HcbnboWAhjfZw9+xIQ yex37IL+UHXuP4f8m37jKtEXAEKUwdMVHNCnseANsjBeB7xDBvMcfWqOKPMh3NgdF7AJ /kDQ== X-Gm-Message-State: ABuFfojVqPaBO/Z19wCSbnDazmaOYTG+quCCHmtTviAEDn1CrkEjhtxQ c5Q7JO2oIAC8FMm/h4HPmwI= X-Google-Smtp-Source: ACcGV60z0x23bGU9TqTbrAgrx4O9pG0W3MZ0QIxfBzoBQzi3P++5fjvN78e94SPVgcGGbn4nfAAOlA== X-Received: by 2002:a37:30d4:: with SMTP id w203-v6mr44203494qkw.106.1540257059028; Mon, 22 Oct 2018 18:10:59 -0700 (PDT) Received: from WindFlash ([179.159.21.48]) by smtp.gmail.com with ESMTPSA id 83sm3056255qkz.73.2018.10.22.18.10.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Oct 2018 18:10:58 -0700 (PDT) Date: Mon, 22 Oct 2018 22:10:52 -0300 From: Leonardo =?utf-8?b?QnLDoXM=?= To: lkcamp@lists.libreplanetbr.org Cc: Borislav Petkov , David.Laight@aculab.com, Andy Lutomirski , Ingo Molnar , helen@koikeco.de, Masahiro Yamada , Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/5] modpost: Changes parameter name to avoid shadowing. Message-ID: <20181023011052.GA6584@WindFlash> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Changes the parameter name to avoid shadowing a variable. Signed-off-by: Leonardo Brás --- scripts/mod/modpost.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 0d998c54564d..368fe42340df 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -2228,13 +2228,13 @@ static int add_versions(struct buffer *b, struct module *mod) } static void add_depends(struct buffer *b, struct module *mod, - struct module *modules) + struct module *module_list) { struct symbol *s; struct module *m; int first = 1; - for (m = modules; m; m = m->next) + for (m = module_list; m; m = m->next) m->seen = is_vmlinux(m->name); buf_printf(b, "\n"); From patchwork Tue Oct 23 01:11:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leonardo Bras X-Patchwork-Id: 10652655 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 513FC17D4 for ; Tue, 23 Oct 2018 01:11:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A218828D1C for ; Tue, 23 Oct 2018 01:11:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 95BF028E1C; Tue, 23 Oct 2018 01:11:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,FROM_EXCESS_BASE64,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 427B928D1C for ; Tue, 23 Oct 2018 01:11:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727859AbeJWJcI (ORCPT ); Tue, 23 Oct 2018 05:32:08 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:42474 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725883AbeJWJcI (ORCPT ); Tue, 23 Oct 2018 05:32:08 -0400 Received: by mail-qk1-f193.google.com with SMTP id u20-v6so12087774qkk.9; Mon, 22 Oct 2018 18:11:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:user-agent; bh=8ZZdwg9lcy0z91UPab3v9CZJ0b9BOj9iK1CKQUx/A14=; b=nZKas+jI/hQ2yYEGX5FQ3Q3sw0kY3wvFIt+zIMPf1i3mcH1Z2t5vACn7ZADUsRc5cM oco5ErNHEmU8Zy7XKDl/ijhyFypY3axkG2m4ig9PEjkIOh8vRGbFT9kgZGwsp1jgoDD9 NBemkugAZXqwmEaHfGSQlIbrxZ1fc0L8cd6w1GLyZMEwjXpRM6eLGnhGC934zLJjZwdu O7Il21o2Vnx/9JCx6wnIUz9nOAw9yL6Jv1kKxc2hSJ5wEoCWxUTl1PXbSgTAxKAUE3p+ kMyfNUZIqH7hxb1JebLznoNfY8hkUVe+KS9GDNK7elcFDaebiNqw1ZtkRU99bqDApLM7 Fv1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:user-agent; bh=8ZZdwg9lcy0z91UPab3v9CZJ0b9BOj9iK1CKQUx/A14=; b=rqvNuc2Ni5878sX+sp18BBYUGFriI27fKON++bj3E42Ql3wysfS8lnCbZN82+jb5/t oWwDz52GZ0XrQ+YfwcAHOatR4aviYRkYQ5TrapUTEan1XoFs6A8xwWDvahVkBYgEJL4H ILGRkJ5f1UislisJ1OrORZaP7ODGiKPG0brlp3SdosUun08RRmPFcwQluxccSWiztf1E D4a0/1AwfVEnqAG51bnnyLTqGWsTAGZgMCJ1Oc6vLehlXggMVmCtiLk5lJXgPbWowxMv 4nqJYH2jyyrFRDgmOwINkIdyFOgb0ClvDHyM0hlzGDEVAfctoYJqVkdfeVUETczCJtx3 2DJA== X-Gm-Message-State: ABuFfoh2YSh1DgsQwAx/lZpto7KI9gYfKJh7y39E6IWQdfynf/lykyy6 GgQR56inGRbh1HKNP7KImBo= X-Google-Smtp-Source: ACcGV61QGkIkrOKG6h+A8vpL12hB7nyuzZc0aqgBPPeeXFFDdEoUQPP5F7pH0AwdLQl9Yqj3KtATpw== X-Received: by 2002:a37:8305:: with SMTP id f5-v6mr45679646qkd.230.1540257068671; Mon, 22 Oct 2018 18:11:08 -0700 (PDT) Received: from WindFlash ([179.159.21.48]) by smtp.gmail.com with ESMTPSA id c36-v6sm37310693qta.56.2018.10.22.18.11.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Oct 2018 18:11:07 -0700 (PDT) Date: Mon, 22 Oct 2018 22:11:01 -0300 From: Leonardo =?utf-8?b?QnLDoXM=?= To: lkcamp@lists.libreplanetbr.org Cc: Borislav Petkov , David.Laight@aculab.com, Andy Lutomirski , Ingo Molnar , helen@koikeco.de, Masahiro Yamada , Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/5] Adds -Wshadow on KBUILD_HOSTCFLAGS Message-ID: <20181023011101.GA6588@WindFlash> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Adds -Wshadow on KBUILD_HOSTCFLAGS to show shadow warnings on tools built for HOST. Signed-off-by: Leonardo Brás --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e8b599b4dcde..3edae5d359b5 100644 --- a/Makefile +++ b/Makefile @@ -360,7 +360,7 @@ HOST_LFS_LIBS := $(shell getconf LFS_LIBS 2>/dev/null) HOSTCC = gcc HOSTCXX = g++ -KBUILD_HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 \ +KBUILD_HOSTCFLAGS := -Wall -Wshadow -Wmissing-prototypes -Wstrict-prototypes -O2 \ -fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS) \ $(HOSTCFLAGS) KBUILD_HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS)