Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: dgnc: cls_uart_struct: adds marker and changes vars' types for sparse

This patch removes these sparse warnings found in the cls.c file:

warning: incorrect type in argument 1 (different address spaces)
expected void const volatile [noderef] <asn:2>*addr
got unsigned char volatile *<noident>
warning: incorrect type in argument 2 (different address spaces)
expected void volatile [noderef] <asn:2>*addr
got unsigned char volatile *<noident>

The variables passed to readb and writeb need to
be of type u8 with a __iomem marker. These warnings
were popping up everytime the readb and writeb
functions were called with a cls_uart_struct variable.

The change made to the driver.h file adds the marker
to the cls_uart_struct and the changes in cls.h
changes its variables' types.

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Lidza Louina and committed by
Greg Kroah-Hartman
2ea550bd b1f56aca

+9 -9
+8 -8
drivers/staging/dgnc/dgnc_cls.h
··· 36 36 ************************************************************************/ 37 37 38 38 struct cls_uart_struct { 39 - volatile uchar txrx; /* WR RHR/THR - Holding Reg */ 40 - volatile uchar ier; /* WR IER - Interrupt Enable Reg */ 41 - volatile uchar isr_fcr; /* WR ISR/FCR - Interrupt Status Reg/Fifo Control Reg */ 42 - volatile uchar lcr; /* WR LCR - Line Control Reg */ 43 - volatile uchar mcr; /* WR MCR - Modem Control Reg */ 44 - volatile uchar lsr; /* WR LSR - Line Status Reg */ 45 - volatile uchar msr; /* WR MSR - Modem Status Reg */ 46 - volatile uchar spr; /* WR SPR - Scratch Pad Reg */ 39 + u8 txrx; /* WR RHR/THR - Holding Reg */ 40 + u8 ier; /* WR IER - Interrupt Enable Reg */ 41 + u8 isr_fcr; /* WR ISR/FCR - Interrupt Status Reg/Fifo Control Reg */ 42 + u8 lcr; /* WR LCR - Line Control Reg */ 43 + u8 mcr; /* WR MCR - Modem Control Reg */ 44 + u8 lsr; /* WR LSR - Line Status Reg */ 45 + u8 msr; /* WR MSR - Modem Status Reg */ 46 + u8 spr; /* WR SPR - Scratch Pad Reg */ 47 47 }; 48 48 49 49 /* Where to read the interrupt register (8bits) */
+1 -1
drivers/staging/dgnc/dgnc_driver.h
··· 481 481 uchar ch_mistat; /* FEP input modem status */ 482 482 483 483 struct neo_uart_struct *ch_neo_uart; /* Pointer to the "mapped" UART struct */ 484 - struct cls_uart_struct *ch_cls_uart; /* Pointer to the "mapped" UART struct */ 484 + struct cls_uart_struct __iomem *ch_cls_uart; /* Pointer to the "mapped" UART struct */ 485 485 486 486 uchar ch_cached_lsr; /* Cached value of the LSR register */ 487 487