From b3f575074b66e8af1a9943874f9782b793fa7edc Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Tue, 4 Nov 2014 18:44:28 +0530 Subject: gpu: nvgpu: fix sparse warnings Fix below sparse warnings : warning: Using plain integer as NULL pointer warning: symbol was not declared. Should it be static? warning: Initializer entry defined twice Also, remove dead functions Bug 1573254 Change-Id: I29d71ecc01c841233cf6b26c9088ca8874773469 Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/593363 Reviewed-by: Amit Sharma (SW-TEGRA) Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Sachin Nikam --- drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c index 39941aae..bd24e269 100644 --- a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c @@ -58,7 +58,8 @@ static int alloc_session(struct dbg_session_gk20a **_dbg_s) return 0; } -int gk20a_dbg_gpu_do_dev_open(struct inode *inode, struct file *filp, bool is_profiler) +static int gk20a_dbg_gpu_do_dev_open(struct inode *inode, + struct file *filp, bool is_profiler) { struct dbg_session_gk20a *dbg_session; struct gk20a *g; @@ -504,7 +505,8 @@ static int nvgpu_ioctl_channel_reg_ops(struct dbg_session_gk20a *dbg_s, gk20a_dbg_fn("Copying regops from userspace"); - if (copy_from_user(ops, (void *)(uintptr_t)args->ops, ops_size)) { + if (copy_from_user(ops, (void __user *)(uintptr_t)args->ops, + ops_size)) { dev_err(dev, "copy_from_user failed!"); err = -EFAULT; goto clean_up; @@ -542,7 +544,7 @@ static int nvgpu_ioctl_channel_reg_ops(struct dbg_session_gk20a *dbg_s, gk20a_dbg_fn("Copying result to userspace"); - if (copy_to_user((void *)(uintptr_t)args->ops, ops, ops_size)) { + if (copy_to_user((void __user *)(uintptr_t)args->ops, ops, ops_size)) { dev_err(dev, "copy_to_user failed!"); err = -EFAULT; goto clean_up; -- cgit v1.2.2