summaryrefslogtreecommitdiffstats
path: root/net/9p/protocol.c
diff options
context:
space:
mode:
authorEric Van Hensbergen <ericvh@gmail.com>2008-10-22 18:54:47 -0500
committerEric Van Hensbergen <ericvh@opteron.(none)>2008-10-22 18:54:47 -0500
commite45c5405e12c7cef93940cb7a541ab459ec0096a (patch)
tree9855f49330da6658e505f6f51995aa216cddcdb5 /net/9p/protocol.c
parentfc79d4b104f0eb8c2a7242150eaf8756ced4c344 (diff)
9p: fix sparse warnings
Several sparse warnings were introduced by patches accepted during the merge window which weren't caught. This patch fixes those warnings. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net/9p/protocol.c')
-rw-r--r--net/9p/protocol.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/net/9p/protocol.c b/net/9p/protocol.c
index 908e79faf48..dcd7666824b 100644
--- a/net/9p/protocol.c
+++ b/net/9p/protocol.c
@@ -186,7 +186,7 @@ p9pdu_vreadf(struct p9_fcall *pdu, int optional, const char *fmt, va_list ap)
}
break;
case 's':{
- char **ptr = va_arg(ap, char **);
+ char **sptr = va_arg(ap, char **);
int16_t len;
int size;
@@ -196,17 +196,17 @@ p9pdu_vreadf(struct p9_fcall *pdu, int optional, const char *fmt, va_list ap)
size = MAX(len, 0);
- *ptr = kmalloc(size + 1, GFP_KERNEL);
- if (*ptr == NULL) {
+ *sptr = kmalloc(size + 1, GFP_KERNEL);
+ if (*sptr == NULL) {
errcode = -EFAULT;
break;
}
- if (pdu_read(pdu, *ptr, size)) {
+ if (pdu_read(pdu, *sptr, size)) {
errcode = -EFAULT;
- kfree(*ptr);
- *ptr = NULL;
+ kfree(*sptr);
+ *sptr = NULL;
} else
- (*ptr)[size] = 0;
+ (*sptr)[size] = 0;
}
break;
case 'Q':{
@@ -380,13 +380,13 @@ p9pdu_vwritef(struct p9_fcall *pdu, int optional, const char *fmt, va_list ap)
}
break;
case 's':{
- const char *ptr = va_arg(ap, const char *);
+ const char *sptr = va_arg(ap, const char *);
int16_t len = 0;
- if (ptr)
- len = MIN(strlen(ptr), USHORT_MAX);
+ if (sptr)
+ len = MIN(strlen(sptr), USHORT_MAX);
errcode = p9pdu_writef(pdu, optional, "w", len);
- if (!errcode && pdu_write(pdu, ptr, len))
+ if (!errcode && pdu_write(pdu, sptr, len))
errcode = -EFAULT;
}
break;
@@ -426,7 +426,7 @@ p9pdu_vwritef(struct p9_fcall *pdu, int optional, const char *fmt, va_list ap)
case 'U':{
int32_t count = va_arg(ap, int32_t);
const char __user *udata =
- va_arg(ap, const void *);
+ va_arg(ap, const void __user *);
errcode =
p9pdu_writef(pdu, optional, "d", count);
if (!errcode && pdu_write_u(pdu, udata, count))