[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160213180435.GA16246@codebox>
Date: Sat, 13 Feb 2016 23:34:35 +0530
From: Niranjan Dighe <niranjan.dighe@...il.com>
To: Oleg Drokin <oleg.drokin@...el.com>,
Andreas Dilger <andreas.dilger@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Shivani Bhardwaj <shivanib134@...il.com>,
Dmitry Eremin <dmitry.eremin@...el.com>,
Mike Rapoport <mike.rapoport@...il.com>,
Shraddha Barke <shraddha.6596@...il.com>,
Frank Zago <fzago@...y.com>,
Hatice ERTÜRK <haticeerturk27@...il.com>,
Mike Shuey <shuey@...due.edu>
Cc: lustre-devel@...ts.lustre.org, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] staging: lustre/lnet: Fix wrong type casting warning
generated by sparse
Fixed the following warning reported by sparse about typecasting. A
userspace pointer was being typecasted by simply (char *) which causes
sparse to give the following warning -
warning: cast removes address space of expression
Fixed it by adding __user annotation to the typecasting.
Signed-off-by: Niranjan Dighe <niranjan.dighe@...il.com>
---
drivers/staging/lustre/lnet/selftest/console.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c
index 366211e..64b6a70 100644
--- a/drivers/staging/lustre/lnet/selftest/console.c
+++ b/drivers/staging/lustre/lnet/selftest/console.c
@@ -1461,9 +1461,9 @@ lstcon_statrpc_readent(int transop, srpc_msg_t *msg,
sfwk_stat = (sfw_counters_t __user *)&ent_up->rpe_payload[0];
srpc_stat = (srpc_counters_t __user *)
- ((char *)sfwk_stat + sizeof(*sfwk_stat));
+ ((char __user *)sfwk_stat + sizeof(*sfwk_stat));
lnet_stat = (lnet_counters_t __user *)
- ((char *)srpc_stat + sizeof(*srpc_stat));
+ ((char __user *)srpc_stat + sizeof(*srpc_stat));
if (copy_to_user(sfwk_stat, &rep->str_fw, sizeof(*sfwk_stat)) ||
copy_to_user(srpc_stat, &rep->str_rpc, sizeof(*srpc_stat)) ||
--
1.9.1
Powered by blists - more mailing lists