From: Andrew Goodbody Date: Mon, 1 Sep 2025 15:00:46 +0000 (+0100) Subject: power: regulator: Fix incorrect use of binary and X-Git-Tag: v2026.01-rc1~72^2~15^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6c98e6014b3a36933860d02cb757565ec2fc80a4;p=thirdparty%2Fu-boot.git power: regulator: Fix incorrect use of binary and 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 Reviewed-by: Peng Fan Signed-off-by: Peng Fan --- diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c index 2a59a1b79c2..94c52cf555b 100644 --- a/drivers/power/regulator/regulator-uclass.c +++ b/drivers/power/regulator/regulator-uclass.c @@ -389,7 +389,7 @@ int regulator_list_autoset(const char *list_platname[], ret = regulator_autoset_by_name(list_platname[i], &dev); if (ret != -EMEDIUMTYPE && verbose) regulator_show(dev, ret); - if (ret & !error) + if (ret && ret != -EALREADY && !error) error = ret; if (list_devp)