diff mbox series

[v5,6/9] wifi: wilc1000: Remove cmd53_buf() allocation

Message ID 20240909193035.69823-6-marex@denx.de (mailing list archive)
State Not Applicable
Delegated to: Netdev Maintainers
Headers show
Series [v5,1/9] dt-bindings: wireless: wilc1000: Document WILC3000 compatible string | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Marek Vasut Sept. 9, 2024, 7:29 p.m. UTC
The cmd53_buf is a 4 byte buffer, embed it into the struct wilc_sdio.

Signed-off-by: Marek Vasut <marex@denx.de>
---
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Adham Abozaeid <adham.abozaeid@microchip.com>
Cc: Ajay Singh <ajay.kathat@microchip.com>
Cc: Alexis Lothoré <alexis.lothore@bootlin.com>
Cc: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Cc: Conor Dooley <conor+dt@kernel.org>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Kalle Valo <kvalo@kernel.org>
Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
---
V5: New patch
---
 drivers/net/wireless/microchip/wilc1000/sdio.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

Comments

Alexis Lothoré Sept. 10, 2024, 9:47 a.m. UTC | #1
On 9/9/24 21:29, Marek Vasut wrote:
> The cmd53_buf is a 4 byte buffer, embed it into the struct wilc_sdio.

Is this change really desirable ? I mean, looking at git log, it looks like this
kzalloc is voluntary, for usage with DMA (see [1] as initial fix and [2] as the
final patch which has landed in the driver)

[1]
https://patchwork.kernel.org/project/linux-wireless/patch/20220728152037.386543-1-michael@walle.cc/
[2] https://lore.kernel.org/all/20220809075749.62752-1-ajay.kathat@microchip.com/

Alexis
Marek Vasut Sept. 10, 2024, 10:49 a.m. UTC | #2
On 9/10/24 11:47 AM, Alexis Lothoré wrote:
> On 9/9/24 21:29, Marek Vasut wrote:
>> The cmd53_buf is a 4 byte buffer, embed it into the struct wilc_sdio.
> 
> Is this change really desirable ? I mean, looking at git log, it looks like this
> kzalloc is voluntary, for usage with DMA (see [1] as initial fix and [2] as the
> final patch which has landed in the driver)
It is unrelated to the series, so I'll just drop it for now.
diff mbox series

Patch

diff --git a/drivers/net/wireless/microchip/wilc1000/sdio.c b/drivers/net/wireless/microchip/wilc1000/sdio.c
index c26447289b71b..6d01a838ab184 100644
--- a/drivers/net/wireless/microchip/wilc1000/sdio.c
+++ b/drivers/net/wireless/microchip/wilc1000/sdio.c
@@ -31,7 +31,7 @@  struct wilc_sdio {
 	bool irq_gpio;
 	u32 block_size;
 	bool isinit;
-	u8 *cmd53_buf;
+	u8 cmd53_buf[4];
 };
 
 struct sdio_cmd52 {
@@ -149,12 +149,6 @@  static int wilc_sdio_probe(struct sdio_func *func,
 	if (!sdio_priv)
 		return -ENOMEM;
 
-	sdio_priv->cmd53_buf = kzalloc(sizeof(u32), GFP_KERNEL);
-	if (!sdio_priv->cmd53_buf) {
-		ret = -ENOMEM;
-		goto free;
-	}
-
 	ret = wilc_cfg80211_init(&wilc, &func->dev, WILC_HIF_SDIO,
 				 &wilc_hif_sdio);
 	if (ret)
@@ -207,7 +201,6 @@  static int wilc_sdio_probe(struct sdio_func *func,
 	irq_dispose_mapping(wilc->dev_irq_num);
 	wilc_netdev_cleanup(wilc);
 free:
-	kfree(sdio_priv->cmd53_buf);
 	kfree(sdio_priv);
 	return ret;
 }
@@ -219,7 +212,6 @@  static void wilc_sdio_remove(struct sdio_func *func)
 
 	clk_disable_unprepare(wilc->rtc_clk);
 	wilc_netdev_cleanup(wilc);
-	kfree(sdio_priv->cmd53_buf);
 	kfree(sdio_priv);
 }