mirror of
https://github.com/opnsense/src.git
synced 2026-04-04 00:45:17 -04:00
ath kernel module:
sys/dev/ath/ath_hal/ar5212/ar5212_reset.c:2642:7: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
if (abs(lp[0] * EEP_SCALE - target) < EEP_DELTA) {
^
sys/dev/ath/ah_osdep.h:74:18: note: expanded from macro 'abs'
#define abs(_a) __builtin_abs(_a)
^
sys/dev/ath/ath_hal/ar5212/ar5212_reset.c:2642:7: note: remove the call to '__builtin_abs' since unsigned values cannot be negative
sys/dev/ath/ah_osdep.h:74:18: note: expanded from macro 'abs'
#define abs(_a) __builtin_abs(_a)
^
1 error generated.
This warning occurs because both lp[0] and target are unsigned, so the
subtraction expression is also unsigned, and calling abs() is a no-op.
However, the intention was to look at the absolute difference between
the two unsigned quantities. Introduce a small static function to
clarify what we're doing, and call that instead.
Reviewed by: adrian
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D1212
|
||
|---|---|---|
| .. | ||
| ar2316.c | ||
| ar2317.c | ||
| ar2413.c | ||
| ar2425.c | ||
| ar5111.c | ||
| ar5112.c | ||
| ar5212.h | ||
| ar5212.ini | ||
| ar5212_ani.c | ||
| ar5212_attach.c | ||
| ar5212_beacon.c | ||
| ar5212_eeprom.c | ||
| ar5212_gpio.c | ||
| ar5212_interrupts.c | ||
| ar5212_keycache.c | ||
| ar5212_misc.c | ||
| ar5212_phy.c | ||
| ar5212_power.c | ||
| ar5212_recv.c | ||
| ar5212_reset.c | ||
| ar5212_rfgain.c | ||
| ar5212_xmit.c | ||
| ar5212desc.h | ||
| ar5212phy.h | ||
| ar5212reg.h | ||
| ar5311reg.h | ||
| ar5413.c | ||