From: Johannes Berg <johannes@sipsolutions.net>
To: Lin Ma <linma@zju.edu.cn>,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, linux-wireless@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 net] cfg80211: pmsr: use correct nla_get_uX functions
Date: Mon, 20 May 2024 13:40:56 +0200 [thread overview]
Message-ID: <b7583de35462b06bbfbeb39bf2435bcb5f04be06.camel@sipsolutions.net> (raw)
In-Reply-To: <20240520073311.44117-1-linma@zju.edu.cn>
Couple of minor comments:
The subject is missing wifi: prefix.
On Mon, 2024-05-20 at 15:33 +0800, Lin Ma wrote:
> The commit 9bb7e0f24e7e ("cfg80211: add peer measurement with FTM
> initiator API") defines four attributes, which are
>
> - `NL80211_PMSR_FTM_REQ_ATTR_NUM_BURSTS_EXP` with NLA_U8 type
> - `NL80211_PMSR_FTM_REQ_ATTR_BURST_PERIOD` with NLA_U16 type
> - `NL80211_PMSR_FTM_REQ_ATTR_BURST_DURATION` with NLA_U8 type
> - `NL80211_PMSR_FTM_REQ_ATTR_NUM_FTMR_RETRIES` with NLA_U8 type
>
> However, the consumers of these attributes in `pmsr_parse_ftm` blindly
> all use `nla_get_u32`, which is incorrect. Hence, fix these with correct
> `nla_get_u8` and `nla_get_u16`.
Maybe mention a bit more clearly that the _policy_ actually defines them
with those types, so the users are incorrect, vs. a possible scenario
where the kernel's documentation is just incorrect and we have to keep
the code as-is for userspace to continue to function.
I believe the changes are correct since the policy wants the right types
and then on little-endian platforms it'll all work ...
johannes
next prev parent reply other threads:[~2024-05-20 11:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-20 7:33 Lin Ma
2024-05-20 11:40 ` Johannes Berg [this message]
2024-05-21 7:52 ` Lin Ma
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=b7583de35462b06bbfbeb39bf2435bcb5f04be06.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linma@zju.edu.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®