linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Disable -Wtautological-constant-out-of-range-compare
@ 2020-02-11  5:08 Nathan Chancellor
  2020-02-11  6:13 ` [PATCH v2] " Nathan Chancellor
  0 siblings, 1 reply; 12+ messages in thread
From: Nathan Chancellor @ 2020-02-11  5:08 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi
  Cc: intel-gfx, dri-devel, linux-kernel, clang-built-linux, Nathan Chancellor

A recent commit in clang added -Wtautological-compare to -Wall, which is
enabled for i915 so we see the following warning:

../drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1485:22: warning:
result of comparison of constant 576460752303423487 with expression of
type 'unsigned int' is always false
[-Wtautological-constant-out-of-range-compare]
        if (unlikely(remain > N_RELOC(ULONG_MAX)))
            ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~

This warning only happens on x86_64 but that check is relevant for
32-bit x86 so we cannot remove it. -Wtautological-compare on a whole has
good warnings but this one is not really relevant for the kernel because
of all of the different configurations that are used to build the
kernel. When -Wtautological-compare is enabled for the kernel, this
option will remain disabled so do that for i915 now.

Link: https://github.com/ClangBuiltLinux/linux/issues/778
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
 drivers/gpu/drm/i915/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index 38df01c23176..55dbcca179c7 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -21,6 +21,7 @@ subdir-ccflags-y += $(call cc-disable-warning, unused-but-set-variable)
 subdir-ccflags-y += $(call cc-disable-warning, sign-compare)
 subdir-ccflags-y += $(call cc-disable-warning, sometimes-uninitialized)
 subdir-ccflags-y += $(call cc-disable-warning, initializer-overrides)
+subdir-ccflags-y += $(call cc-disable-warning, tautological-constant-out-of-range-compare)
 subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror
 
 # Fine grained warnings disable
-- 
2.25.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-02-13 23:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-11  5:08 [PATCH] drm/i915: Disable -Wtautological-constant-out-of-range-compare Nathan Chancellor
2020-02-11  6:13 ` [PATCH v2] " Nathan Chancellor
2020-02-11  9:41   ` Michel Dänzer
2020-02-11 20:39     ` Nathan Chancellor
2020-02-12  8:52       ` Michel Dänzer
2020-02-12 17:07         ` Nathan Chancellor
2020-02-12 17:17           ` Michel Dänzer
2020-02-13 14:37             ` [Intel-gfx] " Jani Nikula
2020-02-13 21:48               ` Nathan Chancellor
2020-02-13 22:05                 ` Jani Nikula
2020-02-13 22:43             ` Nick Desaulniers
2020-02-13 23:27               ` Nathan Chancellor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).