HomeFreeBSD

spl: cmn_err_once() should be usable in brace-less if else statements

Description

spl: cmn_err_once() should be usable in brace-less if else statements

Commit 11913870 (#14567) added cmn_err_once() by #define'ing a
compound statement but failed to consider usage in a single
statement brace-less if else.

Fix the problem by using the common "do {} while (0)" construct.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Attila Fülöp <attila@fueloep.org>
Closes #14629

Details

Provenance
Attila Fülöp <attila@fueloep.org>Authored on Mar 15 2023, 6:13 PM
GitHub <noreply@github.com>Committed on Mar 15 2023, 6:13 PM
Parents
rGc31bb934cd30: Fix building for powerpc* targets with some compilers
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rG5f3611121dd8: spl: cmn_err_once() should be usable in brace-less if else statements (authored by Attila Fülöp <attila@fueloep.org>).Mar 15 2023, 6:13 PM