[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240620171950.GO959333@kernel.org>
Date: Thu, 20 Jun 2024 18:19:50 +0100
From: Simon Horman <horms@...nel.org>
To: Breno Leitao <leitao@...ian.org>
Cc: kvalo@...nel.org, linux-wireless@...r.kernel.org, davem@...emloft.net,
edumazet@...gle.com, pabeni@...hat.com,
Felix Fietkau <nbd@....name>, Lorenzo Bianconi <lorenzo@...nel.org>,
Ryder Lee <ryder.lee@...iatek.com>,
Shayne Chen <shayne.chen@...iatek.com>,
Sean Wang <sean.wang@...iatek.com>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
netdev@...r.kernel.org, kees@...nel.org,
Bo Jiao <Bo.Jiao@...iatek.com>, Alexander Couzens <lynxis@...0.eu>,
Deren Wu <deren.wu@...iatek.com>,
Ming Yen Hsieh <mingyen.hsieh@...iatek.com>,
Leon Yen <leon.yen@...iatek.com>,
Quan Zhou <quan.zhou@...iatek.com>, Ingo Rohloff <lundril@....de>,
Sujuan Chen <sujuan.chen@...iatek.com>,
Peter Chiu <chui-hao.chiu@...iatek.com>,
StanleyYP Wang <StanleyYP.Wang@...iatek.com>,
Benjamin Lin <benjamin-jw.lin@...iatek.com>,
"open list:ARM/Mediatek SoC support" <linux-kernel@...r.kernel.org>,
"moderated list:ARM/Mediatek SoC support" <linux-arm-kernel@...ts.infradead.org>,
"moderated list:ARM/Mediatek SoC support" <linux-mediatek@...ts.infradead.org>
Subject: Re: [PATCH net-next v2] wifi: mt76: un-embedd netdev from mt76_dev
On Wed, Jun 19, 2024 at 03:52:36AM -0700, Breno Leitao wrote:
> Embedding net_device into structures prohibits the usage of flexible
> arrays in the net_device structure. For more details, see the discussion
> at [1].
>
> Un-embed the net_devices from struct mt76_dev by converting them
> into pointers, and allocating them dynamically. Use the leverage
> alloc_netdev_dummy() to allocate the net_device object at
> mt76_dma_init().
>
> The free of the device occurs at mt76_dma_cleanup().
>
> Link: https://lore.kernel.org/all/20240229225910.79e224cf@kernel.org/ [1]
> Reviewed-by: Simon Horman <horms@...nel.org>
> Signed-off-by: Breno Leitao <leitao@...ian.org>
> ---
>
> Changelog:
> * v2:
> - Renamed mt76_from_netdev() to mt76_priv(), and returns a
> void pointer instead of struct mt76_dev, avoiding the cast
> later, as suggested by Simon Horman.
Thanks for the update, it looks good to me.
Powered by blists - more mailing lists