提交 9b326dfc 编写于 作者: D Denis Petrovic 提交者: Greg Kroah-Hartman

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: NDenis Petrovic <denis.petrovic@edu.ece.fr>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 878c33a7
...@@ -57,8 +57,9 @@ int cfs_tracefile_init_arch(void) ...@@ -57,8 +57,9 @@ int cfs_tracefile_init_arch(void)
memset(cfs_trace_data, 0, sizeof(cfs_trace_data)); memset(cfs_trace_data, 0, sizeof(cfs_trace_data));
for (i = 0; i < CFS_TCD_TYPE_MAX; i++) { for (i = 0; i < CFS_TCD_TYPE_MAX; i++) {
cfs_trace_data[i] = cfs_trace_data[i] =
kmalloc(sizeof(union cfs_trace_data_union) * kmalloc_array(num_possible_cpus(),
num_possible_cpus(), GFP_KERNEL); sizeof(union cfs_trace_data_union),
GFP_KERNEL);
if (!cfs_trace_data[i]) if (!cfs_trace_data[i])
goto out; goto out;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册