lkml.org 
[lkml]   [2015]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] virtio_console: fix sparse warnings
On Mon, Dec 01, 2014 at 01:35:57PM +0200, Michael S. Tsirkin wrote:
> CHECK drivers/char/virtio_console.c
> drivers/char/virtio_console.c:687:36: warning: incorrect type in
> argument 1 (different address spaces)
> drivers/char/virtio_console.c:687:36: expected void [noderef]
> <asn:1>*to
> drivers/char/virtio_console.c:687:36: got char *out_buf
> drivers/char/virtio_console.c:790:35: warning: incorrect type in
> argument 2 (different address spaces)
> drivers/char/virtio_console.c:790:35: expected char *out_buf
> drivers/char/virtio_console.c:790:35: got char [noderef]
> <asn:1>*ubuf
>
> fill_readbuf is reused with both kernel and userspace pointers,
> depending on value of to_user flag.

That's horrid, don't do that. Have two different functions for this
type of thing, otherwise you defeat the whole purpose of trying to track
__user pointers.

thanks,

greg k-h


\
 
 \ /
  Last update: 2015-02-04 01:21    [W:0.097 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site