summaryrefslogtreecommitdiffstats
path: root/sys/dev/drm/r300_reg.h
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/r300_reg.h
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/r300_reg.h')
-rw-r--r--sys/dev/drm/r300_reg.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/drm/r300_reg.h b/sys/dev/drm/r300_reg.h
index 6df4611..0508771 100644
--- a/sys/dev/drm/r300_reg.h
+++ b/sys/dev/drm/r300_reg.h
@@ -1205,7 +1205,7 @@ __FBSDID("$FreeBSD$");
# define R300_FPI0_OUTC_FRC (9 << 23)
# define R300_FPI0_OUTC_REPL_ALPHA (10 << 23)
# define R300_FPI0_OUTC_SAT (1 << 30)
-# define R300_FPI0_INSERT_NOP (1 << 31)
+# define R300_FPI0_INSERT_NOP (1U << 31)
#define R300_PFS_INSTR2_0 0x49C0
# define R300_FPI2_ARGA_SRC0C_X 0
@@ -1252,7 +1252,7 @@ __FBSDID("$FreeBSD$");
# define R300_FPI2_OUTA_RCP (10 << 23)
# define R300_FPI2_OUTA_RSQ (11 << 23)
# define R300_FPI2_OUTA_SAT (1 << 30)
-# define R300_FPI2_UNKNOWN_31 (1 << 31)
+# define R300_FPI2_UNKNOWN_31 (1U << 31)
/* END: Fragment program instruction set */
/* Fog state and color */
@@ -1452,7 +1452,7 @@ __FBSDID("$FreeBSD$");
# define R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_NO_EFFECT (0 << 1)
# define R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_FREE (1 << 1)
# define R300_ZB_ZCACHE_CTLSTAT_ZC_BUSY_IDLE (0 << 31)
-# define R300_ZB_ZCACHE_CTLSTAT_ZC_BUSY_BUSY (1 << 31)
+# define R300_ZB_ZCACHE_CTLSTAT_ZC_BUSY_BUSY (1U << 31)
#define R300_ZB_BW_CNTL 0x4f1c
# define R300_HIZ_DISABLE (0 << 0)
OpenPOWER on IntegriCloud