From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/4] arm64: drop redundant macros from read_cpuid()
Date: Mon, 16 Dec 2013 22:04:35 +0100	[thread overview]
Message-ID: <1387227878-30438-2-git-send-email-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <1387227878-30438-1-git-send-email-ard.biesheuvel@linaro.org>
asm/cputype.h contains a bunch of #defines for CPU id registers
that essentially map to themselves. Remove the #defines and pass
the tokens directly to the inline asm() that reads the registers.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 arch/arm64/include/asm/cputype.h | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)
diff --git a/arch/arm64/include/asm/cputype.h b/arch/arm64/include/asm/cputype.h
index 5fe138e..e1af1b4 100644
--- a/arch/arm64/include/asm/cputype.h
+++ b/arch/arm64/include/asm/cputype.h
@@ -16,23 +16,13 @@
 #ifndef __ASM_CPUTYPE_H
 #define __ASM_CPUTYPE_H
 
-#define ID_MIDR_EL1		"midr_el1"
-#define ID_MPIDR_EL1		"mpidr_el1"
-#define ID_CTR_EL0		"ctr_el0"
-
-#define ID_AA64PFR0_EL1		"id_aa64pfr0_el1"
-#define ID_AA64DFR0_EL1		"id_aa64dfr0_el1"
-#define ID_AA64AFR0_EL1		"id_aa64afr0_el1"
-#define ID_AA64ISAR0_EL1	"id_aa64isar0_el1"
-#define ID_AA64MMFR0_EL1	"id_aa64mmfr0_el1"
-
 #define INVALID_HWID		ULONG_MAX
 
 #define MPIDR_HWID_BITMASK	0xff00ffffff
 
 #define read_cpuid(reg) ({						\
 	u64 __val;							\
-	asm("mrs	%0, " reg : "=r" (__val));			\
+	asm("mrs	%0, " #reg : "=r" (__val));			\
 	__val;								\
 })
 
@@ -54,12 +44,12 @@
  */
 static inline u32 __attribute_const__ read_cpuid_id(void)
 {
-	return read_cpuid(ID_MIDR_EL1);
+	return read_cpuid(MIDR_EL1);
 }
 
 static inline u64 __attribute_const__ read_cpuid_mpidr(void)
 {
-	return read_cpuid(ID_MPIDR_EL1);
+	return read_cpuid(MPIDR_EL1);
 }
 
 static inline unsigned int __attribute_const__ read_cpuid_implementor(void)
@@ -74,7 +64,7 @@ static inline unsigned int __attribute_const__ read_cpuid_part_number(void)
 
 static inline u32 __attribute_const__ read_cpuid_cachetype(void)
 {
-	return read_cpuid(ID_CTR_EL0);
+	return read_cpuid(CTR_EL0);
 }
 
 #endif /* __ASSEMBLY__ */
-- 
1.8.3.2
next prev parent reply	other threads:[~2013-12-16 21:04 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-16 21:04 [PATCH 0/4] arm64: advertise availability of CRC and crypto instructions Ard Biesheuvel
2013-12-16 21:04 ` Ard Biesheuvel [this message]
2013-12-17 12:04   ` [PATCH 1/4] arm64: drop redundant macros from read_cpuid() Catalin Marinas
2013-12-17 12:10     ` Will Deacon
2013-12-17 12:12       ` Catalin Marinas
2013-12-16 21:04 ` [PATCH 2/4] arm64: Add hwcaps for crypto and CRC32 extensions Ard Biesheuvel
2013-12-17 12:08   ` Catalin Marinas
2013-12-17 12:11     ` Catalin Marinas
2013-12-16 21:04 ` [PATCH 3/4] ARM: allocate hwcaps bits for v8 crypto extensions Ard Biesheuvel
2013-12-16 21:04 ` [PATCH 4/4] arm64: add 32-bit compat hwcaps " Ard Biesheuvel
2013-12-17 12:25 ` [PATCH 0/4] arm64: advertise availability of CRC and crypto instructions Catalin Marinas
2013-12-18  9:50   ` Ard Biesheuvel
2013-12-18 10:03     ` Russell King - ARM Linux
2013-12-18 10:25       ` Ard Biesheuvel
2013-12-18 10:55         ` Russell King - ARM Linux
2013-12-18 11:15           ` Ard Biesheuvel
2013-12-18 11:27             ` Catalin Marinas
2013-12-18 11:34               ` Catalin Marinas
2013-12-18 11:42               ` Russell King - ARM Linux
2013-12-18 11:59                 ` Ard Biesheuvel
2013-12-18 12:03                 ` Catalin Marinas
2013-12-18 14:27                   ` Christopher Covington
2013-12-18 16:13                     ` Ard Biesheuvel
2013-12-18 17:29                       ` Catalin Marinas
2013-12-18 18:50                         ` Ard Biesheuvel
2013-12-19 11:11                           ` Catalin Marinas
2013-12-18 19:57                       ` Nicolas Pitre
2013-12-18 20:26                         ` Ard Biesheuvel
2013-12-18 21:18                           ` Nicolas Pitre
2013-12-18 21:57                             ` Ard Biesheuvel
2013-12-19  6:48                               ` Siarhei Siamashka
2013-12-19 11:48                                 ` Catalin Marinas
2013-12-20  6:29                                   ` Siarhei Siamashka
2013-12-20 11:27                                     ` Catalin Marinas
2013-12-19 17:33                                 ` Ard Biesheuvel
2013-12-20  1:35                                   ` Siarhei Siamashka
2013-12-19 18:07                               ` Nicolas Pitre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox
  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):
  git send-email \
    --in-reply-to=1387227878-30438-2-git-send-email-ard.biesheuvel@linaro.org \
    --to=ard.biesheuvel@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY
  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
  Be sure your reply has a Subject: header at the top and a blank line
  before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).