src/include: Add parenthesis around macros
Fix the following error found by checkpatch.pl:
ERROR: Macros with complex values should be enclosed in parentheses
False positives are detected for attribute macros. An example is:
ERROR: Macros with complex values should be enclosed in parentheses
+#define BOOT_STATE_INIT_ATTR __attribute__ ((used, section
(".bs_init")))
False positive also generated for macros for linker script files. An
example is:
ERROR: Macros with complex values should be enclosed in parentheses
+#define CBFS_CACHE(addr, size) \
+ REGION(cbfs_cache, addr, size, 4) \
+ ALIAS_REGION(cbfs_cache, preram_cbfs_cache) \
+ ALIAS_REGION(cbfs_cache, postram_cbfs_cache)
False positives generated for assembly code macros. An example is:
ERROR: Macros with complex values should be enclosed in parentheses
+#define DECLARE_OPTIONAL_REGION(name) asm (".weak _" #name ", _e" #name
)
False positive detected when macro includes multiple comma separated
values. The following code is from src/include/device/azalia_device.h:
#define AZALIA_SUBVENDOR(codec, val) \
(((codec) << 28) | (0x01720 << 8) | ((val) & 0xff)), \
(((codec) << 28) | (0x01721 << 8) | (((val) >> 8) & 0xff)), \
(((codec) << 28) | (0x01722 << 8) | (((val) >> 16) & 0xff)), \
(((codec) << 28) | (0x01723 << 8) | (((val) >> 24) & 0xff))
TEST=Build and run on Galileo Gen2
Change-Id: I6e3b6950738e6906851a172ba3a22e3d5af1e35d
Signed-off-by: Lee Leahy <Leroy.P.Leahy@intel.com>
Reviewed-on: https://review.coreboot.org/18649
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
86f60a9c8f
commit
f00e446e74
10 changed files with 26 additions and 26 deletions
|
|
@ -21,11 +21,11 @@
|
|||
void cbmemc_init(void);
|
||||
void cbmemc_tx_byte(unsigned char data);
|
||||
|
||||
#define __CBMEM_CONSOLE_ENABLE__ CONFIG_CONSOLE_CBMEM && \
|
||||
#define __CBMEM_CONSOLE_ENABLE__ (CONFIG_CONSOLE_CBMEM && \
|
||||
(ENV_RAMSTAGE || ENV_VERSTAGE || ENV_POSTCAR || \
|
||||
(IS_ENABLED(CONFIG_EARLY_CBMEM_INIT) && \
|
||||
(ENV_ROMSTAGE || (ENV_BOOTBLOCK && CONFIG_BOOTBLOCK_CONSOLE)))\
|
||||
)
|
||||
))
|
||||
|
||||
#if __CBMEM_CONSOLE_ENABLE__
|
||||
static inline void __cbmemc_init(void) { cbmemc_init(); }
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@
|
|||
void spiconsole_init(void);
|
||||
void spiconsole_tx_byte(unsigned char c);
|
||||
|
||||
#define __CONSOLE_SPI_ENABLE__ CONFIG_SPI_CONSOLE && \
|
||||
(ENV_RAMSTAGE || (ENV_SMM && CONFIG_DEBUG_SMI))
|
||||
#define __CONSOLE_SPI_ENABLE__ (CONFIG_SPI_CONSOLE && \
|
||||
(ENV_RAMSTAGE || (ENV_SMM && CONFIG_DEBUG_SMI)))
|
||||
|
||||
#if __CONSOLE_SPI_ENABLE__
|
||||
static inline void __spiconsole_init(void) { spiconsole_init(); }
|
||||
|
|
|
|||
|
|
@ -55,9 +55,9 @@ static inline void *uart_platform_baseptr(int idx)
|
|||
|
||||
void oxford_remap(unsigned int new_base);
|
||||
|
||||
#define __CONSOLE_SERIAL_ENABLE__ CONFIG_CONSOLE_SERIAL && \
|
||||
#define __CONSOLE_SERIAL_ENABLE__ (CONFIG_CONSOLE_SERIAL && \
|
||||
(ENV_BOOTBLOCK || ENV_ROMSTAGE || ENV_RAMSTAGE || ENV_VERSTAGE || \
|
||||
ENV_POSTCAR || (ENV_SMM && CONFIG_DEBUG_SMI))
|
||||
ENV_POSTCAR || (ENV_SMM && CONFIG_DEBUG_SMI)))
|
||||
|
||||
#if __CONSOLE_SERIAL_ENABLE__
|
||||
static inline void __uart_init(void) { uart_init(CONFIG_UART_FOR_CONSOLE); }
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ void usb_tx_flush(int idx);
|
|||
unsigned char usb_rx_byte(int idx);
|
||||
int usb_can_rx_byte(int idx);
|
||||
|
||||
#define __CONSOLE_USB_ENABLE__ CONFIG_CONSOLE_USB && \
|
||||
((ENV_ROMSTAGE && CONFIG_USBDEBUG_IN_ROMSTAGE) || ENV_RAMSTAGE)
|
||||
#define __CONSOLE_USB_ENABLE__ (CONFIG_CONSOLE_USB && \
|
||||
((ENV_ROMSTAGE && CONFIG_USBDEBUG_IN_ROMSTAGE) || ENV_RAMSTAGE))
|
||||
|
||||
#define USB_PIPE_FOR_CONSOLE 0
|
||||
#define USB_PIPE_FOR_GDB 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue