From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: wangyufen <wangyufen@huawei.com>
Cc: Bart Van Assche <bvanassche@acm.org>,
jgg@ziepe.ca, leon@kernel.org,
dennis.dalessandro@cornelisnetworks.com,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
bart.vanassche@wdc.com, easwar.hariharan@intel.com
Subject: Re: [PATCH v4 2/2] RDMA/srp: Fix error return code in srp_parse_options()
Date: Thu, 1 Dec 2022 14:21:19 +0200 [thread overview]
Message-ID: <Y4icP1qyB+bLK+ya@smile.fi.intel.com> (raw)
In-Reply-To: <0b726968-bfb8-ab9a-8d03-4d072d410597@huawei.com>
On Thu, Dec 01, 2022 at 09:49:51AM +0800, wangyufen wrote:
> 在 2022/12/1 2:00, Bart Van Assche 写道:
> > On 11/29/22 19:31, wangyufen wrote:
...
> case SRP_OPT_CMD_SG_ENTRIES:
> - if (match_int(args, &token) || token < 1 || token >
> 255) {
> + ret = match_int(args, &token);
> + if (ret) {
> + pr_warn("bad max cmd_sg_entries parameter
> '%s'\n",
It's misleading message here. The problem is that parser failed by some reason.
Otherwise this variant seems good one.
> + p);
> + goto out;
> + }
> + if (token < 1 || token > 255) {
> pr_warn("bad max cmd_sg_entries parameter
> '%s'\n",
> p);
> + ret = -EINVAL;
> goto out;
> }
> target->cmd_sg_cnt = token;
> break;
...
> Or the following is better?
Why do you want to shadow actual error code?
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2022-12-01 12:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-29 2:04 [PATCH v4 1/2] RDMA/hfi1: Fix error return code in parse_platform_config() Wang Yufen
2022-11-29 2:04 ` [PATCH v4 2/2] RDMA/srp: Fix error return code in srp_parse_options() Wang Yufen
2022-11-29 18:43 ` Bart Van Assche
2022-11-30 3:31 ` wangyufen
2022-11-30 18:00 ` Bart Van Assche
2022-12-01 1:37 ` wangyufen
2022-12-01 1:49 ` wangyufen
2022-12-01 12:21 ` Andy Shevchenko [this message]
2022-11-29 8:56 ` [PATCH v4 1/2] RDMA/hfi1: Fix error return code in parse_platform_config() Leon Romanovsky
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=Y4icP1qyB+bLK+ya@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=bart.vanassche@wdc.com \
--cc=bvanassche@acm.org \
--cc=dennis.dalessandro@cornelisnetworks.com \
--cc=easwar.hariharan@intel.com \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=wangyufen@huawei.com \
/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