Source-Changes-HG archive

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

[src/netbsd-7]: src/sys/external/bsd/drm2/dist/drm/i915 Pull up following rev...



details:   https://anonhg.NetBSD.org/src/rev/9ddac4389351
branches:  netbsd-7
changeset: 799880:9ddac4389351
user:      snj <snj%NetBSD.org@localhost>
date:      Fri Apr 15 08:02:34 2016 +0000

description:
Pull up following revision(s) (requested by riastradh in ticket #1156):
        sys/external/bsd/drm2/dist/drm/i915/intel_pm.c: revision 1.9
Cast uint8_t to uint32_t before shifting left by 24.
Otherwise this is undefined behaviour unless int is 32-bit and the
uint8_t value happens to be <=127.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/intel_pm.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (14 lines):

diff -r 57a5fdf0ac14 -r 9ddac4389351 sys/external/bsd/drm2/dist/drm/i915/intel_pm.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_pm.c    Fri Apr 15 07:52:15 2016 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_pm.c    Fri Apr 15 08:02:34 2016 +0000
@@ -4487,8 +4487,8 @@
        pxw[15] = 0;
 
        for (i = 0; i < 4; i++) {
-               u32 val = (pxw[i*4] << 24) | (pxw[(i*4)+1] << 16) |
-                       (pxw[(i*4)+2] << 8) | (pxw[(i*4)+3]);
+               u32 val = ((u32)pxw[i*4] << 24) | ((u32)pxw[(i*4)+1] << 16) |
+                       ((u32)pxw[(i*4)+2] << 8) | ((u32)pxw[(i*4)+3]);
                I915_WRITE(PXW + (i * 4), val);
        }
 



Home | Main Index | Thread Index | Old Index