[PATCH] [17/50] x86_64: remove STR() macros

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andi Kleen
Date: Friday, September 21, 2007 - 3:32 pm

From: Glauber de Oliveira Costa <gcosta@redhat.com>
This patch removes the __STR() and STR() macros from x86_64 header files.
They seem to be legacy, and has no more users. Even if there were users,
they should use __stringify() instead.

In fact, there were one third place in which this macro was defined
(ia32_binfmt.c), and used just below. In this file, usage was properly
converted to __stringify()

Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
Signed-off-by: Andi Kleen <ak@suse.de>

---
 arch/x86_64/ia32/ia32_binfmt.c |    5 +----
 include/asm-x86_64/hw_irq.h    |    3 ---
 include/asm-x86_64/system.h    |    3 ---
 3 files changed, 1 insertion(+), 10 deletions(-)

Index: linux/arch/x86_64/ia32/ia32_binfmt.c
===================================================================
--- linux.orig/arch/x86_64/ia32/ia32_binfmt.c
+++ linux/arch/x86_64/ia32/ia32_binfmt.c
@@ -112,11 +112,8 @@ struct elf_prpsinfo
 	char	pr_psargs[ELF_PRARGSZ];	/* initial part of arg list */
 };
 
-#define __STR(x) #x
-#define STR(x) __STR(x)
-
 #define _GET_SEG(x) \
-	({ __u32 seg; asm("movl %%" STR(x) ",%0" : "=r"(seg)); seg; })
+	({ __u32 seg; asm("movl %%" __stringify(x) ",%0" : "=r"(seg)); seg; })
 
 /* Assumes current==process to be dumped */
 #define ELF_CORE_COPY_REGS(pr_reg, regs)       		\
Index: linux/include/asm-x86_64/hw_irq.h
===================================================================
--- linux.orig/include/asm-x86_64/hw_irq.h
+++ linux/include/asm-x86_64/hw_irq.h
@@ -149,9 +149,6 @@ extern atomic_t irq_mis_count;
 
 #define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs))
 
-#define __STR(x) #x
-#define STR(x) __STR(x)
-
 #include <asm/ptrace.h>
 
 #define IRQ_NAME2(nr) nr##_interrupt(void)
Index: linux/include/asm-x86_64/system.h
===================================================================
--- linux.orig/include/asm-x86_64/system.h
+++ linux/include/asm-x86_64/system.h
@@ -7,9 +7,6 @@
 
 #ifdef __KERNEL__
 
-#define __STR(x) #x
-#define STR(x) __STR(x)
-
 #define __SAVE(reg,offset) "movq %%" #reg ",(14-" #offset ")*8(%%rsp)\n\t"
 #define __RESTORE(reg,offset) "movq (14-" #offset ")*8(%%rsp),%%" #reg "\n\t"
 
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] [0/50] x86 2.6.24 patches review II, Andi Kleen, (Fri Sep 21, 3:31 pm)
[PATCH] [3/50] x86_64: remove never used apic_mapped, Andi Kleen, (Fri Sep 21, 3:32 pm)
[PATCH] [5/50] i386: change order in Kconfig.cpu, Andi Kleen, (Fri Sep 21, 3:32 pm)
[PATCH] [6/50] i386: clean up oops/bug reports, Andi Kleen, (Fri Sep 21, 3:32 pm)
[PATCH] [8/50] x86_64: remove x86_cpu_to_log_apicid, Andi Kleen, (Fri Sep 21, 3:32 pm)
[PATCH] [17/50] x86_64: remove STR() macros, Andi Kleen, (Fri Sep 21, 3:32 pm)
[PATCH] [21/50] i386: Misc cpuinit annotations, Andi Kleen, (Fri Sep 21, 3:32 pm)
[PATCH] [22/50] i386: Misc cpuinit annotations, Andi Kleen, (Fri Sep 21, 3:32 pm)
[PATCH] [28/50] i386: remove stub early_printk.c, Andi Kleen, (Fri Sep 21, 3:32 pm)
[PATCH] [30/50] x86_64: remove some dead code, Andi Kleen, (Fri Sep 21, 3:32 pm)
[PATCH] [36/50] x86: Use raw locks during oopses, Andi Kleen, (Fri Sep 21, 3:32 pm)
[PATCH] [40/50] i386: Fix section mismatch, Andi Kleen, (Fri Sep 21, 3:32 pm)
[PATCH] [42/50] i386: constify wd_ops, Andi Kleen, (Fri Sep 21, 3:32 pm)
[PATCH] [50/50] x86_64: Remove fpu io port resource, Andi Kleen, (Fri Sep 21, 3:32 pm)
Re: [PATCH] [6/50] i386: clean up oops/bug reports, Chuck Ebbert, (Fri Sep 21, 3:41 pm)
Re: [PATCH] [34/50] i386: Fix argument signedness warnings, Satyam Sharma, (Fri Sep 21, 10:06 pm)
Re: [PATCH] [4/50] x86: add cpu codenames for Kconfig.cpu, Sam Ravnborg, (Fri Sep 21, 11:57 pm)
Re: [PATCH] [4/50] x86: add cpu codenames for Kconfig.cpu, Jan Engelhardt, (Sat Sep 22, 2:46 am)
Re: [PATCH] [6/50] i386: clean up oops/bug reports, Jan Engelhardt, (Sat Sep 22, 2:47 am)
Re: [PATCH] [34/50] i386: Fix argument signedness warnings, Jan Engelhardt, (Sat Sep 22, 3:01 am)
Re: [PATCH] [4/50] x86: add cpu codenames for Kconfig.cpu, Randy Dunlap, (Sat Sep 22, 10:40 am)
Re: [PATCH] [4/50] x86: add cpu codenames for Kconfig.cpu, Thomas Gleixner, (Sat Sep 22, 10:50 am)