Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp910327ybb; Fri, 10 Apr 2020 12:38:34 -0700 (PDT) X-Google-Smtp-Source: APiQypL0CCVGlYatdQwx/T+x/jJ9LNawpFFSosfBY2gqMykbITEIVdnSRLkznHUDdnAPIYINslm6 X-Received: by 2002:a0c:dd05:: with SMTP id u5mr1217651qvk.41.1586547514826; Fri, 10 Apr 2020 12:38:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586547514; cv=none; d=google.com; s=arc-20160816; b=OYFsnIXaXe0QNMAPwaE0r89ruZa7MZ9/64k/6VKpTtF6Nb/Ashsh1nmub94lUZ2EP/ 0+x1I5lT4/gqfQa3TqlFxaoLmDfUP+bPdY2jdSUZ85luW4T/TEbBX3c9yMeotOFOfqIs CsJJtrHMZC+0FcpkDpkmcODitodwBaE5kS9Pf5uQWxwIfg5HyO/vdoKcYjGUPZnyOXWU mnuE/yUzIn/7ucopshT1zxbXBidJgJK//Zn7wXiKktxVq+T+juYjhsuAysV9N6w0zDlO dfc4RcVDNWuNgwG3hiVAlcQIdjuoUnDG4ELu5NoSdb5yvzbql4Vkn4f8TUF11hQe6ufa ghLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=X6Gbi3cmx+OZ+aACsVYzkgrVqhyPHvIo58EpMsJUuZE=; b=mHiOW/G3XN4X/VHhLY4VzabWBEAWOvXV9TRDgiaIxUNdhCF+fj9fIZTH511TCsYjTn JV9Mq9HScMeZQZ53F7QKicW0MDgZ+KSJAOoFh620W2mcykQ7FQQtlB+SR5P8Huh4LuJr I9Szd+TBAmCMvG64vlGHUDRUG9gZX85lTU9K5xG9x25NdblWYESXpzZi25SZycPggEGY kYGqm9NzbFXRWEERa9qNN+HrueUbSLSSPciXBvLqSEx/Fft7h6nQcq1AXTFm+Yuu9/0j 5nXOBEK6SrXKH4gZ86MpX5REoeovffCNdh0PoAaM4MkMG78Y24Y22w3JqCR4ie0yfSoY qmWg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=vmware.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b19si1661805qtq.330.2020.04.10.12.38.20; Fri, 10 Apr 2020 12:38:34 -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; 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=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=vmware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726892AbgDJThP (ORCPT + 99 others); Fri, 10 Apr 2020 15:37:15 -0400 Received: from ex13-edg-ou-001.vmware.com ([208.91.0.189]:55154 "EHLO EX13-EDG-OU-001.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726646AbgDJThO (ORCPT ); Fri, 10 Apr 2020 15:37:14 -0400 Received: from sc9-mailhost3.vmware.com (10.113.161.73) by EX13-EDG-OU-001.vmware.com (10.113.208.155) with Microsoft SMTP Server id 15.0.1156.6; Fri, 10 Apr 2020 12:37:09 -0700 Received: from sc9-mailhost3.vmware.com (unknown [10.166.69.226]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id BD57C40BBE; Fri, 10 Apr 2020 12:37:13 -0700 (PDT) From: Matt Helsley To: CC: Josh Poimboeuf , Peter Zijlstra , Julien Thierry , Ingo Molnar , Steven Rostedt , Miroslav Benes , Matt Helsley Subject: [RFC][PATCH 11/36] objtool: mcount: Remove unused fname parameter Date: Fri, 10 Apr 2020 12:35:34 -0700 Message-ID: <540320f6d29a9eb3cb9ec0bbeb8deed1f0995b1f.1586468801.git.mhelsley@vmware.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII Received-SPF: None (EX13-EDG-OU-001.vmware.com: mhelsley@vmware.com does not designate permitted sender hosts) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The name of the object file being processed is unused in leaf functions and only passed down to reach them so we can remove it. Signed-off-by: Matt Helsley --- tools/objtool/recordmcount.c | 4 ++-- tools/objtool/recordmcount.h | 19 ++++++++----------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/tools/objtool/recordmcount.c b/tools/objtool/recordmcount.c index 46a275a393a8..df16783434ae 100644 --- a/tools/objtool/recordmcount.c +++ b/tools/objtool/recordmcount.c @@ -586,7 +586,7 @@ static int do_file(char const *const fname) reltype = R_MIPS_32; is_fake_mcount32 = MIPS32_is_fake_mcount; } - if (do32(ehdr, fname, reltype) < 0) + if (do32(ehdr, reltype) < 0) goto out; break; case ELFCLASS64: { @@ -607,7 +607,7 @@ static int do_file(char const *const fname) Elf64_r_info = MIPS64_r_info; is_fake_mcount64 = MIPS64_is_fake_mcount; } - if (do64(ghdr, fname, reltype) < 0) + if (do64(ghdr, reltype) < 0) goto out; break; } diff --git a/tools/objtool/recordmcount.h b/tools/objtool/recordmcount.h index 3c4807dca3d0..3250a461895d 100644 --- a/tools/objtool/recordmcount.h +++ b/tools/objtool/recordmcount.h @@ -466,8 +466,7 @@ static int find_secsym_ndx(unsigned const txtndx, /* Evade ISO C restriction: no declaration after statement in has_rel_mcount. */ static char const * __has_rel_mcount(GElf_Shdr const *const relhdr, /* reltype */ Elf_Shdr const *const shdr0, - char const *const shstrtab, - char const *const fname) + char const *const shstrtab) { /* .sh_info depends on .sh_type == SHT_REL[,A] */ Elf_Shdr const *const txthdr = &shdr0[relhdr->sh_info]; @@ -481,25 +480,23 @@ static char const * __has_rel_mcount(GElf_Shdr const *const relhdr, /* reltype * static char const *has_rel_mcount(GElf_Shdr const *const relhdr, Elf_Shdr const *const shdr0, - char const *const shstrtab, - char const *const fname) + char const *const shstrtab) { if (relhdr->sh_type != SHT_REL && relhdr->sh_type != SHT_RELA) return NULL; - return __has_rel_mcount(relhdr, shdr0, shstrtab, fname); + return __has_rel_mcount(relhdr, shdr0, shstrtab); } static unsigned tot_relsize(Elf_Shdr const *const shdr0, - const char *const shstrtab, - const char *const fname) + const char *const shstrtab) { struct section *sec; unsigned totrelsz = 0; char const *txtname; list_for_each_entry(sec, &lf->sections, list) { - txtname = has_rel_mcount(&sec->sh, shdr0, shstrtab, fname); + txtname = has_rel_mcount(&sec->sh, shdr0, shstrtab); if (txtname && is_mcounted_section_name(txtname)) totrelsz += sec->sh.sh_size; } @@ -508,7 +505,7 @@ static unsigned tot_relsize(Elf_Shdr const *const shdr0, /* Overall supervision for Elf32 ET_REL file. */ -static int do_func(Elf_Ehdr *const ehdr, char const *const fname, +static int do_func(Elf_Ehdr *const ehdr, unsigned const reltype) { Elf_Shdr *const shdr0 = (Elf_Shdr *)(_w(ehdr->e_shoff) @@ -538,7 +535,7 @@ static int do_func(Elf_Ehdr *const ehdr, char const *const fname, if (find_section_by_name(lf, "__mcount_loc") != NULL) return 0; - totrelsz = tot_relsize(shdr0, shstrtab, fname); + totrelsz = tot_relsize(shdr0, shstrtab); if (totrelsz == 0) return 0; mrel0 = umalloc(totrelsz); @@ -559,7 +556,7 @@ static int do_func(Elf_Ehdr *const ehdr, char const *const fname, relhdr = &sec->sh; txtname = has_rel_mcount(relhdr, shdr0, - shstrtab, fname); + shstrtab); if (txtname && is_mcounted_section_name(txtname)) { unsigned int recsym; uint_t recval = 0; -- 2.20.1