[coreboot-gerrit] Patch merged into coreboot/master: src/include: Add do { } while(0) around macros

gerrit at coreboot.org gerrit at coreboot.org
Thu Mar 9 17:18:06 CET 2017


the following patch was just integrated into master:
commit bb4ae07417c9b3be1af500a62514a2d42467cfb0
Author: Lee Leahy <leroy.p.leahy at intel.com>
Date:   Tue Mar 7 12:01:02 2017 -0800

    src/include: Add do { } while(0) around macros
    
    Fix the following error detected by checkpatch.py:
    
    ERROR: Macros with multiple statements should be enclosed in a do - while loop
    
    False positives are generated when assembly code is used in a macro.  An
    example is:
    
    ERROR: Macros with multiple statements should be enclosed in a do - while loop
    +#define post_code(value)        \
    +	movb    $value, %al;    \
    +	outb    %al, $CONFIG_POST_IO_PORT
    
    False positives are also generated for linker script include files.  An
    example is:
    
    ERROR: Macros with multiple statements should be enclosed in a do - while loop
    +#define SET_COUNTER(name, addr) \
    +	_ = ASSERT(. <= addr, STR(name overlaps the previous region!));
    \
    +	. = addr;
    
    False positives are also generated for attribute macros.  An example is:
    
    ERROR: Macros with multiple statements should be enclosed in a do - while loop
    +#define DISABLE_TRACE_ON_FUNCTION  __attribute__
    ((no_instrument_function));
    
    TEST=Build and run on Galileo Gen2
    
    Change-Id: I88abf96579e906f6962d558a3d09907f07d00b1c
    Signed-off-by: Lee Leahy <Leroy.P.Leahy at intel.com>
    Reviewed-on: https://review.coreboot.org/18644
    Tested-by: build bot (Jenkins)
    Reviewed-by: Martin Roth <martinroth at google.com>


See https://review.coreboot.org/18644 for details.

-gerrit



More information about the coreboot-gerrit mailing list