diff options
author | H Hartley Sweeten <hartleys@visionengravers.com> | 2012-09-19 20:06:47 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-21 12:26:20 -0400 |
commit | 5743aaac2938eb841e14879b0f73afb7fca6f0ad (patch) | |
tree | d01c088c049535280da0d466e03e24bb86652c5d | |
parent | 1f5cc359158772304a92ee9c5682ca83416d2ba8 (diff) |
staging: comedi: 8253: mmio address is a void __iomem *
The inline functions for accessing a memory mapped 8254 device
are using a void * for the 'base_address' of the device. Memory
mapped io using the read/write functions should be using a
void __iomem * for the address.
Fixing these exposed a couple other void * / void __iomem *
issues in the ni_labpc driver.
This fixes a number of sparse warnings like:
warning: incorrect type in argument 2 (different address spaces)
expected void volatile [noderef] <asn:2>*addr
got void *
warning: incorrect type in argument 1 (different address spaces)
expected void const volatile [noderef] <asn:2>*addr
got void *<noident>
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/comedi/drivers/8253.h | 15 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/ni_labpc.c | 12 |
2 files changed, 15 insertions, 12 deletions
diff --git a/drivers/staging/comedi/drivers/8253.h b/drivers/staging/comedi/drivers/8253.h index 3eb45d46e05b..429e0d60c0a3 100644 --- a/drivers/staging/comedi/drivers/8253.h +++ b/drivers/staging/comedi/drivers/8253.h | |||
@@ -262,8 +262,10 @@ static inline int i8254_load(unsigned long base_address, unsigned int regshift, | |||
262 | return 0; | 262 | return 0; |
263 | } | 263 | } |
264 | 264 | ||
265 | static inline int i8254_mm_load(void *base_address, unsigned int regshift, | 265 | static inline int i8254_mm_load(void __iomem *base_address, |
266 | unsigned int counter_number, unsigned int count, | 266 | unsigned int regshift, |
267 | unsigned int counter_number, | ||
268 | unsigned int count, | ||
267 | unsigned int mode) | 269 | unsigned int mode) |
268 | { | 270 | { |
269 | unsigned int byte; | 271 | unsigned int byte; |
@@ -311,7 +313,8 @@ static inline int i8254_read(unsigned long base_address, unsigned int regshift, | |||
311 | return ret; | 313 | return ret; |
312 | } | 314 | } |
313 | 315 | ||
314 | static inline int i8254_mm_read(void *base_address, unsigned int regshift, | 316 | static inline int i8254_mm_read(void __iomem *base_address, |
317 | unsigned int regshift, | ||
315 | unsigned int counter_number) | 318 | unsigned int counter_number) |
316 | { | 319 | { |
317 | unsigned int byte; | 320 | unsigned int byte; |
@@ -348,7 +351,7 @@ static inline void i8254_write(unsigned long base_address, | |||
348 | outb(byte, base_address + (counter_number << regshift)); | 351 | outb(byte, base_address + (counter_number << regshift)); |
349 | } | 352 | } |
350 | 353 | ||
351 | static inline void i8254_mm_write(void *base_address, | 354 | static inline void i8254_mm_write(void __iomem *base_address, |
352 | unsigned int regshift, | 355 | unsigned int regshift, |
353 | unsigned int counter_number, | 356 | unsigned int counter_number, |
354 | unsigned int count) | 357 | unsigned int count) |
@@ -390,7 +393,7 @@ static inline int i8254_set_mode(unsigned long base_address, | |||
390 | return 0; | 393 | return 0; |
391 | } | 394 | } |
392 | 395 | ||
393 | static inline int i8254_mm_set_mode(void *base_address, | 396 | static inline int i8254_mm_set_mode(void __iomem *base_address, |
394 | unsigned int regshift, | 397 | unsigned int regshift, |
395 | unsigned int counter_number, | 398 | unsigned int counter_number, |
396 | unsigned int mode) | 399 | unsigned int mode) |
@@ -419,7 +422,7 @@ static inline int i8254_status(unsigned long base_address, | |||
419 | return inb(base_address + (counter_number << regshift)); | 422 | return inb(base_address + (counter_number << regshift)); |
420 | } | 423 | } |
421 | 424 | ||
422 | static inline int i8254_mm_status(void *base_address, | 425 | static inline int i8254_mm_status(void __iomem *base_address, |
423 | unsigned int regshift, | 426 | unsigned int regshift, |
424 | unsigned int counter_number) | 427 | unsigned int counter_number) |
425 | { | 428 | { |
diff --git a/drivers/staging/comedi/drivers/ni_labpc.c b/drivers/staging/comedi/drivers/ni_labpc.c index 295ddbb4d586..2d060b5cc1b7 100644 --- a/drivers/staging/comedi/drivers/ni_labpc.c +++ b/drivers/staging/comedi/drivers/ni_labpc.c | |||
@@ -409,12 +409,12 @@ static inline void labpc_outb(unsigned int byte, unsigned long address) | |||
409 | 409 | ||
410 | static inline unsigned int labpc_readb(unsigned long address) | 410 | static inline unsigned int labpc_readb(unsigned long address) |
411 | { | 411 | { |
412 | return readb((void *)address); | 412 | return readb((void __iomem *)address); |
413 | } | 413 | } |
414 | 414 | ||
415 | static inline void labpc_writeb(unsigned int byte, unsigned long address) | 415 | static inline void labpc_writeb(unsigned int byte, unsigned long address) |
416 | { | 416 | { |
417 | writeb(byte, (void *)address); | 417 | writeb(byte, (void __iomem *)address); |
418 | } | 418 | } |
419 | 419 | ||
420 | static const struct labpc_board_struct labpc_boards[] = { | 420 | static const struct labpc_board_struct labpc_boards[] = { |
@@ -494,8 +494,8 @@ static inline int labpc_counter_load(struct comedi_device *dev, | |||
494 | unsigned int count, unsigned int mode) | 494 | unsigned int count, unsigned int mode) |
495 | { | 495 | { |
496 | if (thisboard->memory_mapped_io) | 496 | if (thisboard->memory_mapped_io) |
497 | return i8254_mm_load((void *)base_address, 0, counter_number, | 497 | return i8254_mm_load((void __iomem *)base_address, 0, |
498 | count, mode); | 498 | counter_number, count, mode); |
499 | else | 499 | else |
500 | return i8254_load(base_address, 0, counter_number, count, mode); | 500 | return i8254_load(base_address, 0, counter_number, count, mode); |
501 | } | 501 | } |
@@ -1896,10 +1896,10 @@ static int labpc_dio_mem_callback(int dir, int port, int data, | |||
1896 | unsigned long iobase) | 1896 | unsigned long iobase) |
1897 | { | 1897 | { |
1898 | if (dir) { | 1898 | if (dir) { |
1899 | writeb(data, (void *)(iobase + port)); | 1899 | writeb(data, (void __iomem *)(iobase + port)); |
1900 | return 0; | 1900 | return 0; |
1901 | } else { | 1901 | } else { |
1902 | return readb((void *)(iobase + port)); | 1902 | return readb((void __iomem *)(iobase + port)); |
1903 | } | 1903 | } |
1904 | } | 1904 | } |
1905 | 1905 | ||