From patchwork Wed Oct 24 04:03:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leonardo Bras X-Patchwork-Id: 10654153 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 1FEA117E2 for ; Wed, 24 Oct 2018 04:04:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 109F029DB8 for ; Wed, 24 Oct 2018 04:04:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0527629DC8; Wed, 24 Oct 2018 04:04:36 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,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 A2A5C29DB8 for ; Wed, 24 Oct 2018 04:04:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725996AbeJXMa0 (ORCPT ); Wed, 24 Oct 2018 08:30:26 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:44986 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726449AbeJXMaZ (ORCPT ); Wed, 24 Oct 2018 08:30:25 -0400 Received: by mail-qk1-f195.google.com with SMTP id n12so1135448qkh.11; Tue, 23 Oct 2018 21:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=88tE2zjEF2j1GAGOLvzG+qHTGlCXFlhFhtkVbtaj0Xc=; b=J2D73BAFyJaU21S6JWh6bLsBu+7Hz8molMeZEVoTKiy/R2PEjnQ6qwyLA2d1GuzgrE xexsAdlUnpep4wT5q0pHb0AbocaVmEzGyx2MjjMM3SqaswKK+Z3c8iplnap7j9+jh+qV UjOpGhNZAlqby8PuNIL/Do91OPssuG3zZTY8uWDmvhjIR8GfFmWg8sRnFB9KUJ2Vn5PA 81cjsfU1ic3aExCLXqhlY7ZbCHBZWkP+vAiJGQ0Ls0s2vcYPE7MbY/9ANyQt+msqSNHj ms7TAOjmABM6i7WXTrryDETgpjJsJ7DURNwGAHqsv0KUADshTUgRNOcMPZT2ywA3IUc0 pBwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=88tE2zjEF2j1GAGOLvzG+qHTGlCXFlhFhtkVbtaj0Xc=; b=Zalst3SpGhJjVhZOF1i5lfZoskd1/ZF+uc7nHWXFeAogRV31M4Ed12jh1Myuf455qh DB74bntfvzfMdurTeOt8bJsHvs/sGBGZVxF11NZetu5tfbQtJjS2YnqNU/lkh93jpC8/ yOnUtwdpNbU3WPjd9Njyu2/SvQNVd0DYhv82OMwL5jVd5qU3YdWcyhmxCoqCXQcquN6L 0v31wSwjeX67OyDdFvO4QIGkC3Zo9K/RhV/5jJZVL5CojGi0fQ2XGWb/UNbKDjp7FlzB 9yl0gkp4/S5F3c4kIn3twNLiSVFUn/j4MX+ciy9NjA8fHoNoR33f6/9b43ucPQc5ntmm f53w== X-Gm-Message-State: AGRZ1gKuPKOAI4tOyQjfZe5y3GV8SvwOb0RHZykMGZn7vKUIY6yijNE+ hBySkzUJ+z9uwOM2Ulvqyws= X-Google-Smtp-Source: AJdET5dJj34PF5kK11M8ALUp0GpSP7KXvAiXXRC1VJ8ZMST4tefNKM6rmo9kWBlf+X3L5upwFp4rNg== X-Received: by 2002:ae9:c01a:: with SMTP id u26-v6mr842266qkk.328.1540353847025; Tue, 23 Oct 2018 21:04:07 -0700 (PDT) Received: from localhost.localdomain ([179.159.21.48]) by smtp.gmail.com with ESMTPSA id e195-v6sm3229126qka.2.2018.10.23.21.04.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 21:04:06 -0700 (PDT) From: Leonardo Bras To: lkcamp@lists.libreplanetbr.org Cc: Leonardo Bras , 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 v3 1/5] x86/vdso: Renames variable to fix shadow warning. Date: Wed, 24 Oct 2018 01:03:50 -0300 Message-Id: <20181024040354.24879-2-leobras.c@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181024040354.24879-1-leobras.c@gmail.com> References: <20181024040354.24879-1-leobras.c@gmail.com> MIME-Version: 1.0 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 The go32() and go64() functions have an argument and a local variable called ‘name’. Rename both to clarify the code and to fix a warning with -Wshadow. Signed-off-by: Leonardo Bras --- 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 Wed Oct 24 04:03:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonardo Bras X-Patchwork-Id: 10654141 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 B624413BF for ; Wed, 24 Oct 2018 04:04:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A60BA29DB8 for ; Wed, 24 Oct 2018 04:04:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A95629DC8; Wed, 24 Oct 2018 04:04:17 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,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 56CF629DB8 for ; Wed, 24 Oct 2018 04:04:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726772AbeJXMaa (ORCPT ); Wed, 24 Oct 2018 08:30:30 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:43904 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726449AbeJXMaa (ORCPT ); Wed, 24 Oct 2018 08:30:30 -0400 Received: by mail-qk1-f193.google.com with SMTP id m17-v6so2314908qkk.10; Tue, 23 Oct 2018 21:04:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NYupy0TAMQX9ANbtIAFOJdw7USjhcvPmg1UT0VrOxEg=; b=AYTCiEwoqf5reGphmyiZjHue7Mo3cS1HWrbsiqlvANJ6YEzXirUF37jAwfkeQ6vDTz gX6WEy4RFPXT/ChWzfBWT/aiOrz2hx0GLD4dMgaY6IMhmnq0o2oeMYXqmVL885mUk2+x izrudr7mUrvvI4gKmP4RHZPp/Wwvu6K0VLn0oulDKfpPukzvqBS6sZoAPQpEFp1hPY12 X3J/Ocs0IG7u38z1xo1YqsRRRQMEHMlUXDjzv6FjJ/DkBP1SSu2R0MD1OVsuVvhDDyGP oXjl+k5ul0njkZm5TW+Z6CGlUV8e6GzJskbwiaVWt+KLrN/pQ63Y/ADyVLMCpv81GP/Y EA0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NYupy0TAMQX9ANbtIAFOJdw7USjhcvPmg1UT0VrOxEg=; b=GSKaSgK+jED6pgHYMRZHTB/vjIpWegUnbsrpNfw3Gd4Q7/nTbWwMqiMmcKuEw6m2a7 0OdSxRA/LD+Md0LvVIhM5iderH9R8fx0vNH+S+NVnN23Vbd6XN84ta/D0hctw40Vouiw wQW9VbxtCN5R9N22gEm7xx1QKRfc8afqigfiosZD7Z7sbiUDnYTliOvtTgTG+3nAC15y apNrPvT2+7Y6vFEpdqyC/rX4XEpfZDb3wOhcycWnbLSalBPu3QhQopOtci6fW6ZCYIJt SVt41S1C899+xfG/7lhkM7cpGtc+0SdazBJTXyITJ+3kK3/V1mmyr7Eo5RkS49dQNYaD pB4Q== X-Gm-Message-State: AGRZ1gKxxLcY8FkTBstB7cXka+xieIxSzBTGx2rcHDc/dWLK074yQoWk rTyrHvFNs4qKG+azKIBtOGI= X-Google-Smtp-Source: AJdET5ebG0OzTl8HIWMA1kPBCXrSD6IEAE7bjSMExKUEbDNOwu7t1CFbhQY09bjEOo8D9UmD2JLaew== X-Received: by 2002:a37:2455:: with SMTP id w82-v6mr870170qkg.247.1540353851547; Tue, 23 Oct 2018 21:04:11 -0700 (PDT) Received: from localhost.localdomain ([179.159.21.48]) by smtp.gmail.com with ESMTPSA id e195-v6sm3229126qka.2.2018.10.23.21.04.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 21:04:11 -0700 (PDT) From: Leonardo Bras To: lkcamp@lists.libreplanetbr.org Cc: Leonardo Bras , 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 v3 2/5] kbuild: Removes unnecessary shadowed local variable. Date: Wed, 24 Oct 2018 01:03:51 -0300 Message-Id: <20181024040354.24879-3-leobras.c@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181024040354.24879-1-leobras.c@gmail.com> References: <20181024040354.24879-1-leobras.c@gmail.com> MIME-Version: 1.0 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 Bras --- 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 Wed Oct 24 04:03:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonardo Bras X-Patchwork-Id: 10654143 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 A0A6A13BF for ; Wed, 24 Oct 2018 04:04:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9323D29DB8 for ; Wed, 24 Oct 2018 04:04:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8782329DC8; Wed, 24 Oct 2018 04:04:21 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,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 2973329DB8 for ; Wed, 24 Oct 2018 04:04:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726863AbeJXMaf (ORCPT ); Wed, 24 Oct 2018 08:30:35 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:41772 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726449AbeJXMaf (ORCPT ); Wed, 24 Oct 2018 08:30:35 -0400 Received: by mail-qk1-f196.google.com with SMTP id g13-v6so2322438qke.8; Tue, 23 Oct 2018 21:04:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5D1hZGQn79sjYuJIciSxWCUSa1H94oaAOohqbOYmnPw=; b=rk2/LpXUFkJOz5u8T5qtI3WGt7M0UqyEdeCO6AqwqA2l9OgE6D/qMPvqXT5ygU6ovC EQIPoDQQId/5ttOA2mB2SHH6/wUh8JGL5wHxQjSWnLNXbTC3rbmsXSvMn0AHTvA+2D4v PyuyANFcglMLRu2xVe4/eAxUT8q3LuBpkC0xSjDnJe+YNU0YOhXVDrLlSOF6/pmCXw4U 5CX4OCZcaOrlP3gagcPO5Dji7IAOH4Wibgvkngl1riFZ70VrEwqA2HfETDC9ZNz2yKF0 59MPNrPT6zV0NO+aaRZbFf2H0gLdHyCi3pgwBRGQIyNXx09pshyF0ZOwbiG1ATCcm62N RK/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5D1hZGQn79sjYuJIciSxWCUSa1H94oaAOohqbOYmnPw=; b=jJQLe6srftnqp5ERDSqvbyFfhqoHHyXNcsTgiUwg5xoo3ewj9NQcgFctb00Lxj1H3S 4AwHEc4RytySo47B0TfiF2IpOgj7F4PEGC+G5ZQ3NPrO9xtGE7UyCX0zEkKqgaxmx4Wl KN6AG+YwEOXPRTzvGM7AK9NO5jSbzw+ZfO54ed+93adnaFrAqyLMfQQ9Rk7JNKKXI295 uWVRFmv3IYR/gEJe9PiICMmBYjxJeFhMB///p6hDAhc1PmGa1WK0fjOmpsN8NGkDeeL2 5xInC1/nl7uqA0IorDNFyjenyrLG9PSsOuqEXRKzAdOUr5QONphBiatc9Qo+UvOloWoW UeSQ== X-Gm-Message-State: AGRZ1gI3xg+1JirhSoEQOPiCHlLn3Sq+egTkjVby2nbC7MAUBZX7y3Jr dhrkLQ6Q8bhES0sFH+gnd88= X-Google-Smtp-Source: AJdET5dtzI20RY5+5wDbK6LXaPfnMfyJRanYbTIip+/rOfOukxeBUq+TzGueS0GxbbrLoxdQ3ZupUA== X-Received: by 2002:ae9:e313:: with SMTP id v19-v6mr856863qkf.318.1540353856686; Tue, 23 Oct 2018 21:04:16 -0700 (PDT) Received: from localhost.localdomain ([179.159.21.48]) by smtp.gmail.com with ESMTPSA id e195-v6sm3229126qka.2.2018.10.23.21.04.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 21:04:16 -0700 (PDT) From: Leonardo Bras To: lkcamp@lists.libreplanetbr.org Cc: Leonardo Bras , 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 v3 3/5] Creates macro to avoid variable shadowing Date: Wed, 24 Oct 2018 01:03:52 -0300 Message-Id: <20181024040354.24879-4-leobras.c@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181024040354.24879-1-leobras.c@gmail.com> References: <20181024040354.24879-1-leobras.c@gmail.com> MIME-Version: 1.0 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. Then, makes use of DEF_FIELD_ADDR_VAR to create a variable of another name, in order to avoid variable shadowing. Signed-off-by: Leonardo Bras --- scripts/mod/file2alias.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 7be43697ff84..ed468313ddeb 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) \ @@ -644,7 +652,7 @@ static void do_pnp_card_entries(void *symval, unsigned long size, for (i = 0; i < count; i++) { unsigned int j; - DEF_FIELD_ADDR(symval + i*id_size, pnp_card_device_id, devs); + DEF_FIELD_ADDR(symval + i * id_size, pnp_card_device_id, devs); for (j = 0; j < PNP_MAX_DEVICES; j++) { const char *id = (char *)(*devs)[j].id; @@ -656,10 +664,13 @@ static void do_pnp_card_entries(void *symval, unsigned long size, /* find duplicate, already added value */ for (i2 = 0; i2 < i && !dup; i2++) { - DEF_FIELD_ADDR(symval + i2*id_size, pnp_card_device_id, devs); + DEF_FIELD_ADDR_VAR(symval + i2 * id_size, + pnp_card_device_id, + devs, devs_dup); for (j2 = 0; j2 < PNP_MAX_DEVICES; j2++) { - const char *id2 = (char *)(*devs)[j2].id; + const char *id2 = + (char *)(*devs_dup)[j2].id; if (!id2[0]) break; From patchwork Wed Oct 24 04:03:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonardo Bras X-Patchwork-Id: 10654147 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 B693F17E2 for ; Wed, 24 Oct 2018 04:04:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A8DB229DB8 for ; Wed, 24 Oct 2018 04:04:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D63629DC9; Wed, 24 Oct 2018 04:04:34 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,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 49F9329DE2 for ; Wed, 24 Oct 2018 04:04:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726899AbeJXMak (ORCPT ); Wed, 24 Oct 2018 08:30:40 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:46653 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726898AbeJXMaj (ORCPT ); Wed, 24 Oct 2018 08:30:39 -0400 Received: by mail-qt1-f193.google.com with SMTP id c16-v6so4207153qtj.13; Tue, 23 Oct 2018 21:04:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Yg0WFvnhpoiY1xicrTEMzVs+sIxjqijPnqrrojoKadA=; b=l4ykYFjrxd+tE8MLPU4hUwoZE/9w2uR6AyW5yDPeef6cRrD472Uccm3d4OM+Vo7Kgc ghB2Mlxv0He2l3IZ7YQdZdBRVQT8nAqPwXLJ0rHAocDR/90EeTzauiSxK4Co91CIGXP1 YSYu4D7ju/4Mj0Lsf2GAbpa8jOftW47aPr4l9JSFpn+FNXMr2EX736IMtqafdX3f0ROg INNRlwhPun3yzIU5n4EgyoitcMZiIM1wAqTGigtlULQ9NADbBOlnW9KXKwkIEBS17rqe KEXxt+2+BIBjrbNcR9OBjYxOzupGKu1qvqdNpaH0Kz+Am5yPASMFqWs2Ej6ZH/VjCa0Q kG4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Yg0WFvnhpoiY1xicrTEMzVs+sIxjqijPnqrrojoKadA=; b=m43VfDErx+VQp1D9nzd8PUlGFYo0VGBxBQb/9vB0iCKryqwWUkNLszWTAiEJfUPaqX brKAqftQ4n/cbdwCQ23I6tzJ98+GAb1XbD1TEv97lHQQk31w1YSrFW1UGcdxSl86cjJu fyuh77C225PTbTU43+CRxEwo6tAbX3DY44d5NVKsmp5dMv0wOiHAoSvqIqDj11QSFccX Ug8+I2bCT9X1F5z4r+XVmoFbFWBdki3ZDT8FpJ55ciev+rbmNivj0Vi4MYDsM4visTRS XawZDFQnqNEbuoDazHmMlONTiMdoTOwa92GISEYT9UVwkx771CAHD+tf2gKhaPu3sDP5 v5gg== X-Gm-Message-State: AGRZ1gLI+dwB1Mi6L0+ErONWHOfO8l286JqF9bQwrUeu58PYsWDMcNnS +2iM9h40sMdbj82z452tKOw= X-Google-Smtp-Source: AJdET5fw8P03DX+dcu9bu3JBYFKZwspy5r9CUkHSM1xAmz2PBNY4gRcejzdiN9xE9umBSi9Ye7twqg== X-Received: by 2002:a0c:983d:: with SMTP id c58-v6mr930642qvd.86.1540353861450; Tue, 23 Oct 2018 21:04:21 -0700 (PDT) Received: from localhost.localdomain ([179.159.21.48]) by smtp.gmail.com with ESMTPSA id e195-v6sm3229126qka.2.2018.10.23.21.04.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 21:04:21 -0700 (PDT) From: Leonardo Bras To: lkcamp@lists.libreplanetbr.org Cc: Leonardo Bras , 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 v3 4/5] modpost: Changes parameter name to avoid shadowing. Date: Wed, 24 Oct 2018 01:03:53 -0300 Message-Id: <20181024040354.24879-5-leobras.c@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181024040354.24879-1-leobras.c@gmail.com> References: <20181024040354.24879-1-leobras.c@gmail.com> MIME-Version: 1.0 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 Bras --- 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 Wed Oct 24 04:03:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonardo Bras X-Patchwork-Id: 10654145 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 70F2D14BB for ; Wed, 24 Oct 2018 04:04:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6213329DB8 for ; Wed, 24 Oct 2018 04:04:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5661B29DF8; Wed, 24 Oct 2018 04:04:34 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,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 486B029DB8 for ; Wed, 24 Oct 2018 04:04:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727026AbeJXMap (ORCPT ); Wed, 24 Oct 2018 08:30:45 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:40730 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727021AbeJXMao (ORCPT ); Wed, 24 Oct 2018 08:30:44 -0400 Received: by mail-qt1-f196.google.com with SMTP id z9-v6so4231610qto.7; Tue, 23 Oct 2018 21:04:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xcajrvfrkbhr4aN7eaKQgtnrP3L7wB3TYYRQ4bJlwjA=; b=I25XmZ3qMOOznouA8nIzeRBZb0ujCDT+w2KzXknbrHl0wADNsAVM3uE82AVROt9ynR 2RWWsERdWGlO9OxhpAxAKHV6nPIaBlcNQZSTNvGaqtcUT8nSuNOptrCFTov4hUshxXSC cFmJLtfhXMVtIuUz/oVpz2LaBLvpTNwmKw5vHE0sSxxi5zOd8kz4EGmJCNwGYQfXkcaD l70eUCYPCDsXKGanZbCPbHiYsivfxHIID1JxXCmJz3/iKZ5vzOaKHoCMPfVskNy20mmr guL1DJTe3m81w87vx+MlCVxyQi/HUvujgslgyU+ty0frx75bL7z5Sh9WuPjhbNQwW7tq 3bkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xcajrvfrkbhr4aN7eaKQgtnrP3L7wB3TYYRQ4bJlwjA=; b=Pu/mY/pZsJUt4f1xNBMRTD9uBEKAeLFPhikYA2MoqAez1ErBoB+BLXpOazBTvc9FgT 3QquRzO65cwlvIhNgg9oRTQ0uCzGGcLB4ASioMhCCmFT3kF1Yt4gPr/QLiAIZxlMnH3M PklZsvheLdCZjpkQqSgQtjnOWw/g19XuAAHMzQZAoUMmSHrEqDYBakXFtMvDpN7EWpNr 7vXCDcUqpQ8ecC9075mHeN77y09xbj2BkDMzDIJpfsDEFmUvOkkxIbfflAkAet/qMdv9 AYuaMtB+Je7/jU2GtLxemlsF0Mn6jjh3Gavv4PMvBpxGJ/BFnVJ2jl/ps7+H4rM7DNcT 3OdA== X-Gm-Message-State: AGRZ1gJHYIbU2YcO5le9Cj/7xwCeodPtLRylPIuOBvZfpDx3R+pBeok5 Ci7nXH7TNUJX5XyjWf6kRx4= X-Google-Smtp-Source: AJdET5dX+1y67BUbP8yoaOq+yzRgk4Z+ZZdVd/ZolHZcTOZHpYpkR6c5FZGoRWp4CWBxAGCsKCfQLA== X-Received: by 2002:a0c:e091:: with SMTP id l17mr893708qvk.144.1540353865835; Tue, 23 Oct 2018 21:04:25 -0700 (PDT) Received: from localhost.localdomain ([179.159.21.48]) by smtp.gmail.com with ESMTPSA id e195-v6sm3229126qka.2.2018.10.23.21.04.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 21:04:25 -0700 (PDT) From: Leonardo Bras To: lkcamp@lists.libreplanetbr.org Cc: Leonardo Bras , 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 v3 5/5] Adds -Wshadow on KBUILD_HOSTCFLAGS Date: Wed, 24 Oct 2018 01:03:54 -0300 Message-Id: <20181024040354.24879-6-leobras.c@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181024040354.24879-1-leobras.c@gmail.com> References: <20181024040354.24879-1-leobras.c@gmail.com> MIME-Version: 1.0 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 Bras --- 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)