All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Dooks <ben-linux@fluff.org>
To: Wim Van Sebroeck <wim@iguana.be>
Cc: Ben Dooks <ben-linux@fluff.org>, linux-kernel@vger.kernel.org
Subject: Re: wdt285: fix sparse warnings
Date: Tue, 16 Sep 2008 11:31:57 +0100	[thread overview]
Message-ID: <20080916103157.GG1916@fluff.org.uk> (raw)
In-Reply-To: <20080915080556.GB2654@infomag.infomag.iguana.be>

On Mon, Sep 15, 2008 at 10:05:56AM +0200, Wim Van Sebroeck wrote:
> Ben,
> 
> ...
> > @@ -141,13 +141,13 @@ static long watchdog_ioctl(struct file *
> >  	switch (cmd) {
> >  	case WDIOC_GETSUPPORT:
> >  		ret = 0;
> > -		if (copy_to_user((void *)arg, &ident, sizeof(ident)))
> > +		if (copy_to_user((void __user *)arg, &ident, sizeof(ident)))
> >  			ret = -EFAULT;
> >  		break;
> >  
> ...
> 
> Isn't it better to fix this like we did with the other watchdog drivers:
>         void __user *argp = (void __user *)arg;
>         int __user *p = argp;

I've changed the int pointer, as it is used numerous times, but left
the void as it is only used in the copy_to_user.
 	...
> 		if (copy_to_user(argp, &ident, sizeof(ident)))
> 	...
> 
> Regards,
> Wim.
> 
> --
> 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/

-- 
Ben (ben@fluff.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

  reply	other threads:[~2008-09-16 10:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-14 21:34 wdt285: fix sparse warnings Ben Dooks
2008-09-15  8:05 ` Wim Van Sebroeck
2008-09-16 10:31   ` Ben Dooks [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-09-16 10:31 Ben Dooks

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=20080916103157.GG1916@fluff.org.uk \
    --to=ben-linux@fluff.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.