[PATCH 1/1] lib: smbios_entr() use logical or for booleans

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Sun Jan 28 11:24:21 CET 2024


As a matter of programming style use logical or to combine two boolean
results.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
---
 lib/smbios-parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/smbios-parser.c b/lib/smbios-parser.c
index f48d7436570..0d1ac781b38 100644
--- a/lib/smbios-parser.c
+++ b/lib/smbios-parser.c
@@ -15,7 +15,7 @@ const struct smbios_entry *smbios_entry(u64 address, u32 size)
 {
 	const struct smbios_entry *entry = (struct smbios_entry *)(uintptr_t)address;
 
-	if (!address | !size)
+	if (!address || !size)
 		return NULL;
 
 	if (memcmp(entry->anchor, "_SM_", 4))
-- 
2.43.0



More information about the U-Boot mailing list