opnsense-src/sys/dev/ath/ath_hal/ar5212
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
..
ar2316.c Overhaul regulatory support: 2009-01-28 18:00:22 +00:00
ar2317.c Overhaul regulatory support: 2009-01-28 18:00:22 +00:00
ar2413.c Overhaul regulatory support: 2009-01-28 18:00:22 +00:00
ar2425.c Add PCIE power control api: 2009-02-24 01:07:06 +00:00
ar5111.c Overhaul regulatory support: 2009-01-28 18:00:22 +00:00
ar5112.c Fix a corner case in the HAL debugging changes, where ah was NULL. 2011-09-30 05:17:57 +00:00
ar5212.h Migrate the chip power mode status to public ath_hal, rather than the 2014-03-10 06:03:35 +00:00
ar5212.ini Replace Id keyword with FreeBSD keyword and set the svn props correctly. 2010-03-03 17:32:32 +00:00
ar5212_ani.c Add channel survey support to the AR5212 HAL. 2013-10-08 11:28:59 +00:00
ar5212_attach.c Add initial support for the AR9485 CUS198 / CUS230 variants. 2014-09-30 03:19:29 +00:00
ar5212_beacon.c When programming the beacon timer configuration, be very explicit about 2012-11-27 02:18:41 +00:00
ar5212_eeprom.c Replace Id keyword with FreeBSD keyword and set the svn props correctly. 2010-03-03 17:32:32 +00:00
ar5212_gpio.c 5416 and later parts mux the gpio outputs; extend the api to include 2009-02-24 00:12:16 +00:00
ar5212_interrupts.c Remove extraneous semicolons, no functional changes. 2010-01-07 21:01:37 +00:00
ar5212_keycache.c Fix the keycache behaviour for multicast keycache search. 2011-02-09 15:23:16 +00:00
ar5212_misc.c Add channel survey support to the AR5212 HAL. 2013-10-08 11:28:59 +00:00
ar5212_phy.c o eliminate a << in calculating the tx time for turbo mode by pre-multiplying 2009-04-13 21:01:08 +00:00
ar5212_power.c * Only update ah_powerMode if we're setting the chip sleep state. 2014-04-30 02:03:13 +00:00
ar5212_recv.c .. include ah_desc.h here now. 2012-11-17 02:02:36 +00:00
ar5212_reset.c Fix the following -Werror warning from clang 3.5.0, while building the 2014-11-23 18:31:55 +00:00
ar5212_rfgain.c eliminate gainFCorrection; just have ar5212GetGainFCorrection return 2009-02-05 21:13:31 +00:00
ar5212_xmit.c .. include ah_desc.h here now. 2012-11-17 02:02:36 +00:00
ar5212desc.h Remove the ah_desc.h reference; it's not needed. 2012-11-17 02:00:33 +00:00
ar5212phy.h Add AR5413 radar parameters and strong signal diversity capability. 2012-08-29 03:58:13 +00:00
ar5212reg.h Port over some missing code from the ar5212 reference driver reset path. 2011-10-18 03:17:06 +00:00
ar5311reg.h Replace Id keyword with FreeBSD keyword and set the svn props correctly. 2010-03-03 17:32:32 +00:00
ar5413.c Add PCIE power control api: 2009-02-24 01:07:06 +00:00