From: Ralf Baechle <ralf@linux-mips.org>
To: Sergei Shtylyov <sshtylyov@mvista.com>
Cc: John Crispin <blogic@openwrt.org>,
Ralph Hempel <ralph.hempel@lantiq.com>,
Wim Van Sebroeck <wim@iguana.be>,
linux-mips@linux-mips.org, linux-watchdog@vger.kernel.org
Subject: Re: [PATCH V2 05/10] MIPS: lantiq: add watchdog support
Date: Wed, 2 Mar 2011 15:29:33 +0100 [thread overview]
Message-ID: <20110302142933.GA18221@linux-mips.org> (raw)
In-Reply-To: <4D6E286D.9050100@mvista.com>
On Wed, Mar 02, 2011 at 02:22:21PM +0300, Sergei Shtylyov wrote:
> >+ switch (cmd) {
> >+ case WDIOC_GETSUPPORT:
> >+ ret = copy_to_user((struct watchdog_info __user *)arg, &ident,
> >+ sizeof(ident)) ? -EFAULT : 0;
>
> Doesn't copy_to_user() return 0 or -EFAULT?
No and that's a common cause of bugs. copy_{from,to}_user returns the
number of characters that could be be copied so the conversion to an
error code is needed here.
The function takes a void argument and there is no benefit from casting
to the full struct watchdog_info __user * pointer type other than maybe
clarity to the human reader.
While nitpicking - there should be one space between include and < in
#include <blah.h>.
Ralf
next prev parent reply other threads:[~2011-03-02 15:00 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-01 16:13 [PATCH V2 00/10] MIPS: add support for Lantiq SoCs John Crispin
2011-03-01 16:13 ` [PATCH V2 01/10] MIPS: lantiq: add initial " John Crispin
2011-03-01 16:13 ` [PATCH V2 02/10] MIPS: lantiq: add SoC specific code for XWAY family John Crispin
2011-03-01 16:13 ` [PATCH V2 03/10] MIPS: lantiq: add PCI controller support John Crispin
2011-03-01 16:13 ` [PATCH V2 04/10] MIPS: lantiq: add serial port support John Crispin
2011-03-01 16:13 ` [PATCH V2 05/10] MIPS: lantiq: add watchdog support John Crispin
2011-03-02 11:22 ` Sergei Shtylyov
2011-03-02 14:29 ` Ralf Baechle [this message]
2011-03-02 15:05 ` John Crispin
2011-03-02 16:27 ` Ralf Baechle
2011-03-02 17:36 ` Sergei Shtylyov
2011-03-02 17:34 ` Sergei Shtylyov
2011-03-02 15:44 ` John Crispin
2011-03-03 10:15 ` Jamie Iles
2011-03-03 11:21 ` Sergei Shtylyov
2011-03-01 16:13 ` [PATCH V2 06/10] MIPS: lantiq: add NOR flash support John Crispin
2011-03-07 8:58 ` Artem Bityutskiy
2011-03-07 12:25 ` John Crispin
2011-03-28 14:15 ` John Crispin
2011-03-01 16:13 ` [PATCH V2 07/10] MIPS: lantiq: add platform device support John Crispin
2011-03-01 16:13 ` [PATCH V2 08/10] MIPS: lantiq: add mips_machine support John Crispin
2011-03-01 16:13 ` [PATCH V2 09/10] MIPS: lantiq: add machtypes for lantiq eval kits John Crispin
2011-03-01 16:13 ` [PATCH V2 10/10] MIPS: lantiq: add more gpio drivers John Crispin
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=20110302142933.GA18221@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=blogic@openwrt.org \
--cc=linux-mips@linux-mips.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=ralph.hempel@lantiq.com \
--cc=sshtylyov@mvista.com \
--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