From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Ian Campbell <icampbell@arcom.com>
Cc: Wim Van Sebroeck <wim@iguana.be>, linux-kernel@vger.kernel.org
Subject: Re: [WATCHDOG] sa1100_wdt.c sparse cleanups
Date: Sat, 5 Nov 2005 10:10:27 +0000 [thread overview]
Message-ID: <20051105101026.GA28438@flint.arm.linux.org.uk> (raw)
In-Reply-To: <1130921809.12578.179.camel@icampbell-debian>
On Wed, Nov 02, 2005 at 08:56:49AM +0000, Ian Campbell wrote:
> @@ -96,20 +96,20 @@
>
> switch (cmd) {
> case WDIOC_GETSUPPORT:
> - ret = copy_to_user((struct watchdog_info *)arg, &ident,
> + ret = copy_to_user((struct watchdog_info __user *)arg, &ident,
> sizeof(ident)) ? -EFAULT : 0;
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;
etc
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
next prev parent reply other threads:[~2005-11-05 10:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-02 8:56 [WATCHDOG] sa1100_wdt.c sparse cleanups Ian Campbell
2005-11-05 10:10 ` Russell King [this message]
2005-11-05 14:51 ` Al Viro
2005-11-05 17:24 ` Russell King
2005-11-07 10:21 ` Ian Campbell
2006-01-17 19:04 ` Wim Van Sebroeck
2006-01-18 8:45 ` Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051105101026.GA28438@flint.arm.linux.org.uk \
--to=rmk+lkml@arm.linux.org.uk \
--cc=icampbell@arcom.com \
--cc=linux-kernel@vger.kernel.org \
--cc=wim@iguana.be \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).