summaryrefslogtreecommitdiffstats
path: root/sys/dev/drm/via_irq.c
diff options
context:
space:
mode:
authoreadler <eadler@FreeBSD.org>2013-11-30 22:17:27 +0000
committereadler <eadler@FreeBSD.org>2013-11-30 22:17:27 +0000
commit44c01df17391f4429ee371e8039ae4fd802c2a8e (patch)
tree050fb3b68519f6ef7d59051550fa29cdd79d6dac /sys/dev/drm/via_irq.c
parent5bcb8c5f4293579e5f8aba6f33f85246b7b70e5d (diff)
downloadFreeBSD-src-44c01df17391f4429ee371e8039ae4fd802c2a8e.zip
FreeBSD-src-44c01df17391f4429ee371e8039ae4fd802c2a8e.tar.gz
Fix undefined behavior: (1 << 31) is not defined as 1 is an int and this
shifts into the sign bit. Instead use (1U << 31) which gets the expected result. This fix is not ideal as it assumes a 32 bit int, but does fix the issue for most cases. A similar change was made in OpenBSD. Discussed with: -arch, rdivacky Reviewed by: cperciva
Diffstat (limited to 'sys/dev/drm/via_irq.c')
-rw-r--r--sys/dev/drm/via_irq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/drm/via_irq.c b/sys/dev/drm/via_irq.c
index 20ec77a..0ebda40 100644
--- a/sys/dev/drm/via_irq.c
+++ b/sys/dev/drm/via_irq.c
@@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$");
#define VIA_REG_INTERRUPT 0x200
/* VIA_REG_INTERRUPT */
-#define VIA_IRQ_GLOBAL (1 << 31)
+#define VIA_IRQ_GLOBAL (1U << 31)
#define VIA_IRQ_VBLANK_ENABLE (1 << 19)
#define VIA_IRQ_VBLANK_PENDING (1 << 3)
#define VIA_IRQ_HQV0_ENABLE (1 << 11)
OpenPOWER on IntegriCloud