Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm/i915 Remove UB from definitio...



details:   https://anonhg.NetBSD.org/src/rev/1359d9c3ea75
branches:  trunk
changeset: 323897:1359d9c3ea75
user:      kamil <kamil%NetBSD.org@localhost>
date:      Fri Jul 06 12:19:56 2018 +0000

description:
Remove UB from definition of symbols in i915_reg.h

Kernel Undefined Behavior Sanitizer enforces more warnings in build time.
This makes the build fatal in the drm/i915 code in:
 - intel_ddi_put_crtc_pll(),
 - intel_ddi_clock_get(),
 - intel_ddi_pll_enable(),
 - intel_ddi_setup_hw_pll_state().

The error message in all the cases says:

  error: case label does not reduce to an integer constant

Set the type of the value left shifted to unsigned.

This change is required to build NetBSD/amd64 with KUBSan.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/i915_reg.h |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (18 lines):

diff -r c8303860cd2c -r 1359d9c3ea75 sys/external/bsd/drm2/dist/drm/i915/i915_reg.h
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_reg.h    Fri Jul 06 08:54:30 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_reg.h    Fri Jul 06 12:19:56 2018 +0000
@@ -5426,10 +5426,10 @@
 #define  PORT_CLK_SEL_LCPLL_1350       (1<<29)
 #define  PORT_CLK_SEL_LCPLL_810                (2<<29)
 #define  PORT_CLK_SEL_SPLL             (3<<29)
-#define  PORT_CLK_SEL_WRPLL1           (4<<29)
-#define  PORT_CLK_SEL_WRPLL2           (5<<29)
-#define  PORT_CLK_SEL_NONE             (7<<29)
-#define  PORT_CLK_SEL_MASK             (7<<29)
+#define  PORT_CLK_SEL_WRPLL1           (4U<<29)
+#define  PORT_CLK_SEL_WRPLL2           (5U<<29)
+#define  PORT_CLK_SEL_NONE             (7U<<29)
+#define  PORT_CLK_SEL_MASK             (7U<<29)
 
 /* Transcoder clock selection */
 #define TRANS_CLK_SEL_A                        0x46140



Home | Main Index | Thread Index | Old Index