[PATCH] power: regulator: Fix incorrect use of binary and

Quentin Schulz quentin.schulz at cherry.de
Mon Jul 14 14:31:31 CEST 2025


Hi Andrew,

On 7/3/25 1:53 PM, Andrew Goodbody wrote:
> In regulator_list_autoset there is a test for ret being non-zero and
> error being zero but it uses the binary '&' instead of the logical '&&'
> which could well lead to unexpected results. Correct this to use the
> logical '&&' instead.
> 
> This issue found by Smatch.
> 
> Signed-off-by: Andrew Goodbody <andrew.goodbody at linaro.org>

That seems like what was intended according to the documentation found 
in include/power/regulator.h

"""
Return: 0 on successfully setup of all list entries, otherwise first error.
"""

Therefore:

Reviewed-by: Quentin Schulz <quentin.schulz at cherry.de>

Thanks!
Quentin


More information about the U-Boot mailing list