Patchwork [U-Boot,2/3] board/tqm85xx: Clean up PPC_DDR_WIMGE define logic in config file

login
register
mail settings
Submitter Becky Bruce
Date July 15, 2011, 10:25 p.m.
Message ID <13107687401917-git-send-email-beckyb@kernel.crashing.org>
Download mbox | patch
Permalink /patch/104919/
State Superseded
Delegated to: Kumar Gala
Headers show

Comments

Becky Bruce - July 15, 2011, 10:25 p.m.
The way I wrote this in the first time was based on the original
code, but I used a karnaugh map to make it a bit easier to
read.....  There should be no functional change.

Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
---
 include/configs/TQM85xx.h |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
Wolfgang Denk - July 15, 2011, 11:37 p.m.
Dear Becky Bruce,

In message <13107687401917-git-send-email-beckyb@kernel.crashing.org> you wrote:
> The way I wrote this in the first time was based on the original
> code, but I used a karnaugh map to make it a bit easier to
> read.....  There should be no functional change.

Ummm...

>  #if defined(CONFIG_TQM_BIGFLASH) || \
> -	(!defined(CONFIG_TQM8548_AG) && !defined(CONFIG_TQM8548_BE))
> +	defined(CONFIG_TQM8548_AG) || \
> +	defined(CONFIG_TQM8548_BE)

Sorry, but this looks wrong to me.

Isn't the rule "foo & bar == !(!foo || !bar)", so that

	(!defined(CONFIG_TQM8548_AG) && !defined(CONFIG_TQM8548_BE))

becomes

	!(defined(CONFIG_TQM8548_AG) || defined(CONFIG_TQM8548_BE))

?

I think you are missing the "not" part...

Best regards,

Wolfgang Denk

Patch

diff --git a/include/configs/TQM85xx.h b/include/configs/TQM85xx.h
index 79a958d..b4eef28 100644
--- a/include/configs/TQM85xx.h
+++ b/include/configs/TQM85xx.h
@@ -147,10 +147,15 @@ 
  * DDR Setup
  */
 #define CONFIG_SYS_DDR_SDRAM_BASE	0x00000000	/* DDR is system memory	*/
+
 #if defined(CONFIG_TQM_BIGFLASH) || \
-	(!defined(CONFIG_TQM8548_AG) && !defined(CONFIG_TQM8548_BE))
+	defined(CONFIG_TQM8548_AG) || \
+	defined(CONFIG_TQM8548_BE)
 #define CONFIG_SYS_PPC_DDR_WIMGE (MAS2_I | MAS2_G)
+#else
+#define CONFIG_SYS_PPC_DDR_WIMGE (0)
 #endif
+
 #define CONFIG_SYS_SDRAM_BASE		CONFIG_SYS_DDR_SDRAM_BASE
 #ifdef CONFIG_TQM8548_AG
 #define CONFIG_VERY_BIG_RAM