Skip to contentSkip to conversation

mcb: fix compiler warning logical-op in mcb-parse.c

PATCH New Michael Moese 1 participant 1 message Oct 19, 2016 Men chameleon bus (mcb)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mcb: fix compiler warning logical-op in mcb-parse.c

The expression was clearly wrong, the logical AND of expressions must be changed to a logical OR.

---
 drivers/mcb/mcb-parse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mcb/mcb-parse.c +1 -1
index 4ca2739..ee7fb6e 100644
@@ -149,7 +149,7 @@ static int chameleon_get_bar(char __iomem **base, phys_addr_t mapbase,
 		reg = readl(*base);
 
 		bar_count = BAR_CNT(reg);
-		if (bar_count <= 0 && bar_count > CHAMELEON_BAR_MAX)
+		if (bar_count <= 0 || bar_count > CHAMELEON_BAR_MAX)
 			return -ENODEV;
 
 		c = kcalloc(bar_count, sizeof(struct chameleon_bar),
Signature · 1 line
2.10.0