• Michael S. Tsirkin's avatar
    virtio_console: fix sparse warnings · 48b36066
    Michael S. Tsirkin authored
    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: default avatarMichael S. Tsirkin <mst@redhat.com>
    
    
    
    48b36066
virtio_console.c 55.4 KB