Skip to contentSkip to conversation

splash: fix splash source flags check

PATCH Superseded Tomas Melin 2 participants 2 messages Nov 16, 2016 – Nov 17, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 splash: fix splash source flags check

SPLASH_STORAGE_RAW is defined as 0, so a check against & will never be true. These flags are never combined so do a check against == instead.

---
 common/splash_source.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
common/splash_source.c +2 -3
index 230b2db..72df2c1 100644
@@ -327,10 +327,9 @@ int splash_source_load(struct splash_location *locations, uint size)
 	if (!splash_location)
 		return -EINVAL;
 
-	if (splash_location->flags & SPLASH_STORAGE_RAW)
+	if (splash_location->flags == SPLASH_STORAGE_RAW)
 		return splash_load_raw(splash_location, bmp_load_addr);
-	else if (splash_location->flags & SPLASH_STORAGE_FS)
+	else if (splash_location->flags == SPLASH_STORAGE_FS)
 		return splash_load_fs(splash_location, bmp_load_addr);
-
 	return -EINVAL;
 }
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 splash: fix splash source flags check

Quoted 5 lines · Tomas Melin

SPLASH_STORAGE_RAW is defined as 0, so a check against & will never be true. These flags are never combined so do a check against == instead.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161117/a6aee544/attachment.sig>