Skip to contentSkip to conversation

Staging: vme: silence a Sparse warning

PATCH In review Dan Carpenter 2 participants 2 messages Jul 6, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 Staging: vme: silence a Sparse warning

Sparse complains that "arg" is not a __user pointer. The "argp" and "arg" variables are equivalent but argp is declared as a __user pointer.

drivers/staging/vme/devices/vme_user.c +1 -1
index be198c0..4363ed5 100644
@@ -471,7 +471,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 	case CONTROL_MINOR:
 		switch (cmd) {
 		case VME_IRQ_GEN:
-			copied = copy_from_user(&irq_req, (char *)arg,
+			copied = copy_from_user(&irq_req, argp,
 						sizeof(struct vme_irq_id));
 			if (copied != 0) {
 				printk(KERN_WARNING "Partial copy from userspace\n");
Acked-by on v1 2/2
#1 lore raw
Quoted 11 lines · Dan Carpenter

Sparse complains that "arg" is not a __user pointer. The "argp" and "arg" variables are equivalent but argp is declared as a __user pointer.

drivers/staging/vme/devices/vme_user.c +0 -0
index be198c0..4363ed5 100644

drivers/staging/vme/devices/vme_user.c static int vme_user_ioctl(struct inode *inode, struct file *file, · line 477

Quoted 8 lines
drivers/staging/vme/devices/vme_user.c +1 -1
@@ -471,7 +471,7 @@ static int vme_user_ioctl(struct inode *inode, struct file *file,
 	case CONTROL_MINOR:
 		switch (cmd) {
 		case VME_IRQ_GEN:
-			copied = copy_from_user(&irq_req, (char *)arg,
+			copied = copy_from_user(&irq_req, argp,
 						sizeof(struct vme_irq_id));
 			if (copied != 0) {
 				printk(KERN_WARNING "Partial copy from userspace\n");

Looks OK to me:

Signature · 4 lines
Martyn Welch (Lead Software Engineer)  | Registered in England and Wales
GE Intelligent Platforms               | (3828642) at 100 Barbirolli Square
T +44(0)1327322748                     | Manchester, M2 3AB
E [email protected]                  | VAT:GB 927559189