Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5214991ybi; Tue, 11 Jun 2019 21:57:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7e1H4OA9afrFLsXeAG3Ieqy9oI+H49ab1HJ/+PGCDK9CkHvSBy7LHikpsW6ew8U+VqBkm X-Received: by 2002:a63:26c6:: with SMTP id m189mr434517pgm.2.1560315470052; Tue, 11 Jun 2019 21:57:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560315470; cv=none; d=google.com; s=arc-20160816; b=fl3oCi1jxotptGnjW8TcclY7onRHpg1WEOuUdcpB68JGjdE7TbA1p/eJ6I+kdHyQfR Ygp8ylZx4TsgK3IqPqCOWiH915FfkrQnDSca7qfMrOwugYaUrNvjfUCmc72cOjm3lL6G c8lOpnkTqR4NCy0yptVH7d/yhJKyEuuhdoZ353R0yNpvTHZ0T4/Sng3EUKpSAUJpbyWp sBX43X1DqbthsLYzPfrNekRZLOXS4LvRSoz3giavSOFypGqRpMsZ3nrpgkHYyHzFj/v0 oc3P4DwduhVO3SlY024lV/KOj9K5S9nkCoTFkq1eVFyneQWRoPtqP1ijnID1gL5gOyx0 zaXA== 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=Jb7xb5HgMA4IjNefeVC1EGNolF0+aYNW/ULjGztlj10=; b=jp3qPDs6F8T/RzhjfqPDIf2bQYmXodt8SuJAf1V8pq/Mnp1c47EckffnDcZw5aJXNu B4kd8szU9+nGVgF0w+NJEn6Fu+iFJB6xn/fkAZenH65ExKORUaIIQOkNRGGyp9/2uNio NpVm0IQN2ZVFRsxw9Vv/+yLsF/N4kvyB64RIFl+H6PjhZKvp9DugYkTxPBw/gVWKo2AW lQTKsogZuH4nFv728W1Jm8tq8b1sCUzYHnG9xuOIAiQ6Z5kpP/4DKkEpesAjP6p5QMll IoWQdkavTFBw7f1I/jcfeAGdoMifuWFb2zyr1NM8IAIzOkRRFR3Q/76Bs7fHHWJ/5rkH mwqw== 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 t4si1411428plq.93.2019.06.11.21.57.35; Tue, 11 Jun 2019 21:57:50 -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 S2436859AbfFKWWW (ORCPT + 99 others); Tue, 11 Jun 2019 18:22:22 -0400 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:29003 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436822AbfFKWWR (ORCPT ); Tue, 11 Jun 2019 18:22:17 -0400 Received: from sc9-mailhost3.vmware.com (10.113.161.73) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Tue, 11 Jun 2019 15:22:12 -0700 Received: from rlwimi.localdomain (unknown [10.129.220.121]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 7BDD041BAB; Tue, 11 Jun 2019 15:22:15 -0700 (PDT) From: Matt Helsley To: LKML CC: Ingo Molnar , Josh Poimboeuf , Peter Zijlstra , Steven Rostedt , Matt Helsley Subject: [PATCH v2 06/13] recordmcount: Kernel style formatting Date: Tue, 11 Jun 2019 15:21:48 -0700 Message-ID: <407b7c862a74da4a055c1fe0c8dade73a31cb44e.1560285597.git.mhelsley@vmware.com> X-Mailer: git-send-email 2.20.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-002.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 Fix up the whitespace irregularity in the ELF switch blocks. Swapping the initial value of gpfx allows us to simplify all but one of the one-line switch cases even further. Signed-off-by: Matt Helsley --- scripts/recordmcount.c | 47 ++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c index 1c3599f07f9b..9ae975ccf2dc 100644 --- a/scripts/recordmcount.c +++ b/scripts/recordmcount.c @@ -487,15 +487,15 @@ static int do_file(char const *const fname) push_bl_mcount_thumb = push_bl_mcount_thumb_be; break; } /* end switch */ - if (memcmp(ELFMAG, ehdr->e_ident, SELFMAG) != 0 - || w2(ehdr->e_type) != ET_REL - || ehdr->e_ident[EI_VERSION] != EV_CURRENT) { + if (memcmp(ELFMAG, ehdr->e_ident, SELFMAG) != 0 || + w2(ehdr->e_type) != ET_REL || + ehdr->e_ident[EI_VERSION] != EV_CURRENT) { fprintf(stderr, "unrecognized ET_REL file %s\n", fname); cleanup(); goto out; } - gpfx = 0; + gpfx = '_'; switch (w2(ehdr->e_machine)) { default: fprintf(stderr, "unrecognized e_machine %u %s\n", @@ -508,32 +508,35 @@ static int do_file(char const *const fname) make_nop = make_nop_x86; ideal_nop = ideal_nop5_x86_32; mcount_adjust_32 = -1; + gpfx = 0; + break; + case EM_ARM: + reltype = R_ARM_ABS32; + altmcount = "__gnu_mcount_nc"; + make_nop = make_nop_arm; + rel_type_nop = R_ARM_NONE; + gpfx = 0; break; - case EM_ARM: reltype = R_ARM_ABS32; - altmcount = "__gnu_mcount_nc"; - make_nop = make_nop_arm; - rel_type_nop = R_ARM_NONE; - break; case EM_AARCH64: - reltype = R_AARCH64_ABS64; - make_nop = make_nop_arm64; - rel_type_nop = R_AARCH64_NONE; - ideal_nop = ideal_nop4_arm64; - gpfx = '_'; - break; - case EM_IA_64: reltype = R_IA64_IMM64; gpfx = '_'; break; - case EM_MIPS: /* reltype: e_class */ gpfx = '_'; break; - case EM_PPC: reltype = R_PPC_ADDR32; gpfx = '_'; break; - case EM_PPC64: reltype = R_PPC64_ADDR64; gpfx = '_'; break; - case EM_S390: /* reltype: e_class */ gpfx = '_'; break; - case EM_SH: reltype = R_SH_DIR32; break; - case EM_SPARCV9: reltype = R_SPARC_64; gpfx = '_'; break; + reltype = R_AARCH64_ABS64; + make_nop = make_nop_arm64; + rel_type_nop = R_AARCH64_NONE; + ideal_nop = ideal_nop4_arm64; + break; + case EM_IA_64: reltype = R_IA64_IMM64; break; + case EM_MIPS: /* reltype: e_class */ break; + case EM_PPC: reltype = R_PPC_ADDR32; break; + case EM_PPC64: reltype = R_PPC64_ADDR64; break; + case EM_S390: /* reltype: e_class */ break; + case EM_SH: reltype = R_SH_DIR32; gpfx = 0; break; + case EM_SPARCV9: reltype = R_SPARC_64; break; case EM_X86_64: make_nop = make_nop_x86; ideal_nop = ideal_nop5_x86_64; reltype = R_X86_64_64; rel_type_nop = R_X86_64_NONE; mcount_adjust_64 = -1; + gpfx = 0; break; } /* end switch */ -- 2.20.1