public inbox for linux-trace-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Beau Belgrave <beaub@linux.microsoft.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Linux Trace Kernel <linux-trace-kernel@vger.kernel.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Subject: Re: [PATCH] tracing user_events: Simplify user_event_parse_field() parsing
Date: Mon, 8 Jan 2024 17:13:12 -0500	[thread overview]
Message-ID: <20240108171312.475190cf@gandalf.local.home> (raw)
In-Reply-To: <20240108214744.GA100-beaub@linux.microsoft.com>

On Mon, 8 Jan 2024 21:47:44 +0000
Beau Belgrave <beaub@linux.microsoft.com> wrote:

> > -	len = str_has_prefix(field, "__rel_loc ");
> > -	if (len)
> > -		goto skip_next;
> > +	if (!(len = str_has_prefix(field, "__data_loc unsigned ")) &&
> > +	    !(len = str_has_prefix(field, "__data_loc ")) &&
> > +	    !(len = str_has_prefix(field, "__rel_loc unsigned ")) &&
> > +	    !(len = str_has_prefix(field, "__rel_loc "))) {
> > +		goto parse;
> > +	}  
> 
> This now triggers a checkpatch error:
> ERROR: do not use assignment in if condition

What a horrible message.

> #1184: FILE: kernel/trace/trace_events_user.c:1184:
> +       if (!(len = str_has_prefix(field, "__data_loc unsigned ")) &&
> 
> I personally prefer to keep these files fully checkpatch clean.

I've stopped using checkpatch years ago because I disagreed with so much it :-p
  (Including this message)

> However, I did test these changes under the self-tests and it passed.
> 
> Do they bug you that much? :)

No big deal if you prefer the other way. I was just doing an audit of
str_has_prefix() to see what code could be cleaned up that uses it, and I
found this code.

If you prefer to limit your code to "checkpatch clean", I'll leave it alone.

-- Steve

  reply	other threads:[~2024-01-08 22:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-08 18:37 [PATCH] tracing user_events: Simplify user_event_parse_field() parsing Steven Rostedt
2024-01-08 21:47 ` Beau Belgrave
2024-01-08 22:13   ` Steven Rostedt [this message]
2024-01-08 22:22     ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240108171312.475190cf@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=beaub@linux.microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox