Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6388662ybi; Wed, 31 Jul 2019 13:29:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqzUXIhCUI+edDNHo6h9ELZTtaVDX0XW0z9fTiuRS4G1/IaAY/Im0PMl3rrCsvNAyJIycU+L X-Received: by 2002:a17:90a:f98a:: with SMTP id cq10mr4703698pjb.43.1564604956834; Wed, 31 Jul 2019 13:29:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564604956; cv=none; d=google.com; s=arc-20160816; b=ZgnXthnpy7fkCoPGSFRibOY7SU/UVnSRAwxza9vYIzGkl4TsNsi4dn4lq2X1nk2T/S OPSUnedr90hq+Qy47BVAl41HJjRpIkLIFeCedEbA47dC/PXNsHRQk3zB9XQBtNyWMNsE eHQnS2RrAyi2Ylx46UyFGE21+fdvvQY6R6tjb6gSNyt2eLOudOBBkoUPhmvk9B9g6C7Z rLy7Y8dfZh/pQm8fV9pyoDf3OYVA7qcevriEPKLv3EMuBY7JMA038Mq+YRZ49fX00IOD r5Nml6EGNvUOr2EHQ0sra9P5cPbYu78shH4k3J0FOBDyzYAS3E52/9AdeuL8uALGCQgU uSYg== 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=s+R5iyqeWKmAP+9sr+XSUslyw15eocQZuEEk5DfXqt4=; b=gUFtAf0krTDEOYsIXGVfszTMC3RddtkPbJnnZ4d27rGVN1jY7gkhTAXt99crGnQgzI 4+Cs9vFVmO9g22fc78izn8MuKb57E6xXuGDM+rbbNS+azcYKrIbrF6hEeK4x9LQejc3y FCk2IyRUN6+M2s3wapBO2cCSWR8W6SVuocJCK+OU5F8l3p++0rVxIkHmedSiSW1rRmsS Gs8vM2yZsYcAZBOyzlzajmVoc466Tn8xQSCFAY3ne3Hm3VmTQML7KRCEnK8k+D5bMM1y GILrM6WyAq+gMJj0CqJWR8E0JvVl8WLTb5Lc/hBF28woh9BxjTUQ2bB25U1hYd8Xxv8r YZvA== 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 j18si34127171pfe.235.2019.07.31.13.29.01; Wed, 31 Jul 2019 13:29:16 -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 S1727902AbfGaSYv (ORCPT + 99 others); Wed, 31 Jul 2019 14:24:51 -0400 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:7789 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729775AbfGaSYs (ORCPT ); Wed, 31 Jul 2019 14:24:48 -0400 Received: from sc9-mailhost2.vmware.com (10.113.161.72) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Wed, 31 Jul 2019 11:24:35 -0700 Received: from rlwimi.localdomain (unknown [10.166.66.112]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 1C21CB288B; Wed, 31 Jul 2019 14:24:39 -0400 (EDT) From: Matt Helsley To: LKML CC: Ingo Molnar , Steven Rostedt , Matt Helsley Subject: [PATCH v4 6/8] recordmcount: Kernel style formatting Date: Wed, 31 Jul 2019 11:24:14 -0700 Message-ID: <647f21f43723d3e831cedd3238c893db03eea6f0.1564596289.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 67f9c45b824f..273ca8b42b20 100644 --- a/scripts/recordmcount.c +++ b/scripts/recordmcount.c @@ -489,15 +489,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", @@ -510,32 +510,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