diff mbox series

Bluetooth: hci_conn: Remove redundant memset after kzalloc

Message ID 20240810141415.124113-1-visitorckw@gmail.com
State Accepted
Commit 7a6abe8d0fdb1ae8219e8e4a6453e66b49f4529d
Headers show
Series Bluetooth: hci_conn: Remove redundant memset after kzalloc | expand

Commit Message

Kuan-Wei Chiu Aug. 10, 2024, 2:14 p.m. UTC
Since kzalloc already zeroes the allocated memory, the subsequent
memset call is unnecessary. This patch removes the redundant memset to
clean up the code and enhance efficiency.

Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
---
Note: Build test only.

 net/bluetooth/hci_conn.c | 1 -
 1 file changed, 1 deletion(-)

Comments

patchwork-bot+bluetooth@kernel.org Aug. 20, 2024, 5 p.m. UTC | #1
Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Sat, 10 Aug 2024 22:14:15 +0800 you wrote:
> Since kzalloc already zeroes the allocated memory, the subsequent
> memset call is unnecessary. This patch removes the redundant memset to
> clean up the code and enhance efficiency.
> 
> Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
> ---
> Note: Build test only.
> 
> [...]

Here is the summary with links:
  - Bluetooth: hci_conn: Remove redundant memset after kzalloc
    https://git.kernel.org/bluetooth/bluetooth-next/c/7a6abe8d0fdb

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 8e48ccd2af30..8f0c9322eadb 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -778,7 +778,6 @@  static int hci_le_big_terminate(struct hci_dev *hdev, u8 big, struct hci_conn *c
 	if (!d)
 		return -ENOMEM;
 
-	memset(d, 0, sizeof(*d));
 	d->big = big;
 	d->sync_handle = conn->sync_handle;