Skip to content

Commit

Permalink
mtd: fix different address space noise
Browse files Browse the repository at this point in the history
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@visionengravers.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
H Hartley Sweeten authored and David Woodhouse committed Feb 25, 2010
1 parent 1449c5d commit bcc98a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mtd/mtdchar.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bcc98a4

Please sign in to comment.