netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "J. Bruce Fields" <bfields@fieldses.org>,
	kernel-janitors@vger.kernel.org, Neil Brown <neilb@suse.de>,
	Trond Myklebust <Trond.Myklebust@netapp.com>,
	"David S. Miller" <davem@davemloft.net>,
	linux-nfs@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/5] net/sunrpc: use kstrtoul, etc
Date: Wed, 9 Nov 2011 07:15:32 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.02.1111090710000.1899@hadrien> (raw)
In-Reply-To: <alpine.DEB.2.02.1111082113380.1880@hadrien>

In looking through some examples, I see, e.g.:

 	if (strict_strtoul(buf, 10, &val) < 0)
  		return -EINVAL;
 	if (val < 1 || val > 2)
  		return -EINVAL;

In this case the only valid values are 1 and 2, which are much smaller 
than the u8 range.  Is it useful to use kstrtou8 anyway?  I see that 
kstrtou8 returns -ERANGE not -EINVAL when the value is out of bounds.  If 
kstrtou8 is to be used, should the subsequent if (val < 1 || val > 2) now 
return -ERANGE to be consistent?

julia

  parent reply	other threads:[~2011-11-09  6:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-06 13:26 [PATCH 0/5] use kstrtoul, etc Julia Lawall
2011-11-06 13:26 ` [PATCH 1/5] net/batman-adv: " Julia Lawall
     [not found]   ` <1320586010-21931-2-git-send-email-julia-dAYI7NvHqcQ@public.gmane.org>
2011-11-06 14:16     ` Marek Lindner
2011-11-06 13:26 ` [PATCH 2/5] net/sunrpc: " Julia Lawall
     [not found]   ` <1320586010-21931-3-git-send-email-julia-dAYI7NvHqcQ@public.gmane.org>
2011-11-08 19:38     ` Alexey Dobriyan
2011-11-08 20:19       ` Julia Lawall
2011-11-08 20:45         ` Alexey Dobriyan
2011-11-09  6:15         ` Julia Lawall [this message]
2011-11-06 13:26 ` [PATCH 3/5] net/mac80211/debugfs.c: " Julia Lawall
2011-11-07 11:47   ` Eliad Peller
2011-11-07 11:58     ` Julia Lawall
2011-11-06 13:26 ` [PATCH 4/5] net/rfkill/core.c: " Julia Lawall
2011-11-06 13:26 ` [PATCH 5/5] net/dns_resolver/dns_key.c: " Julia Lawall

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=alpine.DEB.2.02.1111090710000.1899@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=Trond.Myklebust@netapp.com \
    --cc=adobriyan@gmail.com \
    --cc=bfields@fieldses.org \
    --cc=davem@davemloft.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=netdev@vger.kernel.org \
    /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).