Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1674210 > unrolled thread

[PATCH] staging: lustre: replace kmalloc with kmalloc_array

Started byDenis Petrovic <denis.petrovic@edu.ece.fr>
First post2017-06-25 15:00 +0200
Last post2017-06-25 15:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] staging: lustre: replace kmalloc with kmalloc_array Denis Petrovic <denis.petrovic@edu.ece.fr> - 2017-06-25 15:00 +0200

#1674210 — [PATCH] staging: lustre: replace kmalloc with kmalloc_array

FromDenis Petrovic <denis.petrovic@edu.ece.fr>
Date2017-06-25 15:00 +0200
Subject[PATCH] staging: lustre: replace kmalloc with kmalloc_array
Message-ID<tWfiW-5cl-11@gated-at.bofh.it>
This patch fixes the following checkpatch.pl warning:

WARNING: Prefer kmalloc_array over kmalloc with multiply

Signed-off-by: Denis Petrovic <denis.petrovic@edu.ece.fr>
---
 drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c
index 75eb84e7f0f8..a5a94788f11f 100644
--- a/drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c
+++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c
@@ -57,8 +57,9 @@ int cfs_tracefile_init_arch(void)
 	memset(cfs_trace_data, 0, sizeof(cfs_trace_data));
 	for (i = 0; i < CFS_TCD_TYPE_MAX; i++) {
 		cfs_trace_data[i] =
-			kmalloc(sizeof(union cfs_trace_data_union) *
-				num_possible_cpus(), GFP_KERNEL);
+			kmalloc_array(num_possible_cpus(),
+				      sizeof(union cfs_trace_data_union),
+				      GFP_KERNEL);
 		if (!cfs_trace_data[i])
 			goto out;
 	}
-- 
2.11.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web