lkml.org 
[lkml]   [2005]   [Nov]   [5]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateSat, 5 Nov 2005 17:24:20 +0000
FromRussell King <>
SubjectRe: [WATCHDOG] sa1100_wdt.c sparse cleanups
On Sat, Nov 05, 2005 at 02:51:34PM +0000, Al Viro wrote:
> On Sat, Nov 05, 2005 at 10:10:27AM +0000, Russell King wrote:
> > It's probably better to use a union with these, eg:
> > 	union {
> > 		void __user *arg;
> > 		struct watchdog_info __user *info;
> > 		int __user *i;
> > 	} u;
> > 
> > 	u.arg = (void __user *)arg;
> > 
> > ...
> > 
> > 	ret = copy_to_user(u.info, &ident, sizeof(ident)) ? -EFAULT : 0;
> 
> Just use void __user *.

That works for copy_to_user, but not for put_user() where the type of
the pointer matters.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-11-05 17:26    [from the cache]
©2003-2008