Messages in this thread | | | Subject | Re: [PATCH v2 1/2] tracing: Have histogram types be constant when possible | From | Tom Zanussi <> | Date | Thu, 22 Jul 2021 17:11:28 -0500 |
| |
On Thu, 2021-07-22 at 10:27 -0400, Steven Rostedt wrote: > From: "Steven Rostedt (VMware)" <rostedt@goodmis.org> > > Instead of kstrdup("const", GFP_KERNEL), have the hist_field type > simply > assign the constant hist_field->type = "const"; And when the value > passed > to it is a variable, use "kstrdup_const(var, GFP_KERNEL);" which will > just > copy the value if the variable is already a constant. This saves on > having > to allocate when not needed. > > All frees of the hist_field->type will need to use kfree_const(). > > Suggested-by: Masami Hiramatsu <mhiramat@kernel.org> > Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Looks good to me.
Thanks,
Reviewed-by: <zanussi@kernel.org>
| |