Re: [PATCH v3] kernel/trace: fixed static warnings

From: Abhijith Sriram

Date: Mon Apr 06 2026 - 03:31:17 EST


On Mon, Apr 6, 2026 at 9:18 AM Masami Hiramatsu <mhiramat@xxxxxxxxxx> wrote:
>
> On Mon, 6 Apr 2026 08:00:36 +0200
> abhijithsriram95@xxxxxxxxx wrote:
>
> > From: Abhijith Sriram <abhijithsriram95@xxxxxxxxx>
> >
> > The change in the function argument description
> > was due to the static code checker script reading
> > the word filter back to back
> >
> > Changes in v2:
> > - corrected *m = file->private_data to m = file->private_data
> >
> > Changes in v3:
> > - reverted the changes for struct seq_file *m and
> > added a new empty line instead
> >
> > Signed-off-by: Abhijith Sriram <abhijithsriram95@xxxxxxxxx>
> > ---
> > kernel/trace/trace_events_trigger.c | 8 +++++---
> > new-changes | 6 ++++++
> > 2 files changed, 11 insertions(+), 3 deletions(-)
> > create mode 100644 new-changes
> >
> > diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c
> > index 655db2e82513..08adb593fcd9 100644
> > --- a/kernel/trace/trace_events_trigger.c
> > +++ b/kernel/trace/trace_events_trigger.c
> > @@ -246,7 +246,7 @@ event_triggers_post_call(struct trace_event_file *file,
> > }
> > EXPORT_SYMBOL_GPL(event_triggers_post_call);
> >
> > -#define SHOW_AVAILABLE_TRIGGERS (void *)(1UL)
> > +#define SHOW_AVAILABLE_TRIGGERS ((void *)(1UL))
> >
> > static void *trigger_next(struct seq_file *m, void *t, loff_t *pos)
> > {
> > @@ -352,6 +352,7 @@ static int event_trigger_regex_open(struct inode *inode, struct file *file)
> > ret = seq_open(file, &event_triggers_seq_ops);
> > if (!ret) {
> > struct seq_file *m = file->private_data;
> > +
> > m->private = file;
> > }
> > }
> > @@ -388,9 +389,9 @@ static ssize_t event_trigger_regex_write(struct file *file,
> > const char __user *ubuf,
> > size_t cnt, loff_t *ppos)
> > {
> > + char *buf __free(kfree) = NULL;
> > struct trace_event_file *event_file;
> > ssize_t ret;
> > - char *buf __free(kfree) = NULL;
>
> Again, this is not OK. Even if checkpatch.pl complained against this,
> there should be no problem. Only if you think this is not sorted by
> length, you can do:
Removed it in the new patch
>
> struct trace_event_file *event_file;
> + char *buf __free(kfree) = NULL;
> ssize_t ret;
> - char *buf __free(kfree) = NULL;
>
> This change is acceptable as a cosmetic change.
>
> >
> > if (!cnt)
> > return 0;
> > @@ -633,6 +634,7 @@ clear_event_triggers(struct trace_array *tr)
> >
> > list_for_each_entry(file, &tr->events, list) {
> > struct event_trigger_data *data, *n;
> > +
> > list_for_each_entry_safe(data, n, &file->triggers, list) {
> > trace_event_trigger_enable_disable(file, 0);
> > list_del_rcu(&data->list);
> > @@ -785,7 +787,7 @@ static void unregister_trigger(char *glob,
> > * cmd - the trigger command name
> > * glob - the trigger command name optionally prefaced with '!'
> > * param_and_filter - text following cmd and ':'
> > - * param - text following cmd and ':' and stripped of filter
> > + * param - text following cmd and ':' and filter removed
> > * filter - the optional filter text following (and including) 'if'
> > *
> > * To illustrate the use of these components, here are some concrete
> > diff --git a/new-changes b/new-changes
> > new file mode 100644
> > index 000000000000..9e3a24de3033
> > --- /dev/null
> > +++ b/new-changes
> > @@ -0,0 +1,6 @@
> > +Line 25 -> adding const to the pointer address as well.
> > +
> > +linw 1193 -> removing else because there is a return statement in the if condition
> > +line 1727 -> adding new line after statement
> > +line 1800 -> reordering to solve missing a blank line warning
> > +line 12364 -> changed the function to kstrtoul
> > \ No newline at end of file
>
> Is this your working note?
> Please remove it.
Removed it in the new patch
>
> Thank you,
>
> > --
> > 2.43.0
> >
>
>
> --
> Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
Thank you for your patience. I am still learning and trying to find my hold.
Here is the new patch version:
https://lore.kernel.org/linux-trace-kernel/20260406072834.243491-2-abhijithsriram95@xxxxxxxxx/T/#u
I will do my best to be more careful in the future :)


--
Regards
Abhijith Sriram