Re: [PATCH] io_uring: silence variable ‘prev’ set but not used warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> If io_uring.o is built with W=1, it triggers a warning:
>
> io_uring/io_uring.c: In function ?__io_submit_flush_completions?:
> io_uring/io_uring.c:1502:40: warning: variable ?prev? set but not used [-Wunused-but-set-variable]
>  1502 |         struct io_wq_work_node *node, *prev;
>       |                                        ^~~~
>
> which is due to the wq_list_for_each() iterator always keeping a 'prev'
> variable. Most users need this to remove an entry from a list, for
> example, but __io_submit_flush_completions() never does that.
>
> Add a basic helper that doesn't track prev instead, and use that in
> that function.
>
> Reported-by: Vincenzo Palazzo <vincenzopalazzodev@xxxxxxxxx>
> Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
>
> ---

Nice, I should pay more attention to the implementation
and maybe propose the equal patch before.

But anyway thanks to rework it.

Reviewed-by: Vincenzo Palazzo <vincenzopalazzodev@xxxxxxxxx>




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux