linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tracing: fix comments of event_trigger_separate_filter()
@ 2022-05-23  7:51 slm
  2022-05-25 15:51 ` Steven Rostedt
  0 siblings, 1 reply; 3+ messages in thread
From: slm @ 2022-05-23  7:51 UTC (permalink / raw)
  To: mingo, rostedt; +Cc: linux-kernel, kelulanainsley, sunliming

The parameter name in comments of event_trigger_separate_filter()
is inconsistent with actual parameter name, fix it.

Signed-off-by: slm <sunliming@kylinos.cn>
---
 kernel/trace/trace_events_trigger.c | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c
index 21592bed2e89..c364dc729339 100644
--- a/kernel/trace/trace_events_trigger.c
+++ b/kernel/trace/trace_events_trigger.c
@@ -738,27 +738,28 @@ bool event_trigger_empty_param(const char *param)
 
 /**
  * event_trigger_separate_filter - separate an event trigger from a filter
- * @param: The param string containing trigger and possibly filter
- * @trigger: outparam, will be filled with a pointer to the trigger
+ * @param_and_filter: The param_and_filter string containing trigger
+ * and possibly filter
+ * @param: outparam, will be filled with a pointer to the trigger
  * @filter: outparam, will be filled with a pointer to the filter
  * @param_required: Specifies whether or not the param string is required
  *
  * Given a param string of the form '[trigger] [if filter]', this
  * function separates the filter from the trigger and returns the
- * trigger in *trigger and the filter in *filter.  Either the *trigger
+ * trigger in *param and the filter in *filter.  Either the *param
  * or the *filter may be set to NULL by this function - if not set to
  * NULL, they will contain strings corresponding to the trigger and
  * filter.
  *
  * There are two cases that need to be handled with respect to the
- * passed-in param: either the param is required, or it is not
- * required.  If @param_required is set, and there's no param, it will
- * return -EINVAL.  If @param_required is not set and there's a param
- * that starts with a number, that corresponds to the case of a
- * trigger with :n (n = number of times the trigger should fire) and
- * the parsing continues normally; otherwise the function just returns
- * and assumes param just contains a filter and there's nothing else
- * to do.
+ * passed-in param_and_filter: either the param is required, or
+ * it is not required.  If @param_required is set, and there's no
+ * param, it will return -EINVAL.  If @param_required is not set
+ * and there's a param_and_filter that starts with a number, that
+ * corresponds to the case of a trigger with :n (n = number of times
+ * the trigger should fire) and the parsing continues normally;
+ * otherwise the function just returns and assumes param_and_filter
+ * just contains a filter and there's nothing else to do.
  *
  * Return: 0 on success, errno otherwise
  */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tracing: fix comments of event_trigger_separate_filter()
  2022-05-23  7:51 [PATCH] tracing: fix comments of event_trigger_separate_filter() slm
@ 2022-05-25 15:51 ` Steven Rostedt
  2022-05-26  1:01   ` sunliming
  0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2022-05-25 15:51 UTC (permalink / raw)
  To: slm; +Cc: mingo, linux-kernel, sunliming, Tom Zanussi

On Mon, 23 May 2022 15:51:23 +0800
slm <kelulanainsley@gmail.com> wrote:

> The parameter name in comments of event_trigger_separate_filter()
> is inconsistent with actual parameter name, fix it.
> 
> Signed-off-by: slm <sunliming@kylinos.cn>

Signed off by must have your full name. I doubt "slm" is your full name.

> ---
>  kernel/trace/trace_events_trigger.c | 23 ++++++++++++-----------
>  1 file changed, 12 insertions(+), 11 deletions(-)
> 
> diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c
> index 21592bed2e89..c364dc729339 100644
> --- a/kernel/trace/trace_events_trigger.c
> +++ b/kernel/trace/trace_events_trigger.c
> @@ -738,27 +738,28 @@ bool event_trigger_empty_param(const char *param)
>  
>  /**
>   * event_trigger_separate_filter - separate an event trigger from a filter
> - * @param: The param string containing trigger and possibly filter
> - * @trigger: outparam, will be filled with a pointer to the trigger
> + * @param_and_filter: The param_and_filter string containing trigger
> + * and possibly filter

The parameter description should be contained to a single line. No need to
say "The param_and_filter".


> + * @param: outparam, will be filled with a pointer to the trigger
>   * @filter: outparam, will be filled with a pointer to the filter
>   * @param_required: Specifies whether or not the param string is required
>   *
>   * Given a param string of the form '[trigger] [if filter]', this
>   * function separates the filter from the trigger and returns the
> - * trigger in *trigger and the filter in *filter.  Either the *trigger
> + * trigger in *param and the filter in *filter.  Either the *param

If you are updating this, then it should be:

    trigger in @param and the filter in @filter.

As they are referencing parameters which need the "@" notation.

>   * or the *filter may be set to NULL by this function - if not set to

And that includes the above as well.

>   * NULL, they will contain strings corresponding to the trigger and
>   * filter.
>   *
>   * There are two cases that need to be handled with respect to the
> - * passed-in param: either the param is required, or it is not
> - * required.  If @param_required is set, and there's no param, it will
> - * return -EINVAL.  If @param_required is not set and there's a param
> - * that starts with a number, that corresponds to the case of a
> - * trigger with :n (n = number of times the trigger should fire) and
> - * the parsing continues normally; otherwise the function just returns
> - * and assumes param just contains a filter and there's nothing else
> - * to do.
> + * passed-in param_and_filter: either the param is required, or

As "param" did not have a "@" in front of it, that means it did not
represent the parameter.

> + * it is not required.  If @param_required is set, and there's no
> + * param, it will return -EINVAL.  If @param_required is not set
> + * and there's a param_and_filter that starts with a number, that
> + * corresponds to the case of a trigger with :n (n = number of times
> + * the trigger should fire) and the parsing continues normally;
> + * otherwise the function just returns and assumes param_and_filter
> + * just contains a filter and there's nothing else to do.

And there's still more space to use, as the biggest line is only 70
characters and we allow 80.

-- Steve

>   *
>   * Return: 0 on success, errno otherwise
>   */


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tracing: fix comments of event_trigger_separate_filter()
  2022-05-25 15:51 ` Steven Rostedt
