From bcc98a46eafd38968b05e793326f031988c2b2a8 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Fri, 15 Jan 2010 11:25:38 -0700 Subject: 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] *register __p got unsigned int * 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 Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse --- drivers/mtd/mtdchar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/mtd/mtdchar.c') diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index 5b081cb8435..0a85085fe69 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; -- cgit v1.2.3