On Thu, Nov 30, 2017 at 07:41:59AM -0600, Eric Blake wrote: > The point of writing a macro embedded in a 'do { ... } while (0)' > loop is so that the macro can be used as a drop-in statement with > the caller supplying the trailing ';'. Although our coding style > frowns on brace-less 'if': > if (cond) > statement; > else > something else; > the use of do/while (0) in a macro is absolutely essential for the > purpose of avoiding a syntax error on the 'else' - but it only works > if there is no trailing ';' in the macro (as the ';' in the code > calling the macro would then be a second statement and cause the > 'else' to not pair to the 'if'). > > Many of the places touched in this code are examples of the ugly > bit-rotting debug print statements; cleaning those up is left as > a bite-sized task for another day. > > Found mechanically via: $ git grep -B1 'while (0);' | grep -A1 \\\\ > > Signed-off-by: Eric Blake <ebl...@redhat.com>
ppc related portions Acked-by: David Gibson <da...@gibson.dropbear.id.au> -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature