From: Johannes Berg <johannes@sipsolutions.net>
To: Jeff Johnson <jeff.johnson@oss.qualcomm.com>,
linux-wireless@vger.kernel.org
Subject: Re: [PATCH] wifi: move action code from per-type frame structs
Date: Wed, 25 Feb 2026 23:00:09 +0100 [thread overview]
Message-ID: <2bd17f45603a295e6ff69de666c41ee7dc2dadd4.camel@sipsolutions.net> (raw)
In-Reply-To: <a9caee5b-1698-49ae-bf07-77b417e6ff4d@oss.qualcomm.com>
On Wed, 2026-02-25 at 13:18 -0800, Jeff Johnson wrote:
> On 2/25/2026 9:08 AM, Johannes Berg wrote:
> >
> > And a couple of other notes:
> >
> > > struct{
> > > - u8 action_code;
> > > + u8 no_fixed_fields[0];
> > > u8 variable[];
> > > } __packed chan_switch;
> >
> > This thing in a couple of places isn't ideal, but I think it doesn't
> > outweigh the benefits of this structural approach.
>
> My fear is that "helpful" members of the community will refer to the
> following, believing this is an old style variable array definition:
>
> https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays
Yeah ... We'll have helpful AIs to tell the "helpful" people off, right?
Right? ;-)
> So I personally feel that a /* no fixed fields */ comment would provide the
> same benefit without bringing unwanted noise (unless the code just doesn't
> build without the member being present).
Ah, but that's exactly the thing, it isn't valid to have structs
completely without members (there's one case without "u8 variable[];"),
nor structs with only a variable member. So indeed it doesn't build
without it.
So ... yeah, not ideal, but I think the structural benefit outweighs the
disadvantage here.
Unless folks disagree with that and think that the action_code really
_should_ be part of the per-action-frame sub-struct? Personally, I think
the code looks better this way, and it has always slightly bothered me,
but I could be convinced otherwise :)
johannes
prev parent reply other threads:[~2026-02-25 22:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-25 16:52 [PATCH] wifi: move action code from per-type frame structs Johannes Berg
2026-02-25 17:08 ` Johannes Berg
2026-02-25 17:08 ` Johannes Berg
2026-02-25 21:18 ` Jeff Johnson
2026-02-25 22:00 ` 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=2bd17f45603a295e6ff69de666c41ee7dc2dadd4.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=jeff.johnson@oss.qualcomm.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox