diff options
author | Eitan Adler <eadler@FreeBSD.org> | 2013-11-30 22:17:27 +0000 |
---|---|---|
committer | Eitan Adler <eadler@FreeBSD.org> | 2013-11-30 22:17:27 +0000 |
commit | 7a22215c5346c9009d1dfa4d3c118ff99f89d184 (patch) | |
tree | 050fb3b68519f6ef7d59051550fa29cdd79d6dac /sys/dev/hatm/if_hatmreg.h | |
parent | c8aef31d309ac3f874c461619248fee9c1d74c2f (diff) | |
download | src-7a22215c5346c9009d1dfa4d3c118ff99f89d184.tar.gz src-7a22215c5346c9009d1dfa4d3c118ff99f89d184.zip |
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
Notes
Notes:
svn path=/head/; revision=258780
Diffstat (limited to 'sys/dev/hatm/if_hatmreg.h')
-rw-r--r-- | sys/dev/hatm/if_hatmreg.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/hatm/if_hatmreg.h b/sys/dev/hatm/if_hatmreg.h index dd72126b456b..401499870d01 100644 --- a/sys/dev/hatm/if_hatmreg.h +++ b/sys/dev/hatm/if_hatmreg.h @@ -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) /* |