All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@mvista.com>
To: Ralf Baechle <ralf@linux-mips.org>
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, 02 Mar 2011 20:34:52 +0300	[thread overview]
Message-ID: <4D6E7FBC.6040805@mvista.com> (raw)
In-Reply-To: <20110302142933.GA18221@linux-mips.org>

Hello.

Ralf Baechle 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.

    But then the code above would be wrong. Actually, it returns the number of 
bytes that could NOT be copied as I now see.

> 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.

    Indeed.

>   Ralf

WBR, Sergei

  parent reply	other threads:[~2011-03-02 17:36 UTC|newest]

Thread overview: 27+ 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
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 [this message]
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-01 16:13   ` John Crispin
2011-03-07  8:58   ` Artem Bityutskiy
2011-03-07  8:58     ` Artem Bityutskiy
2011-03-07 12:25     ` John Crispin
2011-03-07 12:25       ` John Crispin
2011-03-28 14:15       ` 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=4D6E7FBC.6040805@mvista.com \
    --to=sshtylyov@mvista.com \
    --cc=blogic@openwrt.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=ralf@linux-mips.org \
    --cc=ralph.hempel@lantiq.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 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.