From patchwork Wed Oct 17 00:08:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leonardo Bras X-Patchwork-Id: 10644457 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 2D27217D4 for ; Wed, 17 Oct 2018 00:08:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA40A28D3E for ; Wed, 17 Oct 2018 00:08:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CAF572A25E; Wed, 17 Oct 2018 00:08:18 +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 E866128D3E for ; Wed, 17 Oct 2018 00:08:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727410AbeJQIBJ (ORCPT ); Wed, 17 Oct 2018 04:01:09 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:38736 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727171AbeJQIBI (ORCPT ); Wed, 17 Oct 2018 04:01:08 -0400 Received: by mail-qt1-f196.google.com with SMTP id l9-v6so28024553qtf.5; Tue, 16 Oct 2018 17:08:15 -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=VrnIrgBHqN7A7q86ytiSO2+obkna/A+3MKssGl3QH9Q=; b=adLddh31vQgKSwRE+gPgkd9igVDWf/2imqllqD8P0hJbajwWGbtEwFIOHVJkp0DYnG NHhsXmd8JT6yzvSug85vrOzPUV/ymHtrYZZGm/tbzsaOUEJEht6uENY4aQIkZot3h3C9 RO1EXIYOJqARWYmcRYdlQOxPkkJJhdEDBLifjj108694dKR8RpiWzAmtPWVmQJBL7gEn p6CdzsG9eYOxCLbDk2ZUlFllchXVU7pg5Ii3EMGWLAQm2B3RPoaFC6WL56AKM1GiSGyi CpIrf0+ziy4guSWmcrmdCVSPPY9Qvyk3ITiHEbhYpOd0MJnC8qZcOgQbViykkLAyxW2N sh+Q== 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=VrnIrgBHqN7A7q86ytiSO2+obkna/A+3MKssGl3QH9Q=; b=LV9MiakyyJFD7kJiePIQyd3+4mR6ff14o7oiZSWIgvq3fjGoD18wqC4uM8u6xmq0Yc BqEh2/h2AFjWhKmLWCK1tGAvDr0B+Gi09Y+Vvvv/vbOzcAVs30UqecbKcQOoVja69rOV GllSf+AqOZABkDOM64ky7jLJ4kHksMjqSEYhLZMaS+Lk+Wk/wDAH9lV6AfKHTfytcrzT /xAFkimVxxteB77k026tMQ5T6fbXlwhnm8WaA9o835/UI714T1enRwsLJ083wdr8g5Lk LTxodR5HOMv0axl2j26hZahnmd4oZBThO7Ml5q+8UHF1WPADanZb2L4Mu8f7QjLQlKgG 5LYg== X-Gm-Message-State: ABuFfohowRqeLHtstYMYQXCMCX5czy+jPLnqZtapbvW5RrBIHKU/QjnU OCpeoDkTMJP7QXcAYg4ejsA= X-Google-Smtp-Source: ACcGV62s/i1JBDY5MaQxsQjbQ/Bo4tewL2r9YrCRDxVBFvf7p7wKBYbEv1jA148LUopQ7MaMr8L4Wg== X-Received: by 2002:ac8:7482:: with SMTP id v2-v6mr23227319qtq.251.1539734895531; Tue, 16 Oct 2018 17:08:15 -0700 (PDT) Received: from WindFlash ([179.159.21.48]) by smtp.gmail.com with ESMTPSA id q84-v6sm692576qki.40.2018.10.16.17.08.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Oct 2018 17:08:14 -0700 (PDT) Date: Tue, 16 Oct 2018 21:08:09 -0300 From: Leonardo =?utf-8?b?QnLDoXM=?= To: lkcamp@lists.libreplanetbr.org Cc: Matthew Wilcox , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: [PATCH 1/4] Adds -Wshadow=local on KBUILD_HOSTCFLAGS Message-ID: <20181017000809.GA21292@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=local 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..fb0a9ac195e7 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=local -Wmissing-prototypes -Wstrict-prototypes -O2 \ -fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS) \ $(HOSTCFLAGS) KBUILD_HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS) From patchwork Wed Oct 17 00:08:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leonardo Bras X-Patchwork-Id: 10644459 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 2F4C813B0 for ; Wed, 17 Oct 2018 00:08:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 15F762A38C for ; Wed, 17 Oct 2018 00:08:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06FA32A363; Wed, 17 Oct 2018 00:08:42 +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 AA7F12A363 for ; Wed, 17 Oct 2018 00:08:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727410AbeJQIBd (ORCPT ); Wed, 17 Oct 2018 04:01:33 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:37533 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727171AbeJQIBd (ORCPT ); Wed, 17 Oct 2018 04:01:33 -0400 Received: by mail-qt1-f193.google.com with SMTP id d14-v6so28025369qto.4; Tue, 16 Oct 2018 17:08: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=5Q7vGbq961nf2LzoNGlaXLvNyGpktZKrKB9yXgUHndA=; b=EX1hVOn4JuhoKatY4YuCpVLGjN10GHqFZfUCvMSMiGNIuTAA00xiU+efKD7cxPices zFM/hSypQZYAfKES6M2qX+Ss4vwa3K5AyDeSMZWXxcTqV3Z77ChVW783hjcG7i82Ly5O SrlpF7ShP5sjz8BRG4Ry/cGXLWwBcN+KhUAOnPaEqlcyvje20Cu9dDs8ljsaK5SUOt9B 8q195Gn8ZjL/YVw6GAgm0IJMsZAmfazbrstT0DdsmFrFSH+m8kfs5VOhgnpf6UAua25z AKquM1ZT/1tF50i6caYMNbTxGoWiwR+9f70HesWNyaFupGGTX2ggW/84UiJTTTgW99OZ 0VMQ== 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=5Q7vGbq961nf2LzoNGlaXLvNyGpktZKrKB9yXgUHndA=; b=hD/1rVPsD07UMbbnH5eMFusMCIF4CTQ+i4qeR2Fs1D3qB5BZbuOiNXq5SAva+2py8D B6hlInB67WSIa2dphKGa2JUDRGcyiH0Lin+mOBwZUdKw9REO4da0YBJOkrCOwNGozv+w x1qcn7lPv/l6mMMMatoXIPLi5yNMknWGVbQSlWfiwcJbmhe/YGN3OolMKyuOb+L/fk+5 K+kNcYtMP952wp43CsosdPr6cIteDUa0xRxLwVlgjvrXZ6pIEm5S5m6DKg/7PUpv5J2W UoizqJIje99SbGeINi90NsBnGE1bErShJ7kr70lmItMW4DAWTxBC52P260bEwLsDG32z LrZw== X-Gm-Message-State: ABuFfoigRA4Fkpz+5qW7Bn3WuauHjLaD9b7+d+AhCz9jrcnXXqQGmCET 4Qe0dk4SdYLDU2ig8DSkxps= X-Google-Smtp-Source: ACcGV61M+Rf/4oky/z9ua/Cvh8YByBKAByZjKqo3Lztq3/NeyNaUN6I8+J/SdiauRyE8kS8ryRw5Ng== X-Received: by 2002:ac8:4790:: with SMTP id k16-v6mr23183700qtq.253.1539734920249; Tue, 16 Oct 2018 17:08:40 -0700 (PDT) Received: from WindFlash ([179.159.21.48]) by smtp.gmail.com with ESMTPSA id o50-v6sm11689672qtj.41.2018.10.16.17.08.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Oct 2018 17:08:39 -0700 (PDT) Date: Tue, 16 Oct 2018 21:08:34 -0300 From: Leonardo =?utf-8?b?QnLDoXM=?= To: lkcamp@lists.libreplanetbr.org Cc: Matthew Wilcox , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: [PATCH 2/4] Renames variable to fix shadow warning. Message-ID: <20181017000834.GA21330@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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/entry/vdso/vdso2c.h b/arch/x86/entry/vdso/vdso2c.h index fa847a620f40..9466998d0f28 100644 --- a/arch/x86/entry/vdso/vdso2c.h +++ b/arch/x86/entry/vdso/vdso2c.h @@ -93,11 +93,11 @@ 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) + + const char *name2 = 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(name2, required_syms[k].name)) { if (syms[k]) { fail("duplicate symbol %s\n", required_syms[k].name); From patchwork Wed Oct 17 00:09:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leonardo Bras X-Patchwork-Id: 10644461 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 7484B17D4 for ; Wed, 17 Oct 2018 00:09:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6269D2A519 for ; Wed, 17 Oct 2018 00:09:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5641C2A525; Wed, 17 Oct 2018 00:09:20 +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 0E2EB2A519 for ; Wed, 17 Oct 2018 00:09:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727326AbeJQICM (ORCPT ); Wed, 17 Oct 2018 04:02:12 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:38598 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727171AbeJQICM (ORCPT ); Wed, 17 Oct 2018 04:02:12 -0400 Received: by mail-qk1-f195.google.com with SMTP id 204-v6so15368888qkd.5; Tue, 16 Oct 2018 17:09:18 -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=Du6wml9VVnou4jAkLBGM3hlzod6FF9zbSLCzf+JCveM=; b=fQwfadr91a5AmyHL08cXCsMHfp0fqJCUcmYZiXoprz3VziZ5qrrfnU5tEQJYzMh+HK /X06MimgPOluZywapGGBft4kszDXVnOfsgbQNNTxLhZ2dQgzoJGcWTJbnwNuCC/x/Vwc eKsIkHXneVtPRYGuQrtcBbaqSXnNDiVoMvsvpDjvukqUEAK0FLmBpFjyPioRX857h4jP 2Lzqf+3SUYN/drc2FJWI86kFFXA3fl/fXOy24COSX5fACIUOVxHXsk0NMTGIdx1rlbn/ fSqWqh8r5xY7ASkR3udc4qN4APAvX2qVF8vSrgojwOFUItzKGJIywZGFAyBSEQgFdmDv 6M2A== 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=Du6wml9VVnou4jAkLBGM3hlzod6FF9zbSLCzf+JCveM=; b=D4GB1H6KszFK92T/8nCdD0L18AUhTo1bidV8RlF4xH5q6QjlX7HJN2DhwQuPZETcno KlmX6DRP8m7zMKWjQNwvNb43PRqu+jDRBr0Ar1KPtS+I4LLt2YQE7YkvSa9yi5fTN7NF vYTGMYzFVnFN8p6OqtDMRWj5nJ+m69CUiJX4GAdwgZBG9omUeV+lpLeFLc4OV/9Uo/Ch EP10+sNUc7TV0nQMcRga2gjyuBUYyF3B4fgX8DT805oCgFEbcQovSOV3yug5VAXktgNy 3JGoPGLT5RUOjdRYe4/d0dZRFmHAZ5V5cO7Yx33RRNiEcWnEXQdYkv56hoY0VAIZmYYr 0G9A== X-Gm-Message-State: ABuFfojADJwStt81tNPCl15XjMwgWwgFKJRUPaWeOTa0lLlvCOsH1UR1 SOrLmxxo00+Ir8gXkPHJOiVYCaRQ X-Google-Smtp-Source: ACcGV60Kx2VZtZjsmf8vexcO8pwt5URdSQ4/2O0lQOTObvxA2XSWV63/+U2AFS2ZLWJCJUJZYdC9lA== X-Received: by 2002:a37:2d46:: with SMTP id t67-v6mr22525808qkh.351.1539734957923; Tue, 16 Oct 2018 17:09:17 -0700 (PDT) Received: from WindFlash ([179.159.21.48]) by smtp.gmail.com with ESMTPSA id a72-v6sm8297662qkc.19.2018.10.16.17.09.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Oct 2018 17:09:17 -0700 (PDT) Date: Tue, 16 Oct 2018 21:09:12 -0300 From: Leonardo =?utf-8?b?QnLDoXM=?= To: lkcamp@lists.libreplanetbr.org Cc: Matthew Wilcox , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: [PATCH 3/4] kbuild: Removes unnecessary shadowed local variable and optimize testing. Message-ID: <20181017000912.GA21339@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). Optimize test of isdigit: - If isalpha returns true, isdigit will return false, so no need to test. Signed-off-by: Leonardo Brás --- scripts/asn1_compiler.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/asn1_compiler.c b/scripts/asn1_compiler.c index c146020fc783..08bb6e5fd6ad 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. @@ -454,10 +454,9 @@ static void tokenise(char *buffer, char *end) tokens[tix++].token_type = TOKEN_TYPE_NAME; continue; - } + } else if (isdigit(*p)) { + /* Handle numbers */ - /* Handle numbers */ - if (isdigit(*p)) { /* Find the end of the number */ q = p + 1; while (q < nl && (isdigit(*q))) From patchwork Wed Oct 17 00:09:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leonardo Bras X-Patchwork-Id: 10644463 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 A95E6181D for ; Wed, 17 Oct 2018 00:09:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94BA92A521 for ; Wed, 17 Oct 2018 00:09:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8424A2A519; Wed, 17 Oct 2018 00:09: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 1E2F22A519 for ; Wed, 17 Oct 2018 00:09:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727309AbeJQICn (ORCPT ); Wed, 17 Oct 2018 04:02:43 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:43659 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727171AbeJQICn (ORCPT ); Wed, 17 Oct 2018 04:02:43 -0400 Received: by mail-qk1-f194.google.com with SMTP id 12-v6so15368083qkj.10; Tue, 16 Oct 2018 17:09: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=Rk/ypljEkW1Kxbdg+0tIBavPRfEkfxYVRHQuJ41aF3s=; b=t1OqtJYcXFA6LqjDddeMT4zKkFkpfwzkkvbwyQ6J1ypLUqyOHK51xPjP3Lkv7hxnEP Oay3FStrJdAO4vFp+0OvHjcN7J43YW7EUiOM48tFLhXCSzEW8VoaQSoD4WKuBbZ/cX6+ Ti3nN/C/VR21IgEV4pfpf2qrfuC4BBSprmzWLMCeWYwcQ3YQ/IQJAqFfbefB2sK3UmzP A9jBrcIYRgJGBeKCzRTCDG1NvStrUmlcyvc30TOwjh51C2Jyi0UWN2qlMMdxyqbfDjit 0y7yYUfKHWX0wzbV7VVQwyMbRCdYweGADjzw0v4yxSyv7mHqzSpC3DmCrRO3Tb0m+ZFX C78g== 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=Rk/ypljEkW1Kxbdg+0tIBavPRfEkfxYVRHQuJ41aF3s=; b=EtvKDDueDexHPaRyasnSIeOh9iVUwu3OjagyOd77d2XoIGLSxXxF9y5HxAHQ06MMMh iy1qBfkn7YUWRkJJOhEc/9dRl2ntBEjOyuSxgDJ2n/yRCu75ZMpvwNPPwnkIPnmohMPk zph8lD0IU658s2Z2QddVePBrSqBjjW8CqRgBLyTBaLLP16PUnHMs1boCD77j7JLw0/fc X7Hi/EJ0o+cY8qkaHnqzypGTaYvqr5emXfpV1j41Z5C66ZqVEPlH56q5HUsje5Nian6D sABltB8OeuvkV2kPOe5F17X8KMxnvodohoxvB36tiXqDDIM0St6PHjZLbSFx9xdJnCwP NfGQ== X-Gm-Message-State: ABuFfog+JOr5eRmsvty8kBZRiLu4mhP/S0UbjEvg8WMKZSozAbJJ2K4w XDCMSlri/KbMrtma9fHbnCk= X-Google-Smtp-Source: ACcGV63cEACIKB7l583zFxXY5FKQwHFhD0T+RmE9SLRSmNIrF1ZFDk6LTjn2se0MlkoQc+X7I3vq8A== X-Received: by 2002:a37:b042:: with SMTP id z63-v6mr22028105qke.94.1539734989116; Tue, 16 Oct 2018 17:09:49 -0700 (PDT) Received: from WindFlash ([179.159.21.48]) by smtp.gmail.com with ESMTPSA id j41-v6sm11694149qta.43.2018.10.16.17.09.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Oct 2018 17:09:48 -0700 (PDT) Date: Tue, 16 Oct 2018 21:09:43 -0300 From: Leonardo =?utf-8?b?QnLDoXM=?= To: lkcamp@lists.libreplanetbr.org Cc: Matthew Wilcox , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: [PATCH 4/4] Changes macro usage to avoid shadowing a variable. Message-ID: <20181017000943.GA21382@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 usage of DEF_FIELD_ADDR in this function to create a reference and operate over it using an aux variable. It also changes the loop logic used to find duplicates, to avoid creating another variable. Signed-off-by: Leonardo Brás --- scripts/mod/file2alias.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 7be43697ff84..9ea1db2aefdb 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -641,25 +641,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) { 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;