[PATCH] mcb: fix compiler warning logical-op in mcb-parse.c
From: Michael Moese
Date: Wed Oct 19 2016 - 12:00:39 EST
The expression was clearly wrong, the logical AND of expressions
must be changed to a logical OR.
Reported-by: David Binderman <dcb314@xxxxxxxxxxx>
Signed-off-by: Michael Moese <michael.moese@xxxxxx>
---
drivers/mcb/mcb-parse.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mcb/mcb-parse.c b/drivers/mcb/mcb-parse.c
index 4ca2739..ee7fb6e 100644
--- a/drivers/mcb/mcb-parse.c
+++ b/drivers/mcb/mcb-parse.c
@@ -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),
--
2.10.0