diff options
author | dim <dim@FreeBSD.org> | 2011-12-21 17:16:43 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-12-21 17:16:43 +0000 |
commit | c15a655c3d924b322516e1a5eab7da6ab7fec91e (patch) | |
tree | 699d61591484a9721d71db8fe413f8156fcb9f53 /lib/libarchive/archive_string_sprintf.c | |
parent | c2dfd4451c331c3e687830de21030c8793557162 (diff) | |
download | FreeBSD-src-c15a655c3d924b322516e1a5eab7da6ab7fec91e.zip FreeBSD-src-c15a655c3d924b322516e1a5eab7da6ab7fec91e.tar.gz |
Fix shift overflow problem in sys/dev/ath/ath_hal/ar5210/ar5210_power.c
and sys/dev/ath/ath_hal/ar5211/ar5211_power.c:
sys/dev/ath/ath_hal/ar5210/ar5210_power.c:36:3: warning: signed shift result (0x200000000) requires 35 bits to represent, but 'int' only has 32 bits [-Wshift-overflow]
OS_REG_RMW_FIELD(ah, AR_SCR, AR_SCR_SLE, AR_SCR_SLE_ALLOW);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sys/dev/ath/ath_hal/ah_internal.h:472:42: note: expanded from:
(OS_REG_READ(_a, _r) &~ (_f)) | (((_v) << _f##_S) & (_f)))
^
sys/dev/ath/ah_osdep.h:127:49: note: expanded from:
(bus_space_handle_t)(_ah)->ah_sh, (_reg), (_val))
^~~~
The AR_SCR_SLE_{WAKE,SLP,NORM} values are pre-shifted in ar5210reg.h and
ar5211reg.h, while they should be unshifted, like in ar5212reg.h. Then,
when the OS_REG_RMW_FIELD() macro shifts them again, the values will
overflow, becoming effectively zero.
MFC after: 1 week
Diffstat (limited to 'lib/libarchive/archive_string_sprintf.c')
0 files changed, 0 insertions, 0 deletions