virtio_console: fix sparse warnings
authorMichael S. Tsirkin <mst@redhat.com>
Mon, 1 Dec 2014 11:31:45 +0000 (13:31 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 9 Dec 2014 10:06:33 +0000 (12:06 +0200)
commit48b36066b48025b7cd7d46c9a879f2f72fd9086a
treed5a9f3eef7c7d4da573a7a671e34885043f55853
parent2e73c716ba22b3b3df56be25132df2774967f2b1
virtio_console: fix sparse warnings

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.

Tag address parameter as __user, and cast to/from regular pointer type
when we know it's safe.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/char/virtio_console.c