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) {