From 951dc4e077b2ba5eadaba3beb9b61f131ffa6fdc Mon Sep 17 00:00:00 2001
From: =?utf8?q?Marek=20Beh=C3=BAn?= <kabel@kernel.org>
Date: Tue, 21 May 2024 09:13:28 +0200
Subject: [PATCH] common: eeprom_field: Drop unnecessary comparison
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

The byte variable is of type unsigned char, it is never less than zero.
The error case is handled by *endptr, so drop the comparison altogether.

Signed-off-by: Marek Behún <kabel@kernel.org>
---
 common/eeprom/eeprom_field.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/eeprom/eeprom_field.c b/common/eeprom/eeprom_field.c
index 9b831414a4..26f6041e54 100644
--- a/common/eeprom/eeprom_field.c
+++ b/common/eeprom/eeprom_field.c
@@ -56,7 +56,7 @@ static int __eeprom_field_update_bin(struct eeprom_field *field,
 		}
 
 		byte = simple_strtoul(tmp, &endptr, 16);
-		if (*endptr != '\0' || byte < 0)
+		if (*endptr != '\0')
 			return -1;
 
 		field->buf[j] = byte;
-- 
2.39.5