freebsd-dev/sys/dev/ath
Dimitry Andric d41b89cca5 Fix the following -Werror warning from clang 3.5.0, while building the
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
2014-11-23 18:31:55 +00:00
..
ath_dfs/null
ath_hal Fix the following -Werror warning from clang 3.5.0, while building the 2014-11-23 18:31:55 +00:00
ath_rate
ah_osdep.c
ah_osdep.h
if_ath_ahb.c
if_ath_alq.c
if_ath_alq.h
if_ath_beacon.c Shut down RX before TX - in theory, this should make the chip less likely 2014-08-23 18:55:51 +00:00
if_ath_beacon.h
if_ath_btcoex.c
if_ath_btcoex.h
if_ath_debug.c
if_ath_debug.h
if_ath_keycache.c
if_ath_keycache.h
if_ath_led.c
if_ath_led.h
if_ath_lna_div.c Add initial support for the AR9485 CUS198 / CUS230 variants. 2014-09-30 03:19:29 +00:00
if_ath_lna_div.h
if_ath_misc.h
if_ath_pci_devlist.h Add a missing file from the last commit. 2014-09-30 05:50:34 +00:00
if_ath_pci.c Add initial support for the AR9485 CUS198 / CUS230 variants. 2014-09-30 03:19:29 +00:00
if_ath_rx_edma.c Fix up the EDMA RX setup path to correctly initialise and reset the RX FIFO. 2014-09-20 01:22:17 +00:00
if_ath_rx_edma.h
if_ath_rx.c Mechanically convert to if_inc_counter(). 2014-09-18 20:47:39 +00:00
if_ath_rx.h
if_ath_spectral.c
if_ath_spectral.h
if_ath_sysctl.c
if_ath_sysctl.h
if_ath_tdma.c
if_ath_tdma.h
if_ath_tsf.h
if_ath_tx_edma.c
if_ath_tx_edma.h
if_ath_tx_ht.c
if_ath_tx_ht.h
if_ath_tx.c Mechanically convert to if_inc_counter(). 2014-09-18 20:47:39 +00:00
if_ath_tx.h
if_ath.c Convert the callouts back to using mutexes. 2014-11-15 01:18:49 +00:00
if_athdfs.h
if_athioctl.h
if_athrate.h
if_athvar.h Add initial support for the AR9485 CUS198 / CUS230 variants. 2014-09-30 03:19:29 +00:00