[PATCH v1 1/1] arm: socfpga: agilex5: Coverity issue cleanup in jtag_usercode check
tingting.meng at altera.com
tingting.meng at altera.com
Tue Apr 29 11:55:42 CEST 2025
From: Tingting Meng <tingting.meng at altera.com>
A redundant comparison (jtag_usercode >= 0) was removed from the
condition checking jtag_usercode. Since jtag_usercode is an unsigned
integer, the check for non-negativity was always true. The code was
simplified to resolve the Coverity warning.
Signed-off-by: Tingting Meng <tingting.meng at altera.com>
---
arch/arm/mach-socfpga/board.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach-socfpga/board.c
index 8506d510413..8bec7c6dccd 100644
--- a/arch/arm/mach-socfpga/board.c
+++ b/arch/arm/mach-socfpga/board.c
@@ -133,7 +133,7 @@ u8 socfpga_get_board_id(void)
if (jtag_usercode == DEFAULT_JTAG_USERCODE) {
debug("JTAG Usercode is not set. Default Board ID to 0\n");
- } else if (jtag_usercode >= 0 && jtag_usercode <= 255) {
+ } else if (jtag_usercode <= 255) {
board_id = jtag_usercode;
debug("Valid JTAG Usercode. Set Board ID to %u\n", board_id);
} else {
--
2.25.1
More information about the U-Boot
mailing list