aboutsummaryrefslogtreecommitdiffstats
path: root/block/bsg.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@gmail.com>2011-06-20 07:27:45 -0400
committerJens Axboe <jaxboe@fusionio.com>2011-06-20 07:27:45 -0400
commit2b727c6300b49352f80f63704bb50c256949e95e (patch)
tree42e688cb7668c19bbd67673f34aa3bc3d162a8dc /block/bsg.c
parent44194e3e88fcfe77a2a6e2333847d4f27816259a (diff)
bsg: fix address space warning from sparse
copy_from/to_user() and blk_rq_map_user() want __user pointer. This patch fixes following warnings from sparse: CHECK block/bsg.c block/bsg.c:185:38: warning: incorrect type in argument 2 (different address spaces) block/bsg.c:185:38: expected void const [noderef] <asn:1>*from block/bsg.c:185:38: got void *<noident> block/bsg.c:295:58: warning: incorrect type in argument 4 (different address spaces) block/bsg.c:295:58: expected void [noderef] <asn:1>*<noident> block/bsg.c:295:58: got void *[assigned] dxferp block/bsg.c:311:52: warning: incorrect type in argument 4 (different address spaces) block/bsg.c:311:52: expected void [noderef] <asn:1>*<noident> block/bsg.c:311:52: got void *[assigned] dxferp block/bsg.c:448:37: warning: incorrect type in argument 1 (different address spaces) block/bsg.c:448:37: expected void [noderef] <asn:1>*dst block/bsg.c:448:37: got void *<noident> Signed-off-by: Namhyung Kim <namhyung@gmail.com> Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block/bsg.c')
-rw-r--r--block/bsg.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/block/bsg.c b/block/bsg.c
index b7e42ad55361..702f1316bb8f 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -182,7 +182,7 @@ static int blk_fill_sgv4_hdr_rq(struct request_queue *q, struct request *rq,
182 return -ENOMEM; 182 return -ENOMEM;
183 } 183 }
184 184
185 if (copy_from_user(rq->cmd, (void *)(unsigned long)hdr->request, 185 if (copy_from_user(rq->cmd, (void __user *)(unsigned long)hdr->request,
186 hdr->request_len)) 186 hdr->request_len))
187 return -EFAULT; 187 return -EFAULT;
188 188
@@ -249,7 +249,7 @@ bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, fmode_t has_write_perm,
249 struct request *rq, *next_rq = NULL; 249 struct request *rq, *next_rq = NULL;
250 int ret, rw; 250 int ret, rw;
251 unsigned int dxfer_len; 251 unsigned int dxfer_len;
252 void *dxferp = NULL; 252 void __user *dxferp = NULL;
253 struct bsg_class_device *bcd = &q->bsg_dev; 253 struct bsg_class_device *bcd = &q->bsg_dev;
254 254
255 /* if the LLD has been removed then the bsg_unregister_queue will 255 /* if the LLD has been removed then the bsg_unregister_queue will
@@ -291,7 +291,7 @@ bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, fmode_t has_write_perm,
291 rq->next_rq = next_rq; 291 rq->next_rq = next_rq;
292 next_rq->cmd_type = rq->cmd_type; 292 next_rq->cmd_type = rq->cmd_type;
293 293
294 dxferp = (void*)(unsigned long)hdr->din_xferp; 294 dxferp = (void __user *)(unsigned long)hdr->din_xferp;
295 ret = blk_rq_map_user(q, next_rq, NULL, dxferp, 295 ret = blk_rq_map_user(q, next_rq, NULL, dxferp,
296 hdr->din_xfer_len, GFP_KERNEL); 296 hdr->din_xfer_len, GFP_KERNEL);
297 if (ret) 297 if (ret)
@@ -300,10 +300,10 @@ bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, fmode_t has_write_perm,
300 300
301 if (hdr->dout_xfer_len) { 301 if (hdr->dout_xfer_len) {
302 dxfer_len = hdr->dout_xfer_len; 302 dxfer_len = hdr->dout_xfer_len;
303 dxferp = (void*)(unsigned long)hdr->dout_xferp; 303 dxferp = (void __user *)(unsigned long)hdr->dout_xferp;
304 } else if (hdr->din_xfer_len) { 304 } else if (hdr->din_xfer_len) {
305 dxfer_len = hdr->din_xfer_len; 305 dxfer_len = hdr->din_xfer_len;
306 dxferp = (void*)(unsigned long)hdr->din_xferp; 306 dxferp = (void __user *)(unsigned long)hdr->din_xferp;
307 } else 307 } else
308 dxfer_len = 0; 308 dxfer_len = 0;
309 309
@@ -445,7 +445,7 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr,
445 int len = min_t(unsigned int, hdr->max_response_len, 445 int len = min_t(unsigned int, hdr->max_response_len,
446 rq->sense_len); 446 rq->sense_len);
447 447
448 ret = copy_to_user((void*)(unsigned long)hdr->response, 448 ret = copy_to_user((void __user *)(unsigned long)hdr->response,
449 rq->sense, len); 449 rq->sense, len);
450 if (!ret) 450 if (!ret)
451 hdr->response_len = len; 451 hdr->response_len = len;