summaryrefslogtreecommitdiffstats
path: root/sys/dev/hatm
diff options
context:
space:
mode:
authoreadler <eadler@FreeBSD.org>2014-02-04 03:36:42 +0000
committereadler <eadler@FreeBSD.org>2014-02-04 03:36:42 +0000
commitec294fd7f5fc5de11ed889d6c2d701f918d1ecfb (patch)
tree7e76e370b9406b0383b17bd343084addb4ad6a25 /sys/dev/hatm
parentd374d7f398b846dc59d8a5ec3c7bfb318cf880af (diff)
downloadFreeBSD-src-ec294fd7f5fc5de11ed889d6c2d701f918d1ecfb.zip
FreeBSD-src-ec294fd7f5fc5de11ed889d6c2d701f918d1ecfb.tar.gz
MFC r258779,r258780,r258787,r258822:
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. Similar to the (1 << 31) case it is not defined to do (2 << 30). 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.
Diffstat (limited to 'sys/dev/hatm')
-rw-r--r--sys/dev/hatm/if_hatmreg.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/hatm/if_hatmreg.h b/sys/dev/hatm/if_hatmreg.h
index 9085f07..4014998 100644
--- a/sys/dev/hatm/if_hatmreg.h
+++ b/sys/dev/hatm/if_hatmreg.h
@@ -294,7 +294,7 @@
#define HE_REGO_CON_DAT 0x807F8
#define HE_REGO_CON_CTL 0x807FC
-#define HE_REGM_CON_MBOX (2 << 30)
+#define HE_REGM_CON_MBOX (2U << 30)
#define HE_REGM_CON_TCM (1 << 30)
#define HE_REGM_CON_RCM (0 << 30)
#define HE_REGM_CON_WE (1 << 29)
@@ -444,7 +444,7 @@
#define HE_REGM_TSR3_CRM (0xff << 0)
#define HE_REGS_TSR3_CRM 0
-#define HE_REGM_TSR4_FLUSH (1 << 31)
+#define HE_REGM_TSR4_FLUSH (1U << 31)
#define HE_REGM_TSR4_SESS_END (1 << 30)
#define HE_REGM_TSR4_OAM_CRC10 (1 << 28)
#define HE_REGM_TSR4_NULL_CRC10 (1 << 27)
@@ -475,7 +475,7 @@
#define HE_REGM_TSR13_CRM 0xffff
#define HE_REGS_TSR13_CRM 0
-#define HE_REGM_TSR14_CBR_DELETE (1 << 31)
+#define HE_REGM_TSR14_CBR_DELETE (1U << 31)
#define HE_REGM_TSR14_ABR_CLOSE (1 << 16)
/*
OpenPOWER on IntegriCloud