Skip to content

Commit

Permalink
staging: lustre: replace kmalloc with kmalloc_array
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Denis Petrovic authored and Greg Kroah-Hartman committed Jun 29, 2017
1 parent 878c33a commit 9b326df
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9b326df

Please sign in to comment.