diff options
author | eadler <eadler@FreeBSD.org> | 2014-02-04 03:36:42 +0000 |
---|---|---|
committer | eadler <eadler@FreeBSD.org> | 2014-02-04 03:36:42 +0000 |
commit | ec294fd7f5fc5de11ed889d6c2d701f918d1ecfb (patch) | |
tree | 7e76e370b9406b0383b17bd343084addb4ad6a25 /sys/dev/acpica | |
parent | d374d7f398b846dc59d8a5ec3c7bfb318cf880af (diff) | |
download | FreeBSD-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/acpica')
-rw-r--r-- | sys/dev/acpica/acpi_video.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/acpica/acpi_video.c b/sys/dev/acpica/acpi_video.c index cda45db..5b9e526 100644 --- a/sys/dev/acpica/acpi_video.c +++ b/sys/dev/acpica/acpi_video.c @@ -132,7 +132,7 @@ static void vo_set_device_state(ACPI_HANDLE, UINT32); #define DOD_HEAD_ID_BITS 3 #define DOD_HEAD_ID_MASK \ (((1 << DOD_HEAD_ID_BITS) - 1) << DOD_HEAD_ID_SHIFT) -#define DOD_DEVID_SCHEME_STD (1 << 31) +#define DOD_DEVID_SCHEME_STD (1U << 31) /* _BCL related constants */ #define BCL_FULLPOWER 0 @@ -149,7 +149,7 @@ static void vo_set_device_state(ACPI_HANDLE, UINT32); #define DSS_INACTIVE 0 #define DSS_ACTIVE (1 << 0) #define DSS_SETNEXT (1 << 30) -#define DSS_COMMIT (1 << 31) +#define DSS_COMMIT (1U << 31) static device_method_t acpi_video_methods[] = { DEVMETHOD(device_identify, acpi_video_identify), |