@ 2022-05-26  1:01   ` sunliming
  0 siblings, 0 replies; 3+ messages in thread
From: sunliming @ 2022-05-26  1:01 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: mingo, linux-kernel, sunliming, Tom Zanussi

Steven Rostedt <rostedt@goodmis.org> 于2022年5月25日周三 23:51写道:
>
> On Mon, 23 May 2022 15:51:23 +0800
> slm <kelulanainsley@gmail.com> wrote:
>
> > The parameter name in comments of event_trigger_separate_filter()
> > is inconsistent with actual parameter name, fix it.
> >
> > Signed-off-by: slm <sunliming@kylinos.cn>
>
> Signed off by must have your full name. I doubt "slm" is your full name.
>
> > ---
> >  kernel/trace/trace_events_trigger.c | 23 ++++++++++++-----------
> >  1 file changed, 12 insertions(+), 11 deletions(-)
> >
> > diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c
> > index 21592bed2e89..c364dc729339 100644
> > --- a/kernel/trace/trace_events_trigger.c
> > +++ b/kernel/trace/trace_events_trigger.c
> > @@ -738,27 +738,28 @@ bool event_trigger_empty_param(const char *param)
> >
> >  /**
> >   * event_trigger_separate_filter - separate an event trigger from a filter
> > - * @param: The param string containing trigger and possibly filter
> > - * @trigger: outparam, will be filled with a pointer to the trigger
> > + * @param_and_filter: The param_and_filter string containing trigger
> > + * and possibly filter
>
> The parameter description should be contained to a single line. No need to
> say "The param_and_filter".
>
>
> > + * @param: outparam, will be filled with a pointer to the trigger
> >   * @filter: outparam, will be filled with a pointer to the filter
> >   * @param_required: Specifies whether or not the param string is required
> >   *
> >   * Given a param string of the form '[trigger] [if filter]', this
> >   * function separates the filter from the trigger and returns the
> > - * trigger in *trigger and the filter in *filter.  Either the *trigger
> > + * trigger in *param and the filter in *filter.  Either the *param
>
> If you are updating this, then it should be:
>
>     trigger in @param and the filter in @filter.
>
> As they are referencing parameters which need the "@" notation.
>
> >   * or the *filter may be set to NULL by this function - if not set to
>
> And that includes the above as well.
>
> >   * NULL, they will contain strings corresponding to the trigger and
> >   * filter.
> >   *
> >   * There are two cases that need to be handled with respect to the
> > - * passed-in param: either the param is required, or it is not
> > - * required.  If @param_required is set, and there's no param, it will
> > - * return -EINVAL.  If @param_required is not set and there's a param
> > - * that starts with a number, that corresponds to the case of a
> > - * trigger with :n (n = number of times the trigger should fire) and
> > - * the parsing continues normally; otherwise the function just returns
> > - * and assumes param just contains a filter and there's nothing else
> > - * to do.
> > + * passed-in param_and_filter: either the param is required, or
>
> As "param" did not have a "@" in front of it, that means it did not
> represent the parameter.
>
> > + * it is not required.  If @param_required is set, and there's no
> > + * param, it will return -EINVAL.  If @param_required is not set
> > + * and there's a param_and_filter that starts with a number, that
> > + * corresponds to the case of a trigger with :n (n = number of times
> > + * the trigger should fire) and the parsing continues normally;
> > + * otherwise the function just returns and assumes param_and_filter
> > + * just contains a filter and there's nothing else to do.
>
> And there's still more space to use, as the biggest line is only 70
> characters and we allow 80.
>
> -- Steve
>
> >   *
> >   * Return: 0 on success, errno otherwise
> >   */
>
I got it. Thanks for your review.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-26  1:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-23  7:51 [PATCH] tracing: fix comments of event_trigger_separate_filter() slm
2022-05-25 15:51 ` Steven Rostedt
2022-05-26  1:01   ` sunliming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).