OSDN Git Service

uio_hv_generic: fix type mismatch warnings
authorArnd Bergmann <arnd@arndb.de>
Wed, 10 Jan 2018 16:42:38 +0000 (17:42 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Jan 2018 16:50:01 +0000 (17:50 +0100)
I moved the virt_to_phys() conversion into hv_uio_probe() as part of
a warning fix. Stephen's cleanup to remove the private mmap() function
seems reasonable, but part of it reverted the change that I did to
hide the warnings, so they are back now:

drivers/uio/uio_hv_generic.c: In function 'hv_uio_probe':
drivers/uio/uio_hv_generic.c:123:5: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
drivers/uio/uio_hv_generic.c:130:5: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
drivers/uio/uio_hv_generic.c:136:5: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]

The type mismatch is now the result of the uio_mmap() definition, and
the best way I see from here is to shut them up with a uintptr_t cast.

Fixes: 9c40546c012c ("uio_hv_generic: use standard mmap for resources")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/uio/uio_hv_generic.c

index 8c6b04a..787598a 100644 (file)
@@ -169,20 +169,20 @@ hv_uio_probe(struct hv_device *dev,
        /* mem resources */
        pdata->info.mem[TXRX_RING_MAP].name = "txrx_rings";
        pdata->info.mem[TXRX_RING_MAP].addr
-               = (phys_addr_t)dev->channel->ringbuffer_pages;
+               = (uintptr_t)dev->channel->ringbuffer_pages;
        pdata->info.mem[TXRX_RING_MAP].size
                = dev->channel->ringbuffer_pagecount << PAGE_SHIFT;
        pdata->info.mem[TXRX_RING_MAP].memtype = UIO_MEM_LOGICAL;
 
        pdata->info.mem[INT_PAGE_MAP].name = "int_page";
        pdata->info.mem[INT_PAGE_MAP].addr
-               = (phys_addr_t)vmbus_connection.int_page;
+               = (uintptr_t)vmbus_connection.int_page;
        pdata->info.mem[INT_PAGE_MAP].size = PAGE_SIZE;
        pdata->info.mem[INT_PAGE_MAP].memtype = UIO_MEM_LOGICAL;
 
        pdata->info.mem[MON_PAGE_MAP].name = "monitor_page";
        pdata->info.mem[MON_PAGE_MAP].addr
-               = (phys_addr_t)vmbus_connection.monitor_pages[1];
+               = (uintptr_t)vmbus_connection.monitor_pages[1];
        pdata->info.mem[MON_PAGE_MAP].size = PAGE_SIZE;
        pdata->info.mem[MON_PAGE_MAP].memtype = UIO_MEM_LOGICAL;