developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 1 | From c4743bbc1b1953bdc035b871ea1899ca94c1c6ac Mon Sep 17 00:00:00 2001 |
| 2 | From: Jaewan Kim <jaewan@google.com> |
| 3 | Date: Tue, 10 Jan 2023 00:14:55 +0900 |
| 4 | Subject: [PATCH 03/28] iw: info: fix bug reading preambles and bandwidths |
| 5 | |
| 6 | Preambles and bandwidths values are considered as bit shifts |
| 7 | when they're are used for capabilities. |
| 8 | |
| 9 | Signed-off-by: Jaewan Kim <jaewan@google.com> |
| 10 | Link: https://lore.kernel.org/r/20230109151455.325793-1-jaewan@google.com |
| 11 | Signed-off-by: Johannes Berg <johannes.berg@intel.com> |
| 12 | --- |
| 13 | info.c | 4 ++-- |
| 14 | 1 file changed, 2 insertions(+), 2 deletions(-) |
| 15 | |
| 16 | diff --git a/info.c b/info.c |
| 17 | index eb257f8..5229d44 100644 |
| 18 | --- a/info.c |
| 19 | +++ b/info.c |
| 20 | @@ -197,7 +197,7 @@ static void __print_ftm_capability(struct nlattr *ftm_capa) |
| 21 | if (tb[NL80211_PMSR_FTM_CAPA_ATTR_PREAMBLES]) { |
| 22 | #define PRINT_PREAMBLE(P, V) \ |
| 23 | do { \ |
| 24 | - if (P | NL80211_PREAMBLE_##V) \ |
| 25 | + if (P & BIT(NL80211_PREAMBLE_##V)) \ |
| 26 | printf(" " #V); \ |
| 27 | } while (0) |
| 28 | |
| 29 | @@ -215,7 +215,7 @@ static void __print_ftm_capability(struct nlattr *ftm_capa) |
| 30 | if (tb[NL80211_PMSR_FTM_CAPA_ATTR_BANDWIDTHS]) { |
| 31 | #define PRINT_BANDWIDTH(B, V) \ |
| 32 | do { \ |
| 33 | - if (B | NL80211_CHAN_WIDTH_##V) \ |
| 34 | + if (B & BIT(NL80211_CHAN_WIDTH_##V)) \ |
| 35 | printf(" " #V); \ |
| 36 | } while (0) |
| 37 | |
| 38 | -- |
| 39 | 2.39.2 |
| 40 | |