[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Y4icP1qyB+bLK+ya@smile.fi.intel.com>
Date: Thu, 1 Dec 2022 14:21:19 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: wangyufen <wangyufen@...wei.com>
Cc: Bart Van Assche <bvanassche@....org>, jgg@...pe.ca,
leon@...nel.org, dennis.dalessandro@...nelisnetworks.com,
linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org,
bart.vanassche@....com, easwar.hariharan@...el.com
Subject: Re: [PATCH v4 2/2] RDMA/srp: Fix error return code in
srp_parse_options()
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
Powered by blists - more mailing lists