]> git.proxmox.com Git - mirror_spl.git/commit
Safer debugging and assertion macros.
authorTim Chase <tim@chase2k.com>
Wed, 18 Jun 2014 20:22:50 +0000 (15:22 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 1 Jul 2014 22:14:43 +0000 (15:14 -0700)
commitf6a869614e5bdf9a3819a845f7a90d8c9ede0fc3
tree654e11a1b882e9f8346f3398215e0285fb3c74b5
parent31cb5383bff0fddc5058973e32a6f2c446d45e59
Safer debugging and assertion macros.

Spl's debugging and assertion macros macro used the typical do/while(0)
form for if/else friendliness, however, this limits their use in contexts
where a do loop is not valid; such as within another multi-statement
style macro.

The following macros have been converted to not use do/while(0):
PANIC, ASSERT, ASSERTF, VERIFY, VERIFY3_IMPL

PANIC has been converted to a wrapper around the new spl_PANIC() function.

The other macros have been converted to use the "&&" operator for the
branch-predicition conditional and also to use spl_PANIC().

The __ASSERT() macro was not touched.  It is only used by the debugging
infrastructure and that code, including this macro, will be retired when
the tracepoint patches are merged.

Signed-off-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #367
include/sys/debug.h
module/spl/spl-err.c