lkml.org 
[lkml]   [2017]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 1/2] oprofile_perf: Improve a size determination in oprofile_perf_init()
From
Date
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 13 May 2017 18:00:13 +0200

Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/oprofile/oprofile_perf.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/oprofile/oprofile_perf.c b/drivers/oprofile/oprofile_perf.c
index d5b2732b1b81..033f2c26f2ad 100644
--- a/drivers/oprofile/oprofile_perf.c
+++ b/drivers/oprofile/oprofile_perf.c
@@ -285,7 +285,6 @@ int __init oprofile_perf_init(struct oprofile_operations *ops)
goto out;
}

- counter_config = kcalloc(num_counters,
- sizeof(struct op_counter_config), GFP_KERNEL);
-
+ counter_config = kcalloc(num_counters, sizeof(*counter_config),
+ GFP_KERNEL);
if (!counter_config) {
--
2.12.3
\
 
 \ /
  Last update: 2017-05-13 18:34    [W:0.026 / U:1.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site