linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtdchar.c: fix different address space noise
@ 2010-01-15 18:25 H Hartley Sweeten
  2010-02-02  5:58 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: H Hartley Sweeten @ 2010-01-15 18:25 UTC (permalink / raw)
  To: Linux Kernel, linux-mtd; +Cc: dwmw2

mtdchar.c: 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@visionengravers.com>
Cc: David Woodhouse <dwmw2@infradead.org>

---

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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mtdchar.c: fix different address space noise
  2010-01-15 18:25 [PATCH] mtdchar.c: fix different address space noise H Hartley Sweeten
@ 2010-02-02  5:58 ` Artem Bityutskiy
  0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2010-02-02  5:58 UTC (permalink / raw)
  To: H Hartley Sweeten; +Cc: dwmw2, linux-mtd, Linux Kernel

On Fri, 2010-01-15 at 11:25 -0700, H Hartley Sweeten wrote:
> mtdchar.c: 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@visionengravers.com>
> Cc: David Woodhouse <dwmw2@infradead.org>

Pushed this one to my l2-mtd-2.6 / master

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-02  5:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-15 18:25 [PATCH] mtdchar.c: fix different address space noise H Hartley Sweeten
2010-02-02  5:58 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).