diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-05-02 16:47:49 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-14 16:29:33 -0400 |
commit | ca21614d4c7a176d3723ac211873020b3722dbda (patch) | |
tree | 15b77a9b5250b708985458ce13963c72ca52af28 /drivers/net/wireless/b43legacy/phy.c | |
parent | cdbf0846e2dd5f122f3910d0e2a305fab337744b (diff) |
b43legacy: replace limit_value macro with clamp_val
kernel-provided clamp_val is identical, delete the private limit_value helper.
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Michael Buesch <mb@bu3sch.de>
Cc: "John W. Linville" <linville@tuxdriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43legacy/phy.c')
-rw-r--r-- | drivers/net/wireless/b43legacy/phy.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/wireless/b43legacy/phy.c b/drivers/net/wireless/b43legacy/phy.c index 8e5c09b81871..768cccb9b1ba 100644 --- a/drivers/net/wireless/b43legacy/phy.c +++ b/drivers/net/wireless/b43legacy/phy.c | |||
@@ -1088,7 +1088,7 @@ static void b43legacy_phy_initg(struct b43legacy_wldev *dev) | |||
1088 | * the value 0x7FFFFFFF here. I think that is some weird | 1088 | * the value 0x7FFFFFFF here. I think that is some weird |
1089 | * compiler optimization in the original driver. | 1089 | * compiler optimization in the original driver. |
1090 | * Essentially, what we do here is resetting all NRSSI LT | 1090 | * Essentially, what we do here is resetting all NRSSI LT |
1091 | * entries to -32 (see the limit_value() in nrssi_hw_update()) | 1091 | * entries to -32 (see the clamp_val() in nrssi_hw_update()) |
1092 | */ | 1092 | */ |
1093 | b43legacy_nrssi_hw_update(dev, 0xFFFF); | 1093 | b43legacy_nrssi_hw_update(dev, 0xFFFF); |
1094 | b43legacy_calc_nrssi_threshold(dev); | 1094 | b43legacy_calc_nrssi_threshold(dev); |
@@ -1756,7 +1756,7 @@ static s8 b43legacy_phy_estimate_power_out(struct b43legacy_wldev *dev, s8 tssi) | |||
1756 | switch (phy->type) { | 1756 | switch (phy->type) { |
1757 | case B43legacy_PHYTYPE_B: | 1757 | case B43legacy_PHYTYPE_B: |
1758 | case B43legacy_PHYTYPE_G: | 1758 | case B43legacy_PHYTYPE_G: |
1759 | tmp = limit_value(tmp, 0x00, 0x3F); | 1759 | tmp = clamp_val(tmp, 0x00, 0x3F); |
1760 | dbm = phy->tssi2dbm[tmp]; | 1760 | dbm = phy->tssi2dbm[tmp]; |
1761 | break; | 1761 | break; |
1762 | default: | 1762 | default: |
@@ -1859,7 +1859,7 @@ void b43legacy_phy_xmitpower(struct b43legacy_wldev *dev) | |||
1859 | 1859 | ||
1860 | /* find the desired power in Q5.2 - power_level is in dBm | 1860 | /* find the desired power in Q5.2 - power_level is in dBm |
1861 | * and limit it - max_pwr is already in Q5.2 */ | 1861 | * and limit it - max_pwr is already in Q5.2 */ |
1862 | desired_pwr = limit_value(phy->power_level << 2, 0, max_pwr); | 1862 | desired_pwr = clamp_val(phy->power_level << 2, 0, max_pwr); |
1863 | if (b43legacy_debug(dev, B43legacy_DBG_XMITPOWER)) | 1863 | if (b43legacy_debug(dev, B43legacy_DBG_XMITPOWER)) |
1864 | b43legacydbg(dev->wl, "Current TX power output: " Q52_FMT | 1864 | b43legacydbg(dev->wl, "Current TX power output: " Q52_FMT |
1865 | " dBm, Desired TX power output: " Q52_FMT | 1865 | " dBm, Desired TX power output: " Q52_FMT |
@@ -1905,7 +1905,7 @@ void b43legacy_phy_xmitpower(struct b43legacy_wldev *dev) | |||
1905 | radio_attenuation++; | 1905 | radio_attenuation++; |
1906 | } | 1906 | } |
1907 | } | 1907 | } |
1908 | baseband_attenuation = limit_value(baseband_attenuation, 0, 11); | 1908 | baseband_attenuation = clamp_val(baseband_attenuation, 0, 11); |
1909 | 1909 | ||
1910 | txpower = phy->txctl1; | 1910 | txpower = phy->txctl1; |
1911 | if ((phy->radio_ver == 0x2050) && (phy->radio_rev == 2)) { | 1911 | if ((phy->radio_ver == 0x2050) && (phy->radio_rev == 2)) { |
@@ -1933,8 +1933,8 @@ void b43legacy_phy_xmitpower(struct b43legacy_wldev *dev) | |||
1933 | } | 1933 | } |
1934 | /* Save the control values */ | 1934 | /* Save the control values */ |
1935 | phy->txctl1 = txpower; | 1935 | phy->txctl1 = txpower; |
1936 | baseband_attenuation = limit_value(baseband_attenuation, 0, 11); | 1936 | baseband_attenuation = clamp_val(baseband_attenuation, 0, 11); |
1937 | radio_attenuation = limit_value(radio_attenuation, 0, 9); | 1937 | radio_attenuation = clamp_val(radio_attenuation, 0, 9); |
1938 | phy->rfatt = radio_attenuation; | 1938 | phy->rfatt = radio_attenuation; |
1939 | phy->bbatt = baseband_attenuation; | 1939 | phy->bbatt = baseband_attenuation; |
1940 | 1940 | ||
@@ -1979,7 +1979,7 @@ s8 b43legacy_tssi2dbm_entry(s8 entry [], u8 index, s16 pab0, s16 pab1, s16 pab2) | |||
1979 | f = q; | 1979 | f = q; |
1980 | i++; | 1980 | i++; |
1981 | } while (delta >= 2); | 1981 | } while (delta >= 2); |
1982 | entry[index] = limit_value(b43legacy_tssi2dbm_ad(m1 * f, 8192), | 1982 | entry[index] = clamp_val(b43legacy_tssi2dbm_ad(m1 * f, 8192), |
1983 | -127, 128); | 1983 | -127, 128); |
1984 | return 0; | 1984 | return 0; |
1985 | } | 1985 | } |