Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10011810ybi; Wed, 24 Jul 2019 14:08:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyjUs79LWZUF91LvA66AcurRW6ndoJ5ddcMZ0+q4r0uR/tUu0KimwwllYAPiELXi3kLv9xZ X-Received: by 2002:a63:de4f:: with SMTP id y15mr86166999pgi.239.1564002527020; Wed, 24 Jul 2019 14:08:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564002527; cv=none; d=google.com; s=arc-20160816; b=EqV6xPQT05NcoUQJQWEL3H2O7RYXcBrO7tHvnW0YenYqBEFpq4c7X2rsIvhY8eoAyD GL7E2wneVeP/WkR4G4ejJum3rqslSqgwOjDnLsMztP4nfs7Ij5mWk4uhOm1rglXwTapj Mtj6SWITZLSTzqqQLkMSb5SfrRnkhYKdLu007cIzHjY5LCm7vV1COUBLD5Dj9MNb5XpC kwlMyxtG8abBu2NmHDPOTI3qk03aCzdgnWE8WX4QXQMFEDIpneqe40/9pWv8bLaWXJqt ieSahXXRU0pDBP4ph1/NhBz6PHQM3fPKDOXsKLwBWQcJTPu1fUTYP8/8TPhdgTM5OsbH MzXQ== 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=W5ympEYNaP66ys+yF8S8ZOClB3lK4SW4WTG6bLxoDAQBVoV9xSS8OB7y5x5b3ljoXn eBkKklEyA7mR+Bz4iI2tsAHfC/X/lacvXFDWtNrVh8ZBbIUFdqIsLlpdaSw9el3rdiEf XmoIYpT1Y/JcdGKupP1BS4yfQdQ8ECcBp4cvLObx8/7D4AyQhPnFzwEI7yUFp9IQBipk hICzJf+s7IE5dEz3mw7TriplADrjsLkcLPq0zyRjxzHD69hb8bkPBtteAqkaRsUsjnlu x+WZ7fFuaKIHLNMpBkELqb/CxqUwHLz1+htMVIN27quFiOsQO8YVWfcgswBU1QqJhZJ/ 4bIg== 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 g31si13530166plb.241.2019.07.24.14.08.32; Wed, 24 Jul 2019 14:08:47 -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 S2388302AbfGXVGD (ORCPT + 99 others); Wed, 24 Jul 2019 17:06:03 -0400 Received: from ex13-edg-ou-001.vmware.com ([208.91.0.189]:53154 "EHLO EX13-EDG-OU-001.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387671AbfGXVFf (ORCPT ); Wed, 24 Jul 2019 17:05:35 -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; Wed, 24 Jul 2019 14:05:08 -0700 Received: from rlwimi.localdomain (unknown [10.166.65.164]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 085D4407CB; Wed, 24 Jul 2019 14:05:28 -0700 (PDT) From: Matt Helsley To: LKML CC: Ingo Molnar , Josh Poimboeuf , Peter Zijlstra , Steven Rostedt , Matt Helsley Subject: [PATCH v3 06/13] recordmcount: Kernel style formatting Date: Wed, 24 Jul 2019 14:05:00 -0700 Message-ID: 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 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