summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2019-06-17 15:41:33 +0300
committerOded Gabbay <oded.gabbay@gmail.com>2019-06-20 12:13:19 +0300
commitf99bc332c713b7672bad5236060b02f0c41c7242 (patch)
tree0febffe47a36cfacfa965f8d26acffb0caf6d2b5 /drivers/misc
parent6ad805b82dc5fc0ffd2de1d1f0de47214a050278 (diff)
downloadlinux-f99bc332c713b7672bad5236060b02f0c41c7242.tar.xz
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: 315bc055ed56 ("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>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/habanalabs/habanalabs_ioctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/habanalabs/habanalabs_ioctl.c b/drivers/misc/habanalabs/habanalabs_ioctl.c
index eeefb22023e9..b7a0eecf6b6c 100644
--- a/drivers/misc/habanalabs/habanalabs_ioctl.c
+++ b/drivers/misc/habanalabs/habanalabs_ioctl.c
@@ -140,7 +140,7 @@ static int debug_coresight(struct hl_device *hdev, struct hl_debug_args *args)
params->op = args->op;
if (args->input_ptr && args->input_size) {
- input = memdup_user((const void __user *) args->input_ptr,
+ input = memdup_user(u64_to_user_ptr(args->input_ptr),
args->input_size);
if (IS_ERR(input)) {
rc = PTR_ERR(input);