]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
pinctrl: stmfx: Remove duplicated code
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Thu, 7 Aug 2025 10:04:03 +0000 (11:04 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 15 Aug 2025 20:17:30 +0000 (14:17 -0600)
In stmfx_read_reg there is duplicated code to detect ret < 0 and return
ret if so. Remove one version of it.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
drivers/pinctrl/pinctrl-stmfx.c

index 61f335c4eb14f054b3a4126ffd20e35a14d4f621..0d5778faef9646fbcbec9ea171f73cea397c6d8f 100644 (file)
@@ -87,7 +87,7 @@ static int stmfx_read_reg(struct udevice *dev, u8 reg_base, uint offset)
        if (ret < 0)
                return ret;
 
-       return ret < 0 ? ret : !!(ret & mask);
+       return !!(ret & mask);
 }
 
 static int stmfx_write_reg(struct udevice *dev, u8 reg_base, uint offset,