From ec294fd7f5fc5de11ed889d6c2d701f918d1ecfb Mon Sep 17 00:00:00 2001 From: eadler Date: Tue, 4 Feb 2014 03:36:42 +0000 Subject: 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. --- sys/dev/aac/aacvar.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/dev/aac') diff --git a/sys/dev/aac/aacvar.h b/sys/dev/aac/aacvar.h index 0950a2f..bcedff5 100644 --- a/sys/dev/aac/aacvar.h +++ b/sys/dev/aac/aacvar.h @@ -412,7 +412,7 @@ struct aac_softc #define AAC_FLAGS_RAW_IO (1 << 12) /* Raw I/O interface */ #define AAC_FLAGS_ARRAY_64BIT (1 << 13) /* 64-bit array size */ #define AAC_FLAGS_LBA_64BIT (1 << 14) /* 64-bit LBA support */ -#define AAC_FLAGS_NOMSI (1 << 31) /* Broken MSI */ +#define AAC_FLAGS_NOMSI (1U << 31) /* Broken MSI */ u_int32_t supported_options; u_int32_t scsi_method_id; -- cgit v1.1