Re: [PATCH blktests v3 3/3] nvme: introduce nvmet_target_{setup/cleanup} common code

From: Shinichiro Kawasaki
Date: Mon Aug 28 2023 - 00:17:54 EST


On Aug 25, 2023 / 09:46, Bart Van Assche wrote:
> On 8/25/23 07:26, Daniel Wagner wrote:
> > On Fri, Aug 25, 2023 at 06:45:25AM -0700, Bart Van Assche wrote:
> > > I don't like the "new style". What is so hard about typing "$@" to pass all function
> > > arguments to _nvmet_target_setup()? Leaving out "$@" makes it much harder than
> > > necessary to figure out the intent of the code author - not passing any arguments
> > > or passing all caller arguments implicitly.
> >
> > Because "$@" is just not correct.
>
> Why not?

Bart, let me confirm. Do you suggest

test() {

_nvmet_target_setup "$@"

instead of this?

test() {

_nvmet_target_setup

If so, it looks weird since "$@" in test() is not the parameters passed to
_nvmet_target_setup(). Anyway, I tried the change with test/nvme/003, and
observed the shellcheck warning disappears. Then, it will work so long as "$@"
is empty in the context of _nvmet_target_setup() caller. Otherwise, it will not
work. For me, your original suggestion to add "ignored_agument" looks better
than "$@". (or in short, "noarg" or something)