Re: [PATCH wireless-next 6/7] wifi: brcmsmac: embed brcms_core in brcms_c_info

From: Arend van Spriel

Date: Tue Nov 24 2026 - 15:14:53 EST


On Tue, 10 Nov 2026 20:25:53 -0800, Rosen Penev <rosenp@xxxxxxxxx> wrote:
> There is only one struct brcms_core and it has the same lifetime as
> struct brcms_c_info. Embed it directly instead of allocating it
> separately, removing one kzalloc()/kfree() pair and its OOM error path.
>
> Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
> ---
> drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c | 9 +--------
> drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.h | 2 +-
> 2 files changed, 2 insertions(+), 9 deletions(-)

[...]

> @@ -470,7 +470,7 @@ struct brcms_c_info {
> /* multiband */
> struct brcms_core *core;
> struct brcms_band *band;
> - struct brcms_core *corestate;
> + struct brcms_core corestate;
> struct brcms_band bandstate[MAXBANDS];
>
> /* packet queue */

With the embedded struct there is no need for the separate pointer
anymore. wlc->core always points at wlc->corestate, so the core pointer
could be dropped and the users could use &wlc->corestate directly.

Acked-by: Arend van Spriel <arend.vanspriel@xxxxxxxxxxxx>

Regards,
Arend