[Intel-gfx] [PATCH 1/2] drm/i915: Encapsulate kconfig constant values inside boolean predicates

Nathan Chancellor natechancellor at gmail.com
Sat Oct 26 04:06:52 UTC 2019


On Fri, Oct 25, 2019 at 02:59:42PM +0100, Chris Wilson wrote:
> Avoid angering clang and smatch by using a constant value in a '&&' test,
> by forcing that constant value into a boolean.
> 
> E.g.,
> drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c:159:13: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]
> 	if (!delay && CONFIG_DRM_I915_PREEMPT_TIMEOUT) {
>                       ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Reported-by: kbuild test robot <lkp at intel.com>
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Nathan Chancellor <natechancellor at gmail.com>
> Cc: Nick Desaulniers <ndesaulniers at google.com>
> Cc: Jani Nikula <jani.nikula at intel.com>

LGTM, thank you for the fix!

Reviewed-by: Nathan Chancellor <natechancellor at gmail.com>


More information about the Intel-gfx mailing list