Skip to content

Commit

Permalink
9p: Fix sparse error
Browse files Browse the repository at this point in the history
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
  • Loading branch information
Aneesh Kumar K.V authored and Eric Van Hensbergen committed Apr 15, 2011
1 parent 936bb2d commit bd8c8ad
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
3 changes: 2 additions & 1 deletion net/9p/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,8 @@ p9pdu_vwritef(struct p9_fcall *pdu, int proto_version, const char *fmt,
case 'E':{
int32_t cnt = va_arg(ap, int32_t);
const char *k = va_arg(ap, const void *);
const char *u = va_arg(ap, const void *);
const char __user *u = va_arg(ap,
const void __user *);
errcode = p9pdu_writef(pdu, proto_version, "d",
cnt);
if (!errcode && pdu_write_urw(pdu, k, u, cnt))
Expand Down
2 changes: 1 addition & 1 deletion net/9p/trans_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ p9_payload_gup(struct p9_req_t *req, size_t *pdata_off, int *pdata_len,
uint32_t pdata_mapped_pages;
struct trans_rpage_info *rpinfo;

*pdata_off = (size_t)req->tc->pubuf & (PAGE_SIZE-1);
*pdata_off = (__force size_t)req->tc->pubuf & (PAGE_SIZE-1);

if (*pdata_off)
first_page_bytes = min(((size_t)PAGE_SIZE - *pdata_off),
Expand Down
15 changes: 11 additions & 4 deletions net/9p/trans_virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,11 @@ p9_virtio_request(struct p9_client *client, struct p9_req_t *req)
outp = pack_sg_list_p(chan->sg, out, VIRTQUEUE_NUM,
pdata_off, rpinfo->rp_data, pdata_len);
} else {
char *pbuf = req->tc->pubuf ? req->tc->pubuf :
req->tc->pkbuf;
char *pbuf;
if (req->tc->pubuf)
pbuf = (__force char *) req->tc->pubuf;
else
pbuf = req->tc->pkbuf;
outp = pack_sg_list(chan->sg, out, VIRTQUEUE_NUM, pbuf,
req->tc->pbuf_size);
}
Expand All @@ -352,8 +355,12 @@ p9_virtio_request(struct p9_client *client, struct p9_req_t *req)
in = pack_sg_list_p(chan->sg, out+inp, VIRTQUEUE_NUM,
pdata_off, rpinfo->rp_data, pdata_len);
} else {
char *pbuf = req->tc->pubuf ? req->tc->pubuf :
req->tc->pkbuf;
char *pbuf;
if (req->tc->pubuf)
pbuf = (__force char *) req->tc->pubuf;
else
pbuf = req->tc->pkbuf;

in = pack_sg_list(chan->sg, out+inp, VIRTQUEUE_NUM,
pbuf, req->tc->pbuf_size);
}
Expand Down

0 comments on commit bd8c8ad

Please sign in to comment.