From: Ian Campbell <icampbell@arcom.com>
To: Russell King <rmk+lkml@arm.linux.org.uk>
Cc: Wim Van Sebroeck <wim@iguana.be>, linux-kernel@vger.kernel.org
Subject: Re: [WATCHDOG] sa1100_wdt.c sparse cleanups
Date: Mon, 07 Nov 2005 10:21:24 +0000 [thread overview]
Message-ID: <1131358884.14696.57.camel@icampbell-debian> (raw)
In-Reply-To: <20051105101026.GA28438@flint.arm.linux.org.uk>
On Sat, 2005-11-05 at 10:10 +0000, Russell King wrote:
> It's probably better to use a union with these, eg:
The common idiom in the watchdog drivers seems to be to use separate
variables. I'll leave it up to Wim if he wants to change that.
The following makes drivers/char/watchdog/sa1100_wdt.c sparse clean.
Signed-off-by: Ian Campbell <icampbell@arcom.com>
Index: 2.6/drivers/char/watchdog/sa1100_wdt.c
===================================================================
--- 2.6.orig/drivers/char/watchdog/sa1100_wdt.c 2005-11-03 11:02:05.000000000 +0000
+++ 2.6/drivers/char/watchdog/sa1100_wdt.c 2005-11-07 09:51:47.000000000 +0000
@@ -74,7 +74,7 @@
return 0;
}
-static ssize_t sa1100dog_write(struct file *file, const char *data, size_t len, loff_t *ppos)
+static ssize_t sa1100dog_write(struct file *file, const char __user *data, size_t len, loff_t *ppos)
{
if (len)
/* Refresh OSMR3 timer. */
@@ -93,23 +93,24 @@
{
int ret = -ENOIOCTLCMD;
int time;
+ void __user *argp = (void __user *)arg;
+ int __user *p = argp;
switch (cmd) {
case WDIOC_GETSUPPORT:
- ret = copy_to_user((struct watchdog_info *)arg, &ident,
- sizeof(ident)) ? -EFAULT : 0;
+ ret = copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
break;
case WDIOC_GETSTATUS:
- ret = put_user(0, (int *)arg);
+ ret = put_user(0, p);
break;
case WDIOC_GETBOOTSTATUS:
- ret = put_user(boot_status, (int *)arg);
+ ret = put_user(boot_status, p);
break;
case WDIOC_SETTIMEOUT:
- ret = get_user(time, (int *)arg);
+ ret = get_user(time, p);
if (ret)
break;
@@ -123,7 +124,7 @@
/*fall through*/
case WDIOC_GETTIMEOUT:
- ret = put_user(pre_margin / OSCR_FREQ, (int *)arg);
+ ret = put_user(pre_margin / OSCR_FREQ, p);
break;
case WDIOC_KEEPALIVE:
--
Ian Campbell, Senior Design Engineer
Web: http://www.arcom.com
Arcom, Clifton Road, Direct: +44 (0)1223 403 465
Cambridge CB1 7EA, United Kingdom Phone: +44 (0)1223 411 200
_____________________________________________________________________
The message in this transmission is sent in confidence for the attention of the addressee only and should not be disclosed to any other party. Unauthorised recipients are requested to preserve this confidentiality. Please advise the sender if the addressee is not resident at the receiving end. Email to and from Arcom is automatically monitored for operational and lawful business reasons.
This message has been virus scanned by MessageLabs.
next prev parent reply other threads:[~2005-11-07 10:21 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
2005-11-05 14:51 ` Al Viro
2005-11-05 17:24 ` Russell King
2005-11-07 10:21 ` Ian Campbell [this message]
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=1131358884.14696.57.camel@icampbell-debian \
--to=icampbell@arcom.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk+lkml@arm.linux.org.uk \
--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