Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/egtvedt/linux-avr32

Pull AVR32 updates from Hans-Christian Egtvedt.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32:
  avr32: replace simple_strtoul() with kstrtoul()
  arch/avr32/mm/cache.c: export symbol flush_icache_range() for module using
  avr32: remove cpu_data macro to fix compiles
  • Loading branch information
torvalds committed Apr 1, 2014
2 parents 01d5f3b + 4c3b7df commit f27a15d
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion arch/avr32/include/asm/bugs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
7 changes: 1 addition & 6 deletions arch/avr32/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
48 changes: 26 additions & 22 deletions arch/avr32/kernel/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand All @@ -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);
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;

Expand Down
1 change: 1 addition & 0 deletions arch/avr32/mm/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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().
Expand Down

0 comments on commit f27a15d

Please sign in to comment.