[PATCH 4/7] kernel-trace: Improve a size determination in create_hist_field()

From: SF Markus Elfring
Date: Fri May 05 2017 - 17:04:42 EST


From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 5 May 2017 20:15:46 +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@xxxxxxxxxxxxxxxxxxxxx>
---
kernel/trace/trace_events_hist.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
index 36412deac24c..a75223572374 100644
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -353,7 +353,7 @@ static struct hist_field *create_hist_field(struct ftrace_event_field *field,
if (field && is_function_field(field))
return NULL;

- hist_field = kzalloc(sizeof(struct hist_field), GFP_KERNEL);
+ hist_field = kzalloc(sizeof(*hist_field), GFP_KERNEL);
if (!hist_field)
return NULL;

--
2.12.2