amcore: add support for amcore board
PATCH v3 2/2 amcore: add support for amcore board
Add support for amcore board.
---
Changes for v2:
- None
Changes for v3:
- Fix code format issues
--- board/sysam/amcore/Makefile | 43 ++++ board/sysam/amcore/amcore.c | 168 ++++++++++++++ board/sysam/amcore/config.mk | 23 ++ board/sysam/amcore/flash.c | 444 ++++++++++++++++++++++++++++++++++++ board/sysam/amcore/u-boot.lds | 101 ++++++++ boards.cfg | 1 + include/configs/amcore.h | 213 +++++++++++++++++ include/flash.h | 1 + 8 files changed, 994 insertions(+), 0 deletions(-)
board/sysam/amcore/Makefile new file +43 -0
@@ -0,0 +1,43 @@ +# +# Copyright (c) 2011 Angelo Dureghello <[email protected]> +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +include $(TOPDIR)/config.mk + +LIB = $(obj)lib$(BOARD).o + +COBJS = $(BOARD).o flash.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB): $(obj).depend $(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +#########################################################################
board/sysam/amcore/amcore.c new file +168 -0
168 lines not on this page · raw message
board/sysam/amcore/config.mk new file +23 -0
@@ -0,0 +1,23 @@ +# +# Copyright (c) 2011 Angelo Dureghello <[email protected]> +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +CONFIG_SYS_TEXT_BASE = 0xffc00000
board/sysam/amcore/flash.c new file +444 -0
444 lines not on this page · raw message
board/sysam/amcore/u-boot.lds new file +101 -0
101 lines not on this page · raw message
boards.cfg +1 -0
@@ -375,6 +375,7 @@ M5271EVB m68k mcf52x2 m5271evb freesca M5272C3 m68k mcf52x2 m5272c3 freescale M5275EVB m68k mcf52x2 m5275evb freescale M5282EVB m68k mcf52x2 m5282evb freescale +amcore m68k mcf530x amcore sysam astro_mcf5373l m68k mcf532x mcf5373l astro M53017EVB m68k mcf532x m53017evb freescale M5329AFEE m68k mcf532x m5329evb freescale - M5329EVB:NANDFLASH_SIZE=0
include/configs/amcore.h new file +213 -0
213 lines not on this page · raw message
include/flash.h +1 -0
@@ -282,6 +282,7 @@ extern flash_info_t *flash_get_info(ulong base);#define SST_ID_xF1601 0x234B234B/* 39xF1601 ID (16M = 1M x 16 ) */ #define SST_ID_xF1602 0x234A234A/* 39xF1602 ID (16M = 1M x 16 ) */ #define SST_ID_xF3201 0x235B235B/* 39xF3201 ID (32M = 2M x 16 ) */ +#define SST_ID_xF3201B 0x235D235D/* 39xF3201B ID (32M = 2M x 16 ) */ #define SST_ID_xF3202 0x235A235A/* 39xF3202 ID (32M = 2M x 16 ) */ #define SST_ID_xF6401 0x236B236B/* 39xF6401 ID (64M = 4M x 16 ) */ #define SST_ID_xF6402 0x236A236A/* 39xF6402 ID (64M = 4M x 16 ) */
PATCH v3 2/2 amcore: add support for amcore board
Dear angelo,
Quoted 9 lines · In message <20121104200021.GB5141@angel3> you wrote:
Add support for amcore board.
Signed-off-by Angelo Dureghello <[email protected]>Cc Jason Jin <[email protected]>---
Changes for v2:
- None
Changes for v3:
- Fix code format issues
Quoted 10 lines
--- board/sysam/amcore/Makefile | 43 ++++ board/sysam/amcore/amcore.c | 168 ++++++++++++++ board/sysam/amcore/config.mk | 23 ++ board/sysam/amcore/flash.c | 444 ++++++++++++++++++++++++++++++++++++ board/sysam/amcore/u-boot.lds | 101 ++++++++ boards.cfg | 1 + include/configs/amcore.h | 213 +++++++++++++++++ include/flash.h | 1 + 8 files changed, 994 insertions(+), 0 deletions(-)
Entry to MAINTAINERS missing.
Quoted 2 lines
board/sysam/amcore/amcore.c new file +0
-0
...
board/sysam/amcore/amcore.c line 29
Quoted 7 lines
board/sysam/amcore/amcore.c new file +7
-0+#include <common.h> +#include <command.h> +#include <malloc.h> +#include <asm/immap.h> + + +int init_lcd (void )
Only one blank line in places like that, please. Please fix globally.
Quoted 4 lines
board/sysam/amcore/amcore.c new file +4
-0+{ +/* +* board can have a K0108 lcd connected on the parallel port, +* wired as below:
board/sysam/amcore/amcore.c line 43
Quoted 10 lines
board/sysam/amcore/amcore.c new file +10
-0+* +* fc cpu P0 P1 P2 P3 P4 P5 P6 P7 P10 P11 P12 P13 P14 +* lcd D0 D1 D2 D3 D4 D5 D6 D7 CS1 CS2 RW DI E +* +* Starting up setting lines in high impedance +*/ +mbar_writeShort (MCFSIM_PAR ,0x300 ); +mbar_writeShort (MCFSIM_PADDR ,0xfcff ); +mbar_writeShort (MCFSIM_PADAT ,0x0c00 ); +}
Did you bother to compile your code? This is a function returning "int", but I don't see any return statement. I would expect to see compiler warnings here?
board/sysam/amcore/amcore.c
Quoted 2 lines
board/sysam/amcore/amcore.c new file +2
-0+phys_size_t initdram (int board_type) +{
Please make sure to use get_mem_size() !
Quoted 1 line
+int testdram (void)
...
Quoted 1 line
+}
We have plenty of memory tests already. Chose one, but don't implement yet another one.
Quoted 1 line
board/sysam/amcore/config.mk +0
-0
...
Quoted 1 line
+CONFIG_SYS_TEXT_BASE =
0xffc00000
This should never be needed. Please move this to board congih file instead.
board/sysam/amcore/flash.c
Quoted 5 lines
board/sysam/amcore/flash.c new file +0
-0
This looks like a standard CFI flash. Why cannot you use the standard CFI driver, then?
board/sysam/amcore/flash.c line 114
Quoted 4 lines
board/sysam/amcore/flash.c new file +4
-0+if (remainder) { + remainder >>=10 ; + remainder = (int )((float ) + (((float )remainder/(float )1024 )*10000 ));
Also please note that we do not use any kind of FP operations in U-Boot. Please get rid of thise - fix globally, please.
Quoted 1 line
+void inline
spin_wheel(void)
We don't use such stuff, either.
board/sysam/amcore/u-boot.lds
Quoted 5 lines
board/sysam/amcore/u-boot.lds new file +0
-0
Why exactly do you need a board specific linker script?
Quoted 5 lines
include/configs/amcore.h new file +0
-0
...
Quoted 1 line
+#define
CONFIG_SYS_UART_PORT(0)
Please no parens around simple valies - p[lease fix globally.
Quoted 1 line
+#define
CONFIG_BOOTDELAY1 /* autoboot after 5 seconds */
Comment and code disagree.
include/configs/amcore.h line 64
Quoted 2 lines
include/configs/amcore.h new file +2
-0+#undef CONFIG_WATCHDOG +#undef CONFIG_MONITOR_IS_IN_RAM
PLease do not undefine what is not defiend anyway.
include/configs/amcore.h line 106
Quoted 5 lines
include/configs/amcore.h new file +5
-0+#define CONFIG_SYS_DEVICE_NULLDEV 1/* include nulldev device */ +#define CONFIG_SYS_CONSOLE_INFO_QUIET 1/* no console @ startup */ +#define CONFIG_AUTO_COMPLETE 1/* add autocompletion support */ +#define CONFIG_LOOPW 1/* enable loopw command */ +#define CONFIG_MX_CYCLIC 1/* enable mdc/mwc commands */
Please do not define values for any macros which are just tested for existence. Please fix globally.
Quoted 1 line
+#define
CONFIG_SYS_BOOTPARAMS_LEN64*1024
Now macros like this do need parens!!
Quoted 5 lines
+/*
+ * For booting Linux, the board info and command line data
+ * have to be in the first 8 MB of memory, since this is
+ * the maximum mapped by the Linux kernel during initialization ??
+ */
Is this really the case?
include/flash.h extern flash_info_t *flash_get_info(ulong base); · line 288
Quoted 12 lines
include/flash.h +1
-0@@ -282,6 +282,7 @@ extern flash_info_t *flash_get_info(ulong base);#define SST_ID_xF1601 0x234B234B/* 39xF1601 ID (16M = 1M x 16 ) */ #define SST_ID_xF1602 0x234A234A/* 39xF1602 ID (16M = 1M x 16 ) */ #define SST_ID_xF3201 0x235B235B/* 39xF3201 ID (32M = 2M x 16 ) */ +#define SST_ID_xF3201B 0x235D235D/* 39xF3201B ID (32M = 2M x 16 ) */ #define SST_ID_xF3202 0x235A235A/* 39xF3202 ID (32M = 2M x 16 ) */ #define SST_ID_xF6401 0x236B236B/* 39xF6401 ID (64M = 4M x 16 ) */ #define SST_ID_xF6402 0x236A236A/* 39xF6402 ID (64M = 4M x 16 ) */
Note - whenever you have to add anything to include/flash.h you should ask yourself what you are doing wrong.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Roses are red Violets are blue Some poems rhyme
A message that is not in the archive (sent off-list or not yet received): 20121105153011.GA8705@angel3
PATCH v3 2/2 amcore: add support for amcore board
Dear Angelo Dureghello,
please make sure to keep the mailing list on Cc: !
Quoted 11 lines · In message <20121105153011.GA8705@angel3> you wrote:
Quoted 11 lines
Quoted 10 lines
board/sysam/amcore/Makefile | 43 ++++ board/sysam/amcore/amcore.c | 168 ++++++++++++++ board/sysam/amcore/config.mk | 23 ++ board/sysam/amcore/flash.c | 444 ++++++++++++++++++++++++++++++++++++ board/sysam/amcore/u-boot.lds | 101 ++++++++ boards.cfg | 1 + include/configs/amcore.h | 213 +++++++++++++++++ include/flash.h | 1 + 8 files changed, 994 insertions(+), 0 deletions(-)
Quoted 4 lines
Quoted 2 lines
Entry to
MAINTAINERSmissing.
MAINTAINERSentry has been created in patch 1/2.
This is wrong, then. Adding the board maintainer obviously belongs into the patch that adds the board support.
Quoted 6 lines
Quoted 3 lines
Did you bother to compile your code? This is a function returning "int", but I don't see any return statement. I would expect to see compiler warnings here?
Of course code compile and u-boot works perfect in my board. Fixed this and will check for all warnings anyway.
I don't understand what you are trying to tell me. Do you mean your compiler did not throw any warnings for this code? Or did it, and you ignored the warnings?
Note that the build must not produce _any_ compiler warnings.
Quoted 11 lines
Quoted 7 lines
Quoted 5 lines
+/*
+ * For booting Linux, the board info and command line data
+ * have to be in the first 8 MB of memory, since this is
+ * the maximum mapped by the Linux kernel during initialization ??
+ */Is this really the case?
I copied this config value and related comment from another board. There are hundreds of
boardsxxx.hsaying the same.
I didn't try to change this limit and assume the comment is true.
There are many boards where this may be correct. But blindly copying stuff around has never been a good idea.
Quoted 2 lines
I will figure out if there is a different way
without adding a new flash chip here.
Just use the CFI flash driver?
Best regards,
Wolfgang Denk
Signature · 7 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It's certainly convenient the way the crime (or condition) of
stupidity carries with it its own punishment, automatically
admisistered without remorse, pity, or prejudice. :-)
-- Tom Christiansen in <[email protected]>PATCH v3 2/2 amcore: add support for amcore board
Quoted 4 lines · Wolfgang Denk
Dear Angelo Dureghello,
please make sure to keep the mailing list on Cc: !
ok.
Quoted 12 lines
Quoted 11 lines · In message <20121105153011.GA8705@angel3> you wrote:
Quoted 11 lines
Quoted 10 lines
board/sysam/amcore/Makefile | 43 ++++ board/sysam/amcore/amcore.c | 168 ++++++++++++++ board/sysam/amcore/config.mk | 23 ++ board/sysam/amcore/flash.c | 444 ++++++++++++++++++++++++++++++++++++ board/sysam/amcore/u-boot.lds | 101 ++++++++ boards.cfg | 1 + include/configs/amcore.h | 213 +++++++++++++++++ include/flash.h | 1 + 8 files changed, 994 insertions(+), 0 deletions(-)
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
Entry to
MAINTAINERSmissing.
MAINTAINERSentry has been created in patch 1/2.This is wrong, then. Adding the board maintainer obviously belongs into the patch that adds the board support.
ok, will send it together with the board related part of the patch (2/2).
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Did you bother to compile your code? This is a function returning "int", but I don't see any return statement. I would expect to see compiler warnings here?
Quoted 9 lines
Quoted 2 lines
Of course code compile and u-boot works perfect in my board. Fixed this and will check for all warnings anyway.
I don't understand what you are trying to tell me. Do you mean your compiler did not throw any warnings for this code? Or did it, and you ignored the warnings?
Note that the build must not produce _any_ compiler warnings.
Code compile, but i lost some warning on the way in the build process. I will check that there are not warning of any kind.
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
+/*
+ * For booting Linux, the board info and command line data
+ * have to be in the first 8 MB of memory, since this is
+ * the maximum mapped by the Linux kernel during initialization ??
+ */
Quoted 9 lines
Quoted 5 lines
Quoted 1 line
Is this really the case?
I copied this config value and related comment from another board. There are hundreds of
boardsxxx.hsaying the same.
I didn't try to change this limit and assume the comment is true.There are many boards where this may be correct. But blindly copying stuff around has never been a good idea.
Ok, i will go deeper here and will remove the comment if the case.
Quoted 5 lines
Quoted 2 lines
I will figure out if there is a different way
without adding a new flash chip here.Just use the CFI flash driver?
This first version of the board has a data byte swap hw issue. The 16bit data bus that connect the flash to the cpu is swapped. Linux has an option fo "forgive" this kind of issues:
Flash cmd/query data swapping (LITTLE_ENDIAN_BYTE)
So if there u-boot has a similar "byte-swap" sw option i can probably use std CFI driver, otherwise let me know if you can accept this specific flash driver.
Quoted 12 lines
Best regards,
Wolfgang Denk
Signature · 7 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de It's certainly convenient the way the crime (or condition) of stupidity carries with it its own punishment, automatically admisistered without remorse, pity, or prejudice. :-) -- Tom Christiansen in <[email protected]>
PATCH v3 2/2 amcore: add support for amcore board
In reply to Wolfgang DenkHi Wolfgang,
sorry but i have still a note here.
About
#define VALUE (0)
you said to fix it globally, without parens.
Working for the fixes i found several "accepted" files (i.e. m5282.h) full of
#define XYZ1 (1)
#define XYZ2 (2)
etc etc.
CodingStyle says parens around expressions must be used, but don't seems to set any rule for this case.
I know this is a detail, but i need to know the reason for the fix.
Best Regards
Angelo Dureghello
Quoted 176 lines · Wolfgang Denk
Dear angelo,
Quoted 9 lines · In message <20121104200021.GB5141@angel3> you wrote:
Add support for amcore board.
Signed-off-by Angelo Dureghello <[email protected]>Cc Jason Jin <[email protected]>---
Changes for v2:
- None
Changes for v3:
- Fix code format issuesQuoted 10 lines
--- board/sysam/amcore/Makefile | 43 ++++ board/sysam/amcore/amcore.c | 168 ++++++++++++++ board/sysam/amcore/config.mk | 23 ++ board/sysam/amcore/flash.c | 444 ++++++++++++++++++++++++++++++++++++ board/sysam/amcore/u-boot.lds | 101 ++++++++ boards.cfg | 1 + include/configs/amcore.h | 213 +++++++++++++++++ include/flash.h | 1 + 8 files changed, 994 insertions(+), 0 deletions(-)Entry to
MAINTAINERSmissing.Quoted 2 lines
board/sysam/amcore/amcore.c new file +0
-0...
board/sysam/amcore/amcore.c line 29
Quoted 7 lines
board/sysam/amcore/amcore.c new file +7
-0+#include <common.h> +#include <command.h> +#include <malloc.h> +#include <asm/immap.h> + + +int init_lcd (void )Only one blank line in places like that, please. Please fix globally.
Quoted 4 lines
board/sysam/amcore/amcore.c new file +4
-0+{ +/* +* board can have a K0108 lcd connected on the parallel port, +* wired as below: board/sysam/amcore/amcore.c line 43
Quoted 10 lines
board/sysam/amcore/amcore.c new file +10
-0+* +* fc cpu P0 P1 P2 P3 P4 P5 P6 P7 P10 P11 P12 P13 P14 +* lcd D0 D1 D2 D3 D4 D5 D6 D7 CS1 CS2 RW DI E +* +* Starting up setting lines in high impedance +*/ +mbar_writeShort (MCFSIM_PAR ,0x300 ); +mbar_writeShort (MCFSIM_PADDR ,0xfcff ); +mbar_writeShort (MCFSIM_PADAT ,0x0c00 ); +}Did you bother to compile your code? This is a function returning "int", but I don't see any return statement. I would expect to see compiler warnings here?
board/sysam/amcore/amcore.c
Quoted 2 lines
board/sysam/amcore/amcore.c new file +2
-0+phys_size_t initdram (int board_type) +{Please make sure to use
get_mem_size()!Quoted 1 line
+int testdram (void)
...
Quoted 1 line
+}
We have plenty of memory tests already. Chose one, but don't implement yet another one.
Quoted 1 line
board/sysam/amcore/config.mk +0
-0...
Quoted 1 line
+CONFIG_SYS_TEXT_BASE =
0xffc00000This should never be needed. Please move this to board congih file instead.
board/sysam/amcore/flash.c
Quoted 5 lines
board/sysam/amcore/flash.c new file +0
-0This looks like a standard CFI flash. Why cannot you use the standard CFI driver, then?
board/sysam/amcore/flash.c line 114
Quoted 4 lines
board/sysam/amcore/flash.c new file +4
-0+if (remainder) { + remainder >>=10 ; + remainder = (int )((float ) + (((float )remainder/(float )1024 )*10000 ));Also please note that we do not use any kind of FP operations in U-Boot. Please get rid of thise - fix globally, please.
Quoted 1 line
+void inline
spin_wheel(void)We don't use such stuff, either.
board/sysam/amcore/u-boot.lds
Quoted 5 lines
board/sysam/amcore/u-boot.lds new file +0
-0Why exactly do you need a board specific linker script?
Quoted 5 lines
include/configs/amcore.h new file +0
-0...
Quoted 1 line
+#define
CONFIG_SYS_UART_PORT(0)Please no parens around simple valies - p[lease fix globally.
Quoted 1 line
+#define
CONFIG_BOOTDELAY1 /* autoboot after 5 seconds */Comment and code disagree.
include/configs/amcore.h line 64
Quoted 2 lines
include/configs/amcore.h new file +2
-0+#undef CONFIG_WATCHDOG +#undef CONFIG_MONITOR_IS_IN_RAMPLease do not undefine what is not defiend anyway.
include/configs/amcore.h line 106
Quoted 5 lines
include/configs/amcore.h new file +5
-0+#define CONFIG_SYS_DEVICE_NULLDEV 1/* include nulldev device */ +#define CONFIG_SYS_CONSOLE_INFO_QUIET 1/* no console @ startup */ +#define CONFIG_AUTO_COMPLETE 1/* add autocompletion support */ +#define CONFIG_LOOPW 1/* enable loopw command */ +#define CONFIG_MX_CYCLIC 1/* enable mdc/mwc commands */ Please do not define values for any macros which are just tested for existence. Please fix globally.
Quoted 1 line
+#define
CONFIG_SYS_BOOTPARAMS_LEN64*1024Now macros like this do need parens!!
Quoted 5 lines
+/*
+ * For booting Linux, the board info and command line data
+ * have to be in the first 8 MB of memory, since this is
+ * the maximum mapped by the Linux kernel during initialization ??
+ */Is this really the case?
include/flash.h extern flash_info_t *flash_get_info(ulong base); · line 288
Quoted 12 lines
include/flash.h +1
-0@@ -282,6 +282,7 @@ extern flash_info_t *flash_get_info(ulong base);#define SST_ID_xF1601 0x234B234B/* 39xF1601 ID (16M = 1M x 16 ) */ #define SST_ID_xF1602 0x234A234A/* 39xF1602 ID (16M = 1M x 16 ) */ #define SST_ID_xF3201 0x235B235B/* 39xF3201 ID (32M = 2M x 16 ) */ +#define SST_ID_xF3201B 0x235D235D/* 39xF3201B ID (32M = 2M x 16 ) */ #define SST_ID_xF3202 0x235A235A/* 39xF3202 ID (32M = 2M x 16 ) */ #define SST_ID_xF6401 0x236B236B/* 39xF6401 ID (64M = 4M x 16 ) */ #define SST_ID_xF6402 0x236A236A/* 39xF6402 ID (64M = 4M x 16 ) */ Note - whenever you have to add anything to
include/flash.hyou should ask yourself what you are doing wrong.Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Roses are red Violets are blue Some poems rhyme
PATCH v3 2/2 amcore: add support for amcore board
Dear Angelo,
Quoted 4 lines · In message <20121105211017.GA24778@angel3> you wrote:
#define VALUE (0)
you said to fix it globally, without parens.
True.
Quoted 5 lines
Working for the fixes i found several "accepted" files (i.e.
m5282.h) full of#define XYZ1 (1)
#define XYZ2 (2)
You will find many examples of poor code. If you have time and resources, patches to clean up such are welcome.
In any case, we should not use such bad examples as excuse to add more bad code.
Quoted 2 lines
CodingStyle says parens around expressions must be used, but don't seems to set any rule for this case.
A simple value is not an expression that needs parens.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Sometimes a man will tell his bartender things he'll never tell his doctor.
-- Dr. Phillip Boyce, "The Menagerie" ("The Cage"),
stardate unknown.