]> git.baikalelectronics.ru Git - kernel.git/commit
habanalabs: use u64_to_user_ptr() for reading user pointers
authorArnd Bergmann <arnd@arndb.de>
Mon, 17 Jun 2019 12:41:33 +0000 (14:41 +0200)
committerOded Gabbay <oded.gabbay@gmail.com>
Thu, 20 Jun 2019 09:13:19 +0000 (12:13 +0300)
commit0d227a56d9063d7cfb12adcf465f1f892f2090e4
tree0febffe47a36cfacfa965f8d26acffb0caf6d2b5
parent5a05496e0232c3943d7e19f41b9aa751b98db513
habanalabs: use u64_to_user_ptr() for reading user pointers

We cannot cast a 64-bit integer to a pointer on 32-bit architectures
without a warning:

drivers/misc/habanalabs/habanalabs_ioctl.c: In function 'debug_coresight':
drivers/misc/habanalabs/habanalabs_ioctl.c:143:23: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
   input = memdup_user((const void __user *) args->input_ptr,

Use the macro that was defined for this purpose.

Fixes: 3054a03818fd ("habanalabs: add new IOCTL for debug, tracing and profiling")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/misc/habanalabs/habanalabs_ioctl.c