]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Explicitly convert some macros to boolean values
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Mon, 4 Jul 2016 14:50:23 +0000 (15:50 +0100)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Mon, 4 Jul 2016 15:38:04 +0000 (16:38 +0100)
commit75dbd4d1f7728052b9e2aea1e45dffe8ab7c92f8
treed00f3d3b6e9f7ae9c734030e703856f55bec8339
parent6531a2055fcd2fd4d871d4ef9912e86dab013290
drm/i915: Explicitly convert some macros to boolean values

Some IS_ and HAS_ macros can return any non-zero value for true.

One potential problem with that is that someone could assign
them to integers and be surprised with the result. Therefore it
is probably safer to do the conversion to 0/1 in the macros
themselves.

Luckily this does not seem to have an effect on code size.

Only one call site was getting bit by this and a patch for
that has been sent as "drm/i915/guc: Protect against HAS_GUC_*
returning true values other than one".

v2: Added some extra braces as suggested by checkpatch.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/1467643823-9798-1-git-send-email-tvrtko.ursulin@linux.intel.com
drivers/gpu/drm/i915/i915_drv.h