[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5458ee0e-573c-fbc4-5cdd-5f319f78e3cb@kernel.dk>
Date: Mon, 20 Sep 2021 17:08:05 -0600
From: Jens Axboe <axboe@...nel.dk>
To: Arnd Bergmann <arnd@...nel.org>,
Pavel Begunkov <asml.silence@...il.com>
Cc: Arnd Bergmann <arnd@...db.de>, io-uring@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] [RFC] io_uring: warning about unused-but-set parameter
On 9/20/21 6:13 AM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
>
> When enabling -Wunused warnings by building with W=1, I get an
> instance of the -Wunused-but-set-parameter warning in the io_uring code:
>
> fs/io_uring.c: In function 'io_queue_async_work':
> fs/io_uring.c:1445:61: error: parameter 'locked' set but not used [-Werror=unused-but-set-parameter]
> 1445 | static void io_queue_async_work(struct io_kiocb *req, bool *locked)
> | ~~~~~~^~~~~~
>
> There are very few warnings of this type, so it would be nice to enable
> this by default and fix all the existing instances. I was almost
> done, but this was added recently as a precaution to prevent code
> from using the parameter, which could be done by either removing
> the initialization, or by adding a (fake) use of the variable, which
> I do here with the cast to void.
I would just rename the argument here 'dont_use' or something like that,
that should be enough of a signal for future cases that it should need
extra consideration.
--
Jens Axboe
Powered by blists - more mailing lists