On Sun, 2014-06-22 at 03:29 -0400, James A Shackleford wrote:
> This patch allocates a few pages and performs an ioread8_rep() from the bus
> address, which are then copied to userspace.  This fixes the sparse warning:
> 
> drivers/staging/goldfish/goldfish_audio.c:136:43: warning: incorrect type in 
> argument 2 (different address spaces)
> drivers/staging/goldfish/goldfish_audio.c:136:43:    expected void const *from
> drivers/staging/goldfish/goldfish_audio.c:136:43:    got char [noderef] 
> <asn:2>*read_buffer
> 
> which was a result of performing a copy_to_user() directly from the bus 
> address
> to the userspace, which can be unsafe across some architectures.

Goldfish is a specific architecture. It shouldn't be doing direct
xcopies like that - which is why the code is in staging but at the same
time allocating a buffer each call and doing extra copies is not the
right answer.

It should be mapping the pages when they are first set up.

Alan


_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to