Skip to content

Commit 9b326df

Browse files
Denis Petrovicgregkh
authored andcommitted
staging: lustre: replace kmalloc with kmalloc_array
This patch fixes the following checkpatch.pl warning: WARNING: Prefer kmalloc_array over kmalloc with multiply Signed-off-by: Denis Petrovic <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 878c33a commit 9b326df

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ int cfs_tracefile_init_arch(void)
5757
memset(cfs_trace_data, 0, sizeof(cfs_trace_data));
5858
for (i = 0; i < CFS_TCD_TYPE_MAX; i++) {
5959
cfs_trace_data[i] =
60-
kmalloc(sizeof(union cfs_trace_data_union) *
61-
num_possible_cpus(), GFP_KERNEL);
60+
kmalloc_array(num_possible_cpus(),
61+
sizeof(union cfs_trace_data_union),
62+
GFP_KERNEL);
6263
if (!cfs_trace_data[i])
6364
goto out;
6465
}

0 commit comments

Comments
 (0)