[U-Boot] checkpatch compliance

Joe Hershberger joe.hershberger at gmail.com
Sat Oct 8 00:28:20 CEST 2011


Hi Wolfgang,

I'm attempting to make the files I touched in several recent
patch-series chechkpatch.pl compliant.

I've hit several cases which fail and probably shouldn't.  For each of
these cases, should the warning / error just be ignored or reported to
checkpatch maintainers or altered some other way?

ERROR: Macros with multiple statements should be enclosed in a do - while loop
+#define CONFIG_SYS_I2C_NOPROBES        { {0, 0x51} } /* Don't probe
these addrs */
Used like this:
static struct
{
        uchar   bus;
        uchar   addr;
} i2c_no_probes[] = CONFIG_SYS_I2C_NOPROBES;


ERROR: need consistent spacing around '/' (ctx:WxV)
+#define CONFIG_ROOTPATH                /nfs/root/path
Used like this:
#ifdef  CONFIG_ROOTPATH
        "rootpath="     MK_STR(CONFIG_ROOTPATH)         "\0"


ERROR: Macros with complex values should be enclosed in parenthesis
+#define CONFIG_ROOTPATH                /nfs/root/path


ERROR: Macros with complex values should be enclosed in parenthesis
+#define CONFIG_UBOOTPATH       u-boot.bin


ERROR: Macros with complex values should be enclosed in parenthesis
#218: FILE: include/configs/MPC8313ERDB.h:274:
+#define CONFIG_SYS_NAND_BR_PRELIM      (CONFIG_SYS_NAND_BASE \
                                | (2<<BR_DECC_SHIFT)    /* Use HW ECC */ \
-                               | BR_PS_8               /* Port Size =
8 bit */ \
+                               | BR_PS_8               /* 8 bit port */ \
                                | BR_MS_FCM             /* MSEL = FCM */ \
-                               | BR_V )                /* valid */
-#define CONFIG_SYS_NAND_OR_PRELIM      ( 0xFFFF8000            /*
length 32K */ \
+                               | BR_V)                 /* valid */


Thanks,
-Joe


More information about the U-Boot mailing list