Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp27263imm; Tue, 16 Oct 2018 17:11:12 -0700 (PDT) X-Google-Smtp-Source: ACcGV60C0PhENlwuiMWYwfNAH3g5iet/fPdWcp1f83uB+D3JBWWtXQxh29PGtyV8ZnA8gzq9deUW X-Received: by 2002:a17:902:7d98:: with SMTP id a24-v6mr23510966plm.271.1539735072517; Tue, 16 Oct 2018 17:11:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539735072; cv=none; d=google.com; s=arc-20160816; b=OH6xQGLbicQ1bziU6YpYvOVebv/JX6pdmive/tvDblK6eF+YithDXDwbTIxylx5jwp TU6Hq4lmpKFR9inN15iV/F1z/IVaDiPQeiTvR3wEPjaNj2c2IRPfjT9n41tvrQXdEflJ vRJ3PZBMsVqLHBCn6fdA1LGqe5FTvrEH5gkspZbRAtVw528L+pFo+eYWUn6U1kGQBld6 xJykpok13C6rWnyMcPQIDfYHX8xkPa/LAIdZGWbxapLd1ftOVoqoEmVZRzbWqY7Jk1Hl MAzPm3US06dNjF3Izx9xZ4yUhBzrINIzZ+8Bwo0ERD/5CU+kY7Wt9k3Swth8NnsKwq3M vIEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-transfer-encoding :content-disposition:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=Rk/ypljEkW1Kxbdg+0tIBavPRfEkfxYVRHQuJ41aF3s=; b=JU/vOhzaGDPc8UnnyR6o4c5pRx73VHxlKC3VZTm7+ZDrXcD16FMvxmoheGQBW7e7HY CvBpPfYdPcRc+6oaiB0OQ7dmlAIx9DcP4bWbGOBFVeDJMoo77piStxbUxtPiksT9iVFP 94fGWFT/ZyK1T7m69Ka4cpgJcgEivOCSCmwPrQZkYZ7ynX3VX1w6qwFJlwqNToLN6D2q dMHCSG3DHX3s7ebN2f0wSWPsDKWIPA7dDcfw0qmxBTw7tHzLUiOYPEzRAB4eHHd6BsYw ZMs1yo0aFl01JkxKQx8nXpez1vEXt6FPCsFriJI923sMhQEjyFE8x35FltQuleVgPAgQ oZig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=t1OqtJYc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z7-v6si14711138plk.215.2018.10.16.17.10.28; Tue, 16 Oct 2018 17:11:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=t1OqtJYc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727553AbeJQICn (ORCPT + 99 others); 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-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-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.19.1