Re: [PATCH] io_uring: fix a GCC warning in wq_list_for_each()

From: Qian Cai
Date: Wed Oct 27 2021 - 11:12:06 EST




On 10/27/21 5:56 AM, Pavel Begunkov wrote:
> On 10/25/21 15:59, Qian Cai wrote:
>> fs/io_uring.c: In function '__io_submit_flush_completions':
>> fs/io_uring.c:2367:33: warning: variable 'prev' set but not used
>> [-Wunused-but-set-variable]
>>   2367 |  struct io_wq_work_node *node, *prev;
>>        |                                 ^~~~
>>
>> Fixed it by open-coded the wq_list_for_each() without an unused previous
>> node pointer.
>
> That's intentional, the var is optimised out and it's better to
> not hand code it (if possible).

Yes, this is pretty minor. Not going to insist if people don't like for
some reasons.