]> Gentwo Git Trees - linux/.git/commit
iopoll: Avoid evaluating 'cond' twice in poll_timeout_us()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 26 Aug 2025 12:18:58 +0000 (15:18 +0300)
committerJani Nikula <jani.nikula@intel.com>
Thu, 28 Aug 2025 09:17:32 +0000 (12:17 +0300)
commit563e5eca4ea3b6e1901cbc7cd6dc42731a8d2999
treeee81fca2431a964f845ef9fdf86b60ef88945e6c
parent9df8043a546d2eb3adfaba920c027c0d701c73a1
iopoll: Avoid evaluating 'cond' twice in poll_timeout_us()

Currently poll_timeout_us() evaluates 'cond' twice at the end
of the success case. This not desirable in case 'cond' itself
is expensive.

Avoid the double evaluation by tracking the return value in
a variable. Need to use a triple undescore '___ret' name to
avoid a conflict with an existing double undescore '__ret'
variable in the regmap code.

Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Dibin Moolakadan Subrahmanian <dibin.moolakadan.subrahmanian@intel.com>
Cc: Imre Deak <imre.deak@intel.com>
Cc: David Laight <david.laight.linux@gmail.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Matt Wagantall <mattw@codeaurora.org>
Cc: Dejin Zheng <zhengdejin5@gmail.com>
Cc: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Simona Vetter <simona.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250826121859.15497-2-ville.syrjala@linux.intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
include/linux/iopoll.h