mtd: fix different address space noise

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Thu Feb 25 07:59:03 EST 2010


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=bcc98a46eafd38968b05e793326f031988c2b2a8
Commit:     bcc98a46eafd38968b05e793326f031988c2b2a8
Parent:     1449c5d0e8f25af6c903797a636696901122e4e8
Author:     H Hartley Sweeten <hartleys at visionengravers.com>
AuthorDate: Fri Jan 15 11:25:38 2010 -0700
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Thu Feb 25 11:29:48 2010 +0000

    mtd: fix different address space noise
    
    In mtd_ioctl MEMGETREGIONINFO the region_user_info pointer ur
    is cast in __kernel space. This produces a number of sparse warnings
    like:
    
    warning: cast removes address space of expression
    warning: incorrect type in initializer (different address spaces)
       expected unsigned int const [noderef] <asn:1>*register __p
       got unsigned int *<noident>
    
    Since argp is already a void __user * just use it dirrectly without
    the cast and make ur a __user *.
    
    Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/mtdchar.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 5b081cb..0a85085 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -482,7 +482,7 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
 	{
 		uint32_t ur_idx;
 		struct mtd_erase_region_info *kr;
-		struct region_info_user *ur = (struct region_info_user *) argp;
+		struct region_info_user __user *ur = argp;
 
 		if (get_user(ur_idx, &(ur->regionindex)))
 			return -EFAULT;



More information about the linux-mtd-cvs mailing list