public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: "Nicholas A. Bellinger" <nab@risingtidesystems.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Roland Dreier <roland@kernel.org>,
	Sean Hefty <sean.hefty@intel.com>,
	Hal Rosenstock <hal.rosenstock@gmail.com>,
	linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org,
	target-devel <target-devel@vger.kernel.org>,
	Bart Van Assche <bart.vanassche@gmail.com>
Subject: Re: [patch 3/3] ib_srpt: propagate return value from kstrtoul()
Date: Fri, 04 Nov 2011 14:56:39 -0700	[thread overview]
Message-ID: <1320443799.5859.173.camel@haakon2.linux-iscsi.org> (raw)
In-Reply-To: <20111104182830.GI5796@elgon.mountain>

On Fri, 2011-11-04 at 21:28 +0300, Dan Carpenter wrote:
> These days we've renamed strict_strtoul() to kstrtoul().  It has a
> couple different error codes it could return.  Smatch complains if
> we return -EINVAL instead of using the return value that kstrtoul()
> gave us.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Looks fine to me, and will get this series queued up for -rc2.

Thanks Dan!

--nab

> 
> diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
> index f27b8da..04ccc04 100644
> --- a/drivers/infiniband/ulp/srpt/ib_srpt.c
> +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
> @@ -3704,10 +3704,10 @@ static ssize_t srpt_tpg_attrib_store_srp_max_rdma_size(
>  	unsigned long val;
>  	int ret;
>  
> -	ret = strict_strtoul(page, 0, &val);
> +	ret = kstrtoul(page, 0, &val);
>  	if (ret < 0) {
> -		pr_err("strict_strtoul() failed with ret: %d\n", ret);
> -		return -EINVAL;
> +		pr_err("kstrtoul() failed with ret: %d\n", ret);
> +		return ret;
>  	}
>  	if (val > MAX_SRPT_RDMA_SIZE) {
>  		pr_err("val: %lu exceeds MAX_SRPT_RDMA_SIZE: %d\n", val,
> @@ -3744,10 +3744,10 @@ static ssize_t srpt_tpg_attrib_store_srp_max_rsp_size(
>  	unsigned long val;
>  	int ret;
>  
> -	ret = strict_strtoul(page, 0, &val);
> +	ret = kstrtoul(page, 0, &val);
>  	if (ret < 0) {
> -		pr_err("strict_strtoul() failed with ret: %d\n", ret);
> -		return -EINVAL;
> +		pr_err("kstrtoul() failed with ret: %d\n", ret);
> +		return ret;
>  	}
>  	if (val > MAX_SRPT_RSP_SIZE) {
>  		pr_err("val: %lu exceeds MAX_SRPT_RSP_SIZE: %d\n", val,
> @@ -3784,10 +3784,10 @@ static ssize_t srpt_tpg_attrib_store_srp_sq_size(
>  	unsigned long val;
>  	int ret;
>  
> -	ret = strict_strtoul(page, 0, &val);
> +	ret = kstrtoul(page, 0, &val);
>  	if (ret < 0) {
> -		pr_err("strict_strtoul() failed with ret: %d\n", ret);
> -		return -EINVAL;
> +		pr_err("kstrtoul() failed with ret: %d\n", ret);
> +		return ret;
>  	}
>  	if (val > MAX_SRPT_SRQ_SIZE) {
>  		pr_err("val: %lu exceeds MAX_SRPT_SRQ_SIZE: %d\n", val,
> @@ -3831,10 +3831,10 @@ static ssize_t srpt_tpg_store_enable(
>  	unsigned long tmp;
>          int ret;
>  
> -	ret = strict_strtoul(page, 0, &tmp);
> +	ret = kstrtoul(page, 0, &tmp);
>  	if (ret < 0) {
>  		printk(KERN_ERR "Unable to extract srpt_tpg_store_enable\n");
> -		return -EINVAL;
> +		return ret;
>  	}
>  
>  	if ((tmp != 0) && (tmp != 1)) {

      reply	other threads:[~2011-11-04 21:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-04 18:28 [patch 3/3] ib_srpt: propagate return value from kstrtoul() Dan Carpenter
2011-11-04 21:56 ` Nicholas A. Bellinger [this message]

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=1320443799.5859.173.camel@haakon2.linux-iscsi.org \
    --to=nab@risingtidesystems.com \
    --cc=bart.vanassche@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=hal.rosenstock@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=roland@kernel.org \
    --cc=sean.hefty@intel.com \
    --cc=target-devel@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