Re: [PATCH 01/14] staging: comedi: serial2002: fix different address space sparse warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/04/13 00:07, H Hartley Sweeten wrote:
The struct file_operations (*read) and (*write) operations expect the
buffer to be a __user space pointer.

Currently the (*write) operations in this driver cause this warning:
warning: incorrect type in argument 2 (different address spaces)
   expected char const [noderef] <asn:1>*<noident>
   got unsigned char [usertype] *buf

And the (*read) operations cause this warning:
warning: incorrect type in argument 2 (different address spaces)
   expected char [noderef] <asn:1>*<noident>
   got unsigned char *<noident>

Use __force to cast the buffer to a __user pointer to suppress the
warnings.

The sparse warnings are probably helpful in this case. They indicate the driver is doing something wrong! Using __force just masks the problem.

--
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@xxxxxxxxx>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux