]> git.baikalelectronics.ru Git - kernel.git/commit
thunderbolt: Replace usage of found with dedicated list iterator variable
authorJakob Koschel <jakobkoschel@gmail.com>
Thu, 24 Mar 2022 07:27:00 +0000 (08:27 +0100)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Mon, 4 Apr 2022 09:31:50 +0000 (12:31 +0300)
commit9869cfdf7953f3b4dc55f8b517c001cce9ff77dc
tree9c0a27bf35029b05606345a7947997e677055619
parentdbb008736a8c113ef1e12b4e4b4351fac2a15ede
thunderbolt: 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>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/thunderbolt/ctl.c