Skip to contentSkip to conversation

lirc_dev: add some __user annotations

PATCH In review Dan Carpenter 2 participants 2 messages Nov 17, 2010

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

PATCH 2/3 lirc_dev: add some __user annotations

Sparse complains because there are no __user annotations.

drivers/media/IR/lirc_dev.c:156:27: warning:
incorrect type in initializer (incompatible argument 2 (different address spaces))
drivers/media/IR/lirc_dev.c:156:27: expected int ( *read )( ... )
drivers/media/IR/lirc_dev.c:156:27: got int ( extern [toplevel] *<noident> )( ... )

include/media/lirc_dev.h +3 -3
index 54780a5..630e702 100644
@@ -217,9 +217,9 @@ int lirc_dev_fop_open(struct inode *inode, struct file *file);
 int lirc_dev_fop_close(struct inode *inode, struct file *file);
 unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait);
 long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
-ssize_t lirc_dev_fop_read(struct file *file, char *buffer, size_t length,
+ssize_t lirc_dev_fop_read(struct file *file, char __user *buffer, size_t length,
 			  loff_t *ppos);
-ssize_t lirc_dev_fop_write(struct file *file, const char *buffer, size_t length,
-			   loff_t *ppos);
+ssize_t lirc_dev_fop_write(struct file *file, const char __user *buffer,
+			   size_t length, loff_t *ppos);
 
 #endif
drivers/media/IR/lirc_dev.c +2 -2
index 8ab9d87..fbca94f 100644
@@ -627,7 +627,7 @@ long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 EXPORT_SYMBOL(lirc_dev_fop_ioctl);
 
 ssize_t lirc_dev_fop_read(struct file *file,
-			  char *buffer,
+			  char __user *buffer,
 			  size_t length,
 			  loff_t *ppos)
 {
@@ -742,7 +742,7 @@ void *lirc_get_pdata(struct file *file)
 EXPORT_SYMBOL(lirc_get_pdata);
 
 
-ssize_t lirc_dev_fop_write(struct file *file, const char *buffer,
+ssize_t lirc_dev_fop_write(struct file *file, const char __user *buffer,
 			   size_t length, loff_t *ppos)
 {
 	struct irctl *ir = irctls[iminor(file->f_dentry->d_inode)];
Acked-by on v1 2/3
#1 lore raw
Quoted 8 lines · Dan Carpenter

Sparse complains because there are no __user annotations.

drivers/media/IR/lirc_dev.c:156:27: warning:
incorrect type in initializer (incompatible argument 2 (different address spaces))
drivers/media/IR/lirc_dev.c:156:27: expected int ( *read )( ... )
drivers/media/IR/lirc_dev.c:156:27: got int ( extern [toplevel] *<noident> )( ... )

Signature · 2 lines
Jarod Wilson
[email protected]