From: Johannes Berg <johannes@sipsolutions.net>
To: Colin Ian King <colin.king@canonical.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: Potential invalid ~ operator in net/mac80211/cfg.c
Date: Fri, 12 Feb 2021 11:18:08 +0100 [thread overview]
Message-ID: <0a95501d45fd23baa7ce5bab88c033380e2d095b.camel@sipsolutions.net> (raw)
In-Reply-To: <86c1e5aa-459d-6d76-69e4-f7bc177214bf@canonical.com>
On Fri, 2021-02-05 at 18:20 +0000, Colin Ian King wrote:
>
> > > https://lore.kernel.org/linux-wireless/516C0C7F.3000204@openwrt.org/
> > >
> > > But maybe that isn't actually quite right due to integer promotion?
> > > OTOH, that's a u8, so it should do the ~ in u8 space, and then compare
> > > to 0 also?
> >
> > rc_rateidx_vht_mcs_mask is a u64, so I think the expression could be
> > expressed as:
>
> oops, fat fingered that, it is a u16 not a u64
Right, u16, I must've looked at some ancient version or something.
But no, I was obviously wrong with what I said above.
So of course the condition is always true, like you said.
However, what was intended doesn't look like !, but rather == 0xff and
== 0xffff respectively, I'll send a patch.
johannes
prev parent reply other threads:[~2021-02-12 10:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-05 17:38 Potential invalid ~ operator in net/mac80211/cfg.c Colin Ian King
2021-02-05 18:05 ` Johannes Berg
2021-02-05 18:19 ` Colin Ian King
2021-02-05 18:20 ` Colin Ian King
2021-02-12 10:18 ` Johannes Berg [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=0a95501d45fd23baa7ce5bab88c033380e2d095b.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=colin.king@canonical.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox