]> www.infradead.org Git - users/jedix/linux-maple.git/commit
target/user: Fix cast from pointer to phys_addr_t
authorArnd Bergmann <arnd@arndb.de>
Mon, 1 Feb 2016 16:29:45 +0000 (17:29 +0100)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 23 Jun 2017 04:10:46 +0000 (21:10 -0700)
commit955acc3d0caf07915bc1b2f82a09b0cb5e769d4b
tree2d840e51002a247f727d41a3eeb5cf893600bab1
parentadfbf14e15b0564365ad81d324e6eaa1eaa33936
target/user: Fix cast from pointer to phys_addr_t

The uio_mem structure has a member that is a phys_addr_t, but can
be a number of other types too. The target core driver attempts
to assign a pointer from vmalloc() to it, by casting it to
phys_addr_t, but that causes a warning when phys_addr_t is longer
than a pointer:

drivers/target/target_core_user.c: In function 'tcmu_configure_device':
drivers/target/target_core_user.c:906:22: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]

This adds another cast to uintptr_t to shut up the warning.
A nicer fix might be to have additional fields in uio_mem
for the different purposes, so we can assign a pointer directly.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Orabug: 25395066
(cherry picked from commit 0633e123465b61a12a262b742bebf2a9945f7964)
Signed-off-by: Kyle Fortin <kyle.fortin@oracle.com>
Reviewed-by: Shan Hai <shan.hai@oracle.com>
drivers/target/target_core_user.c