[PATCH 2/4] ppc 8xxx: Fix logic

Alexander Shiyan shc_work at mail.ru
Wed Jan 29 13:21:47 EST 2014


Expression (pdimm->data_width >= 32) || (pdimm->data_width <= 40)
always evaluates to true, so probably we need to use "&&" here.

Signed-off-by: Alexander Shiyan <shc_work at mail.ru>
---
 arch/ppc/ddr-8xxx/options.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/ppc/ddr-8xxx/options.c b/arch/ppc/ddr-8xxx/options.c
index 22b621f..9ce2bc1 100644
--- a/arch/ppc/ddr-8xxx/options.c
+++ b/arch/ppc/ddr-8xxx/options.c
@@ -48,7 +48,7 @@ uint32_t populate_memctl_options(int all_DIMMs_registered,
 	if (pdimm->n_ranks != 0) {
 		if ((pdimm->data_width >= 64) && (pdimm->data_width <= 72))
 			popts->data_bus_width = 0;
-		else if ((pdimm->data_width >= 32) ||
+		else if ((pdimm->data_width >= 32) &&
 			(pdimm->data_width <= 40))
 			popts->data_bus_width = 1;
 		else
-- 
1.8.3.2




More information about the barebox mailing list