diff mbox series

[next] net: mana: Use kcalloc() instead of kzalloc()

Message ID 20211006180927.GA913456@embeddedor (mailing list archive)
State Accepted
Commit 149ef7b2f949627bf3f1381d6a976f136a1887f5
Delegated to: Netdev Maintainers
Headers show
Series [next] net: mana: Use kcalloc() instead of kzalloc() | expand

Checks

Context Check Description
netdev/cover_letter success Single patches do not need cover letters
netdev/fixes_present success Fixes tag not required for -next series
netdev/patch_count success Link
netdev/tree_selection success Guessed tree name to be net-next
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cc_maintainers warning 12 maintainers not CCed: len.baker@gmx.com bpf@vger.kernel.org daniel@iogearbox.net kafai@fb.com yhs@fb.com colin.king@canonical.com andrii@kernel.org john.fastabend@gmail.com songliubraving@fb.com kpsingh@kernel.org ast@kernel.org shacharr@microsoft.com
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success No Fixes tag
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 16 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success No static functions without inline keyword in header files

Commit Message

Gustavo A. R. Silva Oct. 6, 2021, 6:09 p.m. UTC
Use 2-factor multiplication argument form kcalloc() instead
of kzalloc().

Link: https://github.com/KSPP/linux/issues/162
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
 drivers/net/ethernet/microsoft/mana/hw_channel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Dexuan Cui Oct. 6, 2021, 6:24 p.m. UTC | #1
> From: Gustavo A. R. Silva <gustavoars@kernel.org>
> Sent: Wednesday, October 6, 2021 11:09 AM
> ...
> Subject: [PATCH][next] net: mana: Use kcalloc() instead of kzalloc()

The [next] should be [net-next], butI guess David can fix this for you :-)

Reviewed-by: Dexuan Cui <decui@microsoft.com>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/microsoft/mana/hw_channel.c b/drivers/net/ethernet/microsoft/mana/hw_channel.c
index d5c485a6d284..7c7a5fb91f79 100644
--- a/drivers/net/ethernet/microsoft/mana/hw_channel.c
+++ b/drivers/net/ethernet/microsoft/mana/hw_channel.c
@@ -363,7 +363,7 @@  static int mana_hwc_create_cq(struct hw_channel_context *hwc, u16 q_depth,
 	}
 	hwc_cq->gdma_cq = cq;
 
-	comp_buf = kcalloc(q_depth, sizeof(struct gdma_comp), GFP_KERNEL);
+	comp_buf = kcalloc(q_depth, sizeof(*comp_buf), GFP_KERNEL);
 	if (!comp_buf) {
 		err = -ENOMEM;
 		goto out;
@@ -580,7 +580,7 @@  static int mana_hwc_test_channel(struct hw_channel_context *hwc, u16 q_depth,
 			return err;
 	}
 
-	ctx = kzalloc(q_depth * sizeof(struct hwc_caller_ctx), GFP_KERNEL);
+	ctx = kcalloc(q_depth, sizeof(*ctx), GFP_KERNEL);
 	if (!ctx)
 		return -ENOMEM;