Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: Rosen Penev <rosenp@gmail.com>
To: linux-wireless@vger.kernel.org
Cc: Arend van Spriel <arend.vanspriel@broadcom.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>,
	brcm80211@lists.linux.dev (open list:BROADCOM BRCM80211
	IEEE802.11 WIRELESS DRIVERS),
	brcm80211-dev-list.pdl@broadcom.com (open list:BROADCOM
	BRCM80211 IEEE802.11 WIRELESS DRIVERS),
	llvm@lists.linux.dev (open list:CLANG/LLVM BUILD
	SUPPORT:Keyword:\b(?i:clang|llvm)\b)
Subject: [PATCH wireless-next v2 0/7] wifi: brcmsmac: embed fixed-size allocations in brcms_c_info
Date: Tue, 24 Nov 2026 13:50:33 -0800	[thread overview]
Message-ID: <20261124215040.1261999-1-rosenp@gmail.com> (raw)

brcms_c_attach_malloc() allocates struct brcms_c_info and then a number
of fixed-size structures that live exactly as long as it does, each with
its own kzalloc(GFP_ATOMIC), error code and kfree(). This series embeds
seven of them in their parent structures. That removes the allocations
and their OOM error paths and, for the per-band state, the open-coded
pointer arithmetic that carved two arrays out of one allocation.

Patch 1 embeds the per-band state arrays of brcms_c_info and
brcms_hardware. Patches 2-7 embed the module callback array, the MAC
statistics snapshot, the default BSS info, the protection settings, the
core state and the BSS configuration. Patch 6 also drops the
brcms_c_info::core pointer, which always pointed at the embedded core
state. Patch 7 moves the definition of struct brcms_bss_cfg, unchanged,
above struct brcms_c_info.

There is no functional change. The pub, hw and stf allocations are left
alone: embedding them would touch most of the driver for little gain.

Changes in v2:
- Patch 6: remove the redundant core pointer and use corestate
  directly (Arend).
- Collect Arend's Acked-by on patches 1-7.
- Link to v1: https://lore.kernel.org/linux-wireless/20261111042554.232998-1-rosenp@gmail.com/

Each patch builds with W=1 (arm64, clang) and passes checkpatch.
Compile-tested only.

An AI coding assistant (Claude Code, Claude Opus 5.5) was used to review
the series, resolve rebase conflicts, write patches 5-7, and draft the
commit messages and this cover letter.

Rosen Penev (7):
  wifi: brcmsmac: embed bandstate arrays instead of separate allocation
  wifi: brcmsmac: embed modulecb array instead of separate allocation
  wifi: brcmsmac: embed macstat_snapshot in brcms_core
  wifi: brcmsmac: embed default_bss in brcms_c_info
  wifi: brcmsmac: embed brcms_protection in brcms_c_info
  wifi: brcmsmac: embed brcms_core in brcms_c_info
  wifi: brcmsmac: embed brcms_bss_cfg in brcms_c_info

 .../broadcom/brcm80211/brcmsmac/ampdu.c       |   2 +-
 .../broadcom/brcm80211/brcmsmac/channel.c     |  14 +-
 .../broadcom/brcm80211/brcmsmac/debug.c       |   2 +-
 .../broadcom/brcm80211/brcmsmac/mac80211_if.c |   4 +-
 .../broadcom/brcm80211/brcmsmac/main.c        | 229 ++++++------------
 .../broadcom/brcm80211/brcmsmac/main.h        |  83 ++++---
 .../broadcom/brcm80211/brcmsmac/stf.c         |  22 +-
 7 files changed, 139 insertions(+), 217 deletions(-)


base-commit: 793807ca13bf3072fc6d16ce6d90e9ab9beff2a5
--
2.56.1


             reply	other threads:[~2026-11-24 21:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 21:50 Rosen Penev [this message]
2026-11-24 21:50 ` [PATCH wireless-next v2 1/7] wifi: brcmsmac: embed bandstate arrays instead of separate allocation Rosen Penev
2026-11-24 21:50 ` [PATCH wireless-next v2 2/7] wifi: brcmsmac: embed modulecb array " Rosen Penev
2026-11-24 21:50 ` [PATCH wireless-next v2 3/7] wifi: brcmsmac: embed macstat_snapshot in brcms_core Rosen Penev
2026-11-24 21:50 ` [PATCH wireless-next v2 4/7] wifi: brcmsmac: embed default_bss in brcms_c_info Rosen Penev
2026-11-24 21:50 ` [PATCH wireless-next v2 5/7] wifi: brcmsmac: embed brcms_protection " Rosen Penev
2026-11-24 21:50 ` [PATCH wireless-next v2 6/7] wifi: brcmsmac: embed brcms_core " Rosen Penev
2026-11-24 21:50 ` [PATCH wireless-next v2 7/7] wifi: brcmsmac: embed brcms_bss_cfg " Rosen Penev

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=20261124215040.1261999-1-rosenp@gmail.com \
    --to=rosenp@gmail.com \
    --cc=arend.vanspriel@broadcom.com \
    --cc=brcm80211-dev-list.pdl@broadcom.com \
    --cc=brcm80211@lists.linux.dev \
    --cc=justinstitt@google.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.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