summaryrefslogtreecommitdiff
path: root/lib/i915
diff options
context:
space:
mode:
authorPetri Latvala <petri.latvala@intel.com>2019-01-21 13:33:38 +0200
committerPetri Latvala <petri.latvala@intel.com>2019-01-21 13:49:11 +0200
commit5b4485f55b0336e2b39e30b6bb187c41b63b52f5 (patch)
tree126262b32289f0e329ff517f107b90431dbe728e /lib/i915
parentd4199510374514489b1ab56e3416f53f6c1d6291 (diff)
lib: Introduce BUILD_BUG_ON_INVALID and igt_assume()
BUILD_BUG_ON_INVALID() is a macro that, like the kernel counterpart, expands to an expression that generates no code. Useful for making sure an expression is valid code while producing no side effects. igt_assume() is an assert-like macro that is used to give hints to static analysis of code. If static analysis is not used (as detected by STATIC_ANALYSIS_BUILD), igt_assume() expands to a BUILD_BUG_ON_INVALID, otherwise expands to an assert(). v2: Make sure the expression in igt_assume is still parsed without static analysis. (Chris) v3: Also introduce BUILD_BUG_ON_INVALID as standalone Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: MichaƂ Winiarski <michal.winiarski@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/i915')
0 files changed, 0 insertions, 0 deletions