diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-07-01 22:09:51 (GMT) |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-07-02 17:44:37 (GMT) |
commit | 54bd5006b03ee980f6067b4d61c3605b5a5e1d4a (patch) | |
tree | 9542e10c03a130c46a34173bebd2cd3e202034f9 /drivers/net/wireless/ath/ath9k/hw.h | |
parent | f2552e28375cb34073a2f940ee9a8439c37d9ec2 (diff) | |
download | linux-fsl-qoriq-54bd5006b03ee980f6067b4d61c3605b5a5e1d4a.tar.xz |
ath9k_hw: clean up the noise floor calibration code to reduce code duplication
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/hw.h')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index 6a4b692..92e2502 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h @@ -853,6 +853,12 @@ static inline struct ath_hw_ops *ath9k_hw_ops(struct ath_hw *ah) return &ah->ops; } +static inline int sign_extend(int val, const int nbits) +{ + int order = BIT(nbits-1); + return (val ^ order) - order; +} + /* Initialization, Detach, Reset */ const char *ath9k_hw_probe(u16 vendorid, u16 devid); void ath9k_hw_deinit(struct ath_hw *ah); |