Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Lorenzo Bianconi <lorenzo@kernel.org>, nbd@nbd.name
Cc: linux-wireless@vger.kernel.org, lorenzo.bianconi@redhat.com
Subject: Re: [PATCH] wifi: mt76: mt7921: introduce mt7921_get_mac80211_ops utility routine
Date: Mon, 06 Mar 2023 21:49:48 +0100	[thread overview]
Message-ID: <41b51fcc9e1ba560fbdad76d818d31167d73c265.camel@sipsolutions.net> (raw)
In-Reply-To: <e52206331b479cc3089ec5c314a3327e67eb27b8.1678124807.git.lorenzo@kernel.org>

On Mon, 2023-03-06 at 18:50 +0100, Lorenzo Bianconi wrote:
> 
> +struct ieee80211_ops *
> +mt7921_get_mac80211_ops(struct device *dev, void *drv_data, u8 *fw_features)
> +{
> +	struct ieee80211_ops *ops;
> +
> +	ops = devm_kmemdup(dev, &mt7921_ops, sizeof(mt7921_ops), GFP_KERNEL);

It's kind of nice to have static const ops so they can't be a target for
overwriting and function pointer injection, maybe just declare two
copies with a macro or so, with and without chanctx, and return the
appropriate one? It won't even use more memory unless you never run a
device w/o chanctx ops.

johannes


  reply	other threads:[~2023-03-06 20:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-06 17:50 [PATCH] wifi: mt76: mt7921: introduce mt7921_get_mac80211_ops utility routine Lorenzo Bianconi
2023-03-06 20:49 ` Johannes Berg [this message]
2023-03-06 22:16   ` Lorenzo Bianconi

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=41b51fcc9e1ba560fbdad76d818d31167d73c265.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=lorenzo@kernel.org \
    --cc=nbd@nbd.name \
    /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