From 8acc8722d3b5755abbfbe73f732dec576f28757a Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Sat, 22 Feb 2014 09:28:27 +0100 Subject: avr32: remove cpu_data macro to fix compiles Having cpu_data as a parameterless macro can easily cause build failures because it can be a variable name like in linux/pm_domain.h [1]. So, remove the macro and convert its only user. Because this architecture cannot do SMP, remove the whole SMP block, too. Only compile tested due to no hardware. Signed-off-by: Wolfram Sang Acked-by: Hans-Christian Egtvedt [1] https://lists.01.org/pipermail/kbuild-all/2014-February/003252.html --- arch/avr32/include/asm/bugs.h | 2 +- arch/avr32/include/asm/processor.h | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'arch/avr32') diff --git a/arch/avr32/include/asm/bugs.h b/arch/avr32/include/asm/bugs.h index 7635e770622e..278661bbd1b0 100644 --- a/arch/avr32/include/asm/bugs.h +++ b/arch/avr32/include/asm/bugs.h @@ -9,7 +9,7 @@ static void __init check_bugs(void) { - cpu_data->loops_per_jiffy = loops_per_jiffy; + boot_cpu_data.loops_per_jiffy = loops_per_jiffy; } #endif /* __ASM_AVR32_BUGS_H */ diff --git a/arch/avr32/include/asm/processor.h b/arch/avr32/include/asm/processor.h index 48d71c5c898a..972adcc1e8f4 100644 --- a/arch/avr32/include/asm/processor.h +++ b/arch/avr32/include/asm/processor.h @@ -83,13 +83,8 @@ static inline unsigned int avr32_get_chip_revision(struct avr32_cpuinfo *cpu) extern struct avr32_cpuinfo boot_cpu_data; -#ifdef CONFIG_SMP -extern struct avr32_cpuinfo cpu_data[]; -#define current_cpu_data cpu_data[smp_processor_id()] -#else -#define cpu_data (&boot_cpu_data) +/* No SMP support so far */ #define current_cpu_data boot_cpu_data -#endif /* This decides where the kernel will search for a free chunk of vm * space during mmap's -- cgit v1.2.3-59-g8ed1b From 2601566d01026d6ad46b1e967466aee7fbce948e Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Sun, 9 Mar 2014 05:35:46 +0800 Subject: arch/avr32/mm/cache.c: export symbol flush_icache_range() for module using Need export symbol flush_icache_range() to modules, just like another platforms have done, or can not pass compiling. The related error (with allmodconfig under avr32): ERROR: "flush_icache_range" [drivers/misc/lkdtm.ko] undefined! make[1]: *** [__modpost] Error 1 make: *** [modules] Error 2 Signed-off-by: Chen Gang Acked-by: Hans-Christian Egtvedt --- arch/avr32/mm/cache.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/avr32') diff --git a/arch/avr32/mm/cache.c b/arch/avr32/mm/cache.c index 6a46ecd56cfd..85d635cd7b28 100644 --- a/arch/avr32/mm/cache.c +++ b/arch/avr32/mm/cache.c @@ -111,6 +111,7 @@ void flush_icache_range(unsigned long start, unsigned long end) __flush_icache_range(start & ~(linesz - 1), (end + linesz - 1) & ~(linesz - 1)); } +EXPORT_SYMBOL(flush_icache_range); /* * This one is called from __do_fault() and do_swap_page(). -- cgit v1.2.3-59-g8ed1b From 4c3b7df4ed541f934e7aad7a52aee12d44b9c2ff Mon Sep 17 00:00:00 2001 From: Ramkumar Ramachandra Date: Mon, 31 Mar 2014 20:42:42 -0400 Subject: avr32: replace simple_strtoul() with kstrtoul() simple_strtoul() is marked for obsoletion; use the newer and more pleasant kstrtoul() in its place. Cc: Alexey Dobriyan Cc: Haavard Skinnemoen Cc: Hans-Christian Egtvedt Signed-off-by: Ramkumar Ramachandra Signed-off-by: Hans-Christian Egtvedt --- arch/avr32/kernel/cpu.c | 48 ++++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) (limited to 'arch/avr32') diff --git a/arch/avr32/kernel/cpu.c b/arch/avr32/kernel/cpu.c index 2233be71e2e8..0341ae27c9ec 100644 --- a/arch/avr32/kernel/cpu.c +++ b/arch/avr32/kernel/cpu.c @@ -39,10 +39,12 @@ static ssize_t store_pc0event(struct device *dev, size_t count) { unsigned long val; - char *endp; + int ret; - val = simple_strtoul(buf, &endp, 0); - if (endp == buf || val > 0x3f) + ret = kstrtoul(buf, 0, &val); + if (ret) + return ret; + if (val > 0x3f) return -EINVAL; val = (val << 12) | (sysreg_read(PCCR) & 0xfffc0fff); sysreg_write(PCCR, val); @@ -61,11 +63,11 @@ static ssize_t store_pc0count(struct device *dev, const char *buf, size_t count) { unsigned long val; - char *endp; + int ret; - val = simple_strtoul(buf, &endp, 0); - if (endp == buf) - return -EINVAL; + ret = kstrtoul(buf, 0, &val); + if (ret) + return ret; sysreg_write(PCNT0, val); return count; @@ -84,10 +86,12 @@ static ssize_t store_pc1event(struct device *dev, size_t count) { unsigned long val; - char *endp; + int ret; - val = simple_strtoul(buf, &endp, 0); - if (endp == buf || val > 0x3f) + ret = kstrtoul(buf, 0, &val); + if (ret) + return ret; + if (val > 0x3f) return -EINVAL; val = (val << 18) | (sysreg_read(PCCR) & 0xff03ffff); sysreg_write(PCCR, val); @@ -106,11 +110,11 @@ static ssize_t store_pc1count(struct device *dev, size_t count) { unsigned long val; - char *endp; + int ret; - val = simple_strtoul(buf, &endp, 0); - if (endp == buf) - return -EINVAL; + ret = kstrtoul(buf, 0, &val); + if (ret) + return ret; sysreg_write(PCNT1, val); return count; @@ -129,11 +133,11 @@ static ssize_t store_pccycles(struct device *dev, size_t count) { unsigned long val; - char *endp; + int ret; - val = simple_strtoul(buf, &endp, 0); - if (endp == buf) - return -EINVAL; + ret = kstrtoul(buf, 0, &val); + if (ret) + return ret; sysreg_write(PCCNT, val); return count; @@ -152,11 +156,11 @@ static ssize_t store_pcenable(struct device *dev, size_t count) { unsigned long pccr, val; - char *endp; + int ret; - val = simple_strtoul(buf, &endp, 0); - if (endp == buf) - return -EINVAL; + ret = kstrtoul(buf, 0, &val); + if (ret) + return ret; if (val) val = 1; -- cgit v1.2.3-59-g8ed1b