diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2019-02-18 12:31:54 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2019-02-19 17:18:14 +0200 |
commit | dc76bb1e12e967097048f63a76c3ff8a4f02a3b6 (patch) | |
tree | 49ac59fc0880d6c15355a895bcfb9567318964d9 /drivers/net/wireless/ath | |
parent | b9b81d152cfbce6c99dd5f07156b61c41f98ac05 (diff) | |
download | linux-dc76bb1e12e967097048f63a76c3ff8a4f02a3b6.tar.bz2 |
carl9170: clean up a clamp() call
The parameter order for clamp is supposed to be clamp(value, low, high).
When we write it in this order it's equivalent to
min(head->plcp[3] & 0x7f, 75) which works in this context where the min
is zero. But it's not a correct use of the API.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/carl9170/rx.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/carl9170/rx.c b/drivers/net/wireless/ath/carl9170/rx.c index f7c2f19e81c1..8e154f6364a3 100644 --- a/drivers/net/wireless/ath/carl9170/rx.c +++ b/drivers/net/wireless/ath/carl9170/rx.c @@ -427,7 +427,7 @@ static int carl9170_rx_mac_status(struct ar9170 *ar, if (head->plcp[6] & 0x80) status->enc_flags |= RX_ENC_FLAG_SHORT_GI; - status->rate_idx = clamp(0, 75, head->plcp[3] & 0x7f); + status->rate_idx = clamp(head->plcp[3] & 0x7f, 0, 75); status->encoding = RX_ENC_HT; break; |