Skip to contentSkip to conversation

staging: lustre: llite: Add __iomem annotations

PATCH Superseded Amitoj Kaur Chawla 2 participants 3 messages Oct 30, 2015 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: lustre: llite: Add __iomem annotations

This patch fixes following sparse warnings by adding __iomem annotations:

warning: incorrect type in argument 1 (different address spaces) expected void [noderef] <asn:1>*to got char *<noident>

warning: incorrect type in argument 1 (different address spaces) expected void [noderef] <asn:1>*to got int *<noident>

warning: incorrect type in argument 1 (different address spaces) expected void [noderef] <asn:1>*to got void *<noident>

---
 drivers/staging/lustre/lustre/llite/file.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/staging/lustre/lustre/llite/file.c +8 -8
index 51b6bc5..112da6f 100644
@@ -2245,7 +2245,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		struct file *file2;
 		struct lustre_swap_layouts lsl;
 
-		if (copy_from_user(&lsl, (char *)arg,
+		if (copy_from_user(&lsl, (char __user *)arg,
 				       sizeof(struct lustre_swap_layouts)))
 			return -EFAULT;
 
@@ -2292,7 +2292,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 	case LL_IOC_FLUSHCTX:
 		return ll_flush_ctx(inode);
 	case LL_IOC_PATH2FID: {
-		if (copy_to_user((void *)arg, ll_inode2fid(inode),
+		if (copy_to_user((void __user *)arg, ll_inode2fid(inode),
 				 sizeof(struct lu_fid)))
 			return -EFAULT;
 
@@ -2304,13 +2304,13 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		struct ioc_data_version	idv;
 		int			rc;
 
-		if (copy_from_user(&idv, (char *)arg, sizeof(idv)))
+		if (copy_from_user(&idv, (char __user *)arg, sizeof(idv)))
 			return -EFAULT;
 
 		rc = ll_data_version(inode, &idv.idv_version,
 				!(idv.idv_flags & LL_DV_NOFLUSH));
 
-		if (rc == 0 && copy_to_user((char *) arg, &idv, sizeof(idv)))
+		if (rc == 0 && copy_to_user((char __user *) arg, &idv, sizeof(idv)))
 			return -EFAULT;
 
 		return rc;
@@ -2323,7 +2323,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		if (mdtidx < 0)
 			return mdtidx;
 
-		if (put_user((int)mdtidx, (int *)arg))
+		if (put_user((int)mdtidx, (int __user *)arg))
 			return -EFAULT;
 
 		return 0;
@@ -2350,7 +2350,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		rc = obd_iocontrol(cmd, ll_i2mdexp(inode), sizeof(*op_data),
 				   op_data, NULL);
 
-		if (copy_to_user((void *)arg, hus, sizeof(*hus)))
+		if (copy_to_user((void __user *)arg, hus, sizeof(*hus)))
 			rc = -EFAULT;
 
 		ll_finish_md_op_data(op_data);
@@ -2361,7 +2361,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		struct hsm_state_set	*hss;
 		int			 rc;
 
-		hss = memdup_user((char *)arg, sizeof(*hss));
+		hss = memdup_user((char __user *)arg, sizeof(*hss));
 		if (IS_ERR(hss))
 			return PTR_ERR(hss);
 
@@ -2389,7 +2389,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		rc = obd_iocontrol(cmd, ll_i2mdexp(inode), sizeof(*op_data),
 				   op_data, NULL);
 
-		if (copy_to_user((char *)arg, hca, sizeof(*hca)))
+		if (copy_to_user((char __user *)arg, hca, sizeof(*hca)))
 			rc = -EFAULT;
 
 		ll_finish_md_op_data(op_data);
Signature · 1 line
1.9.1
#1 lore raw
Quoted 2 lines · Amitoj Kaur Chawla

This patch fixes following sparse warnings by adding __iomem annotations:

It looks like it is __user annotations?

julia

Quoted 98 lines

warning: incorrect type in argument 1 (different address spaces) expected void [noderef] <asn:1>*to got char *<noident>

warning: incorrect type in argument 1 (different address spaces) expected void [noderef] <asn:1>*to got int *<noident>

warning: incorrect type in argument 1 (different address spaces) expected void [noderef] <asn:1>*to got void *<noident>

---
 drivers/staging/lustre/lustre/llite/file.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/staging/lustre/lustre/llite/file.c +8 -9
index 51b6bc5..112da6f 100644
@@ -2245,7 +2245,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		struct file *file2;
 		struct lustre_swap_layouts lsl;
 
-		if (copy_from_user(&lsl, (char *)arg,
+		if (copy_from_user(&lsl, (char __user *)arg,
 				       sizeof(struct lustre_swap_layouts)))
 			return -EFAULT;
 
@@ -2292,7 +2292,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 	case LL_IOC_FLUSHCTX:
 		return ll_flush_ctx(inode);
 	case LL_IOC_PATH2FID: {
-		if (copy_to_user((void *)arg, ll_inode2fid(inode),
+		if (copy_to_user((void __user *)arg, ll_inode2fid(inode),
 				 sizeof(struct lu_fid)))
 			return -EFAULT;
 
@@ -2304,13 +2304,13 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		struct ioc_data_version	idv;
 		int			rc;
 
-		if (copy_from_user(&idv, (char *)arg, sizeof(idv)))
+		if (copy_from_user(&idv, (char __user *)arg, sizeof(idv)))
 			return -EFAULT;
 
 		rc = ll_data_version(inode, &idv.idv_version,
 				!(idv.idv_flags & LL_DV_NOFLUSH));
 
-		if (rc == 0 && copy_to_user((char *) arg, &idv, sizeof(idv)))
+		if (rc == 0 && copy_to_user((char __user *) arg, &idv, sizeof(idv)))
 			return -EFAULT;
 
 		return rc;
@@ -2323,7 +2323,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		if (mdtidx < 0)
 			return mdtidx;
 
-		if (put_user((int)mdtidx, (int *)arg))
+		if (put_user((int)mdtidx, (int __user *)arg))
 			return -EFAULT;
 
 		return 0;
@@ -2350,7 +2350,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		rc = obd_iocontrol(cmd, ll_i2mdexp(inode), sizeof(*op_data),
 				   op_data, NULL);
 
-		if (copy_to_user((void *)arg, hus, sizeof(*hus)))
+		if (copy_to_user((void __user *)arg, hus, sizeof(*hus)))
 			rc = -EFAULT;
 
 		ll_finish_md_op_data(op_data);
@@ -2361,7 +2361,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		struct hsm_state_set	*hss;
 		int			 rc;
 
-		hss = memdup_user((char *)arg, sizeof(*hss));
+		hss = memdup_user((char __user *)arg, sizeof(*hss));
 		if (IS_ERR(hss))
 			return PTR_ERR(hss);
 
@@ -2389,7 +2389,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		rc = obd_iocontrol(cmd, ll_i2mdexp(inode), sizeof(*op_data),
 				   op_data, NULL);
 
-		if (copy_to_user((char *)arg, hca, sizeof(*hca)))
+		if (copy_to_user((char __user *)arg, hca, sizeof(*hca)))
 			rc = -EFAULT;
 
 		ll_finish_md_op_data(op_data);
--

1.9.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20151030160650.GA13665%40amitoj-Inspiron-3542.
For more options, visit https://groups.google.com/d/optout.

#2 lore raw
Quoted 100 lines · Julia Lawall
Quoted 2 lines · Amitoj Kaur Chawla

This patch fixes following sparse warnings by adding __iomem annotations:

It looks like it is __user annotations?

julia

Quoted 91 lines

warning: incorrect type in argument 1 (different address spaces) expected void [noderef] <asn:1>*to got char *<noident>

warning: incorrect type in argument 1 (different address spaces) expected void [noderef] <asn:1>*to got int *<noident>

warning: incorrect type in argument 1 (different address spaces) expected void [noderef] <asn:1>*to got void *<noident>

---
 drivers/staging/lustre/lustre/llite/file.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/staging/lustre/lustre/llite/file.c +8 -9
index 51b6bc5..112da6f 100644
@@ -2245,7 +2245,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
              struct file *file2;
              struct lustre_swap_layouts lsl;
 
-             if (copy_from_user(&lsl, (char *)arg,
+             if (copy_from_user(&lsl, (char __user *)arg,
                                     sizeof(struct lustre_swap_layouts)))
                      return -EFAULT;
 
@@ -2292,7 +2292,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
      case LL_IOC_FLUSHCTX:
              return ll_flush_ctx(inode);
      case LL_IOC_PATH2FID: {
-             if (copy_to_user((void *)arg, ll_inode2fid(inode),
+             if (copy_to_user((void __user *)arg, ll_inode2fid(inode),
                               sizeof(struct lu_fid)))
                      return -EFAULT;
 
@@ -2304,13 +2304,13 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
              struct ioc_data_version idv;
              int                     rc;
 
-             if (copy_from_user(&idv, (char *)arg, sizeof(idv)))
+             if (copy_from_user(&idv, (char __user *)arg, sizeof(idv)))
                      return -EFAULT;
 
              rc = ll_data_version(inode, &idv.idv_version,
                              !(idv.idv_flags & LL_DV_NOFLUSH));
 
-             if (rc == 0 && copy_to_user((char *) arg, &idv, sizeof(idv)))
+             if (rc == 0 && copy_to_user((char __user *) arg, &idv, sizeof(idv)))
                      return -EFAULT;
 
              return rc;
@@ -2323,7 +2323,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
              if (mdtidx < 0)
                      return mdtidx;
 
-             if (put_user((int)mdtidx, (int *)arg))
+             if (put_user((int)mdtidx, (int __user *)arg))
                      return -EFAULT;
 
              return 0;
@@ -2350,7 +2350,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
              rc = obd_iocontrol(cmd, ll_i2mdexp(inode), sizeof(*op_data),
                                 op_data, NULL);
 
-             if (copy_to_user((void *)arg, hus, sizeof(*hus)))
+             if (copy_to_user((void __user *)arg, hus, sizeof(*hus)))
                      rc = -EFAULT;
 
              ll_finish_md_op_data(op_data);
@@ -2361,7 +2361,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
              struct hsm_state_set    *hss;
              int                      rc;
 
-             hss = memdup_user((char *)arg, sizeof(*hss));
+             hss = memdup_user((char __user *)arg, sizeof(*hss));
              if (IS_ERR(hss))
                      return PTR_ERR(hss);
 
@@ -2389,7 +2389,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
              rc = obd_iocontrol(cmd, ll_i2mdexp(inode), sizeof(*op_data),
                                 op_data, NULL);
 
-             if (copy_to_user((char *)arg, hca, sizeof(*hca)))
+             if (copy_to_user((char __user *)arg, hca, sizeof(*hca)))
                      rc = -EFAULT;
 
              ll_finish_md_op_data(op_data);
--

1.9.1

Quoted 7 lines
Quoted 7 lines

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20151030160650.GA13665%40amitoj-Inspiron-3542.
For more options, visit https://groups.google.com/d/optout.

Oh yes, my bad. Was reading up on __iomem and made the mistake. Sorry. Sending a v2.

Signature · 1 line
Amitoj