• Damian Hobson-Garcia's avatar
    drivers: uio_dmem_genirq: Don't mix address spaces for dynamic region vaddr · 24fce61b
    Damian Hobson-Garcia authored
    Assigning the virtual address returned from dma_alloc_coherent to the the
    internal_addr element of uioinfo produces the following sparse errors since
    internal_addr is a void __iomem * and dma_alloc_coherent returns void *.
    
    + drivers/uio/uio_dmem_genirq.c:65:39: sparse: incorrect type in assignment (different address spaces)
      drivers/uio/uio_dmem_genirq.c:65:39:    expected void [noderef] <asn:2>*internal_addr
      drivers/uio/uio_dmem_genirq.c:65:39:    got void *[assigned] addr
    + drivers/uio/uio_dmem_genirq.c:93:17: sparse: incorrect type in argument 3 (different address spaces)
      drivers/uio/uio_dmem_genirq.c:93:17:    expected void *vaddr
      drivers/uio/uio_dmem_genirq.c:93:17:    got void [noderef] <asn:2>*internal_addr
    
    Store the void * in the driver's private data instead.
    Reported-by: default avatarFengguang Wu <fengguang.wu@intel.com>
    Signed-off-by: default avatarDamian Hobson-Garcia <dhobsong@igel.co.jp>
    Cc: "Hans J. Koch" <hjk@hansjkoch.de>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    24fce61b
uio_dmem_genirq.c 9.04 KB