]> git.apps.os.sepia.ceph.com Git - ceph-client.git/commit
rbd: replace usage of found with dedicated list iterator variable
authorJakob Koschel <jakobkoschel@gmail.com>
Thu, 24 Mar 2022 07:20:50 +0000 (08:20 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 25 Apr 2022 09:07:47 +0000 (11:07 +0200)
commit9e30c9918fb65dae2e92c206a08c993fdde4f325
treeba2b5f996338f8a747a7bde0d426acec576375d1
parentae420da77c356eefb15fbc092b8aa52f323ac78d
rbd: replace usage of found with dedicated list iterator variable

To move the list iterator variable into the list_for_each_entry_*()
macro in the future it should be avoided to use the list iterator
variable after the loop body.

To *never* use the list iterator variable after the loop it was
concluded to use a separate iterator variable instead of a
found boolean [1].

This removes the need to use a found variable and simply checking if
the variable was set, can determine if the break/goto was hit.

Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/
Signed-off-by: Jakob Koschel <jakobkoschel@gmail.com>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
drivers/block/rbd.c