Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1078975ybm; Wed, 22 May 2019 17:05:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxUjlkq9bKccUcDBc5K91YmnuxrPu7CFqofcpQfq4s/8Y9FaIOm07WnTyc8oz5bMWQ2lqm2 X-Received: by 2002:a63:2325:: with SMTP id j37mr92379154pgj.137.1558569935616; Wed, 22 May 2019 17:05:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558569935; cv=none; d=google.com; s=arc-20160816; b=WYcqoYZWGZL2W9fHM8u6N70ICbw+16xrtZZBiL+ENtu8HRxbASkEmY6FSHC72iFgxB /TjzHcOgthRkngJ0ku90mWHgzI0HX8CRMNNnZ6hhMI7XwkuT1WUjS+cB5IsB3smwsUG/ pE4x5fANn6ZZRwTdWKWtFBuH40HJQiWxM15E0r7nQjH/D6EodB5pLO1ub1gRB80swsWa pCOKWLQMMQ7JexoMfH5HVPiM8MRuNPSw9ysOVsEFHTqo3//tOYlw9DzIjuO0J4rF1rln hlfwD08HgG2i7r7DC5mgo+t6fcyn+d+kMPJr3mc3eGeDVcfIt/iHlbXSqcSVkVrykseM M8UA== 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=hcRZMZc+7Tdd7ZH6SVueQjiYHRTLYppUeJyfNxJObUo=; b=wm10BMjoTn4GXrnfRNMqpwA7/2nXeGFdsvH6gd3OcvOqm198JIVEK58mlr8WyyoRNi 5lj70rk5rw4kLlsjQpnxk2r0rXBNKDFcZMmih537iSwbRTdH+7Ork7lHv8auRdeLMxQb dNDnVAU6L+KVC2XCqLv2A0JGl+Lu9PmsQeH82y9Yz13K0OA1UuLACxVT5p7C5xmxhTMf zgdmbKgTTBua2MdrcabksVDUZnbySSoIE80nbQvVPauWl7iTGEwd9uabat+UKJqaYlPT dOuwZq2R5q0ugKtYSY1FcorFuQ8piX4khdDxTfjZhFySdSXFzjaW3I0fKIrUzVQ9ZqYY LgBA== 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 i6si26086314plt.13.2019.05.22.17.05.20; Wed, 22 May 2019 17:05:35 -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 S1729808AbfEWAEG (ORCPT + 99 others); Wed, 22 May 2019 20:04:06 -0400 Received: from ex13-edg-ou-001.vmware.com ([208.91.0.189]:13607 "EHLO EX13-EDG-OU-001.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729694AbfEWAED (ORCPT ); Wed, 22 May 2019 20:04:03 -0400 Received: from sc9-mailhost2.vmware.com (10.113.161.72) by EX13-EDG-OU-001.vmware.com (10.113.208.155) with Microsoft SMTP Server id 15.0.1156.6; Wed, 22 May 2019 17:03:42 -0700 Received: from rlwimi.localdomain (unknown [10.129.221.32]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id D2B4CB2068; Wed, 22 May 2019 20:03:55 -0400 (EDT) From: Matt Helsley To: LKML CC: Ingo Molnar , Josh Poimboeuf , Peter Zijlstra , Steven Rostedt , Matt Helsley Subject: [RFC][PATCH 06/13] recordmcount: Kernel style formatting Date: Wed, 22 May 2019 17:03:29 -0700 Message-ID: <6ad25a3760b02b22c7e655931c07daaca64659a1.1558569448.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-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 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 f32a81251d5d..3301769254ec 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