All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaewan Kim <jaewan@google.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, Jaewan Kim <jaewan@google.com>
Subject: [PATCH v4] iw: info: fix bug reading preambles and bandwidths
Date: Tue, 10 Jan 2023 00:14:55 +0900	[thread overview]
Message-ID: <20230109151455.325793-1-jaewan@google.com> (raw)
In-Reply-To: <20221227010034.1399587-1-jaewan@google.com>

Preambles and bandwidths values are considered as bit shifts
when they're are used for capabilities.

Signed-off-by: Jaewan Kim <jaewan@google.com>
---
 info.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git info.c info.c
index eb257f8..5229d44 100644
--- info.c
+++ info.c
@@ -197,7 +197,7 @@ static void __print_ftm_capability(struct nlattr *ftm_capa)
 	if (tb[NL80211_PMSR_FTM_CAPA_ATTR_PREAMBLES]) {
 #define PRINT_PREAMBLE(P, V) \
 	do { \
-		if (P | NL80211_PREAMBLE_##V) \
+		if (P & BIT(NL80211_PREAMBLE_##V)) \
 			printf(" " #V); \
 	} while (0)
 
@@ -215,7 +215,7 @@ static void __print_ftm_capability(struct nlattr *ftm_capa)
 	if (tb[NL80211_PMSR_FTM_CAPA_ATTR_BANDWIDTHS]) {
 #define PRINT_BANDWIDTH(B, V) \
 	do { \
-		if (B | NL80211_CHAN_WIDTH_##V) \
+		if (B & BIT(NL80211_CHAN_WIDTH_##V)) \
 			printf(" " #V); \
 	} while (0)
 
-- 
2.39.0.314.g84b9a713c41-goog


      parent reply	other threads:[~2023-01-09 15:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-20 13:42 [PATCH] iw: info: fix bug reading preamble and bandwidths Jaewan Kim
2022-12-20 13:47 ` [PATCH v2] " Jaewan Kim
2022-12-22  8:32   ` Kalle Valo
2022-12-27  1:00   ` [PATCH v3] iw: info: fix bug reading preambles " Jaewan Kim
2023-01-09 14:55     ` Kalle Valo
2023-01-09 15:12       ` Jaewan Kim
2023-01-09 15:14     ` Jaewan Kim [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230109151455.325793-1-jaewan@google.com \
    --to=jaewan@google.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.