[<prev] [next>] [day] [month] [year] [list]
Message-ID: <578671da-c290-422d-8f30-55448d024d55@web.de>
Date: Fri, 31 Oct 2025 13:08:36 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: linux-bluetooth@...r.kernel.org, Bing Zhao <bzhao@...vell.com>,
Luiz Augusto von Dentz <luiz.dentz@...il.com>,
Marcel Holtmann <marcel@...tmann.org>, Rahul Tank <rahult@...vell.com>
Cc: LKML <linux-kernel@...r.kernel.org>, kernel-janitors@...r.kernel.org,
Miaoqian Lin <linmq006@...il.com>
Subject: [PATCH] Bluetooth: btmrvl_sdio: Use pointer from memcpy() call for
assignment in btmrvl_sdio_host_to_card()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Fri, 31 Oct 2025 12:59:00 +0100
A pointer was assigned to a variable. The same pointer was used for
the destination parameter of a memcpy() call.
This function is documented in the way that the same value is returned.
Thus convert two separate statements into a direct variable assignment for
the return value from a memory copy action.
The source code was transformed by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/bluetooth/btmrvl_sdio.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/bluetooth/btmrvl_sdio.c b/drivers/bluetooth/btmrvl_sdio.c
index 93932a0d8625..3120d2beeaa8 100644
--- a/drivers/bluetooth/btmrvl_sdio.c
+++ b/drivers/bluetooth/btmrvl_sdio.c
@@ -1111,8 +1111,8 @@ static int btmrvl_sdio_host_to_card(struct btmrvl_private *priv,
tmpbuf = kzalloc(tmpbufsz, GFP_KERNEL);
if (!tmpbuf)
return -ENOMEM;
- buf = (u8 *) ALIGN_ADDR(tmpbuf, BTSDIO_DMA_ALIGN);
- memcpy(buf, payload, nb);
+
+ buf = memcpy((u8 *)ALIGN_ADDR(tmpbuf, BTSDIO_DMA_ALIGN), payload, nb);
}
sdio_claim_host(card->func);
--
2.51.1
Powered by blists - more mailing lists