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