]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
arm: socfpga: agilex5: Coverity issue cleanup in jtag_usercode check
authorTingting Meng <tingting.meng@altera.com>
Tue, 29 Apr 2025 09:55:42 +0000 (02:55 -0700)
committerTien Fong Chee <tien.fong.chee@intel.com>
Wed, 30 Jul 2025 09:45:30 +0000 (17:45 +0800)
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@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@intel.com>
arch/arm/mach-socfpga/board.c

index bda12324803383bf1572f5492d34e700c34ba73e..28554b7a10942176df569598fa9eb01a945d0910 100644 (file)
@@ -134,7 +134,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 {