From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4CF6255E6C; Mon, 8 Jan 2024 22:22:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44196C433C7; Mon, 8 Jan 2024 22:22:00 +0000 (UTC) Date: Mon, 8 Jan 2024 17:22:56 -0500 From: Steven Rostedt To: Beau Belgrave Cc: LKML , Linux Trace Kernel , Masami Hiramatsu , Mathieu Desnoyers Subject: Re: [PATCH] tracing user_events: Simplify user_event_parse_field() parsing Message-ID: <20240108172256.48ebc777@gandalf.local.home> In-Reply-To: <20240108171312.475190cf@gandalf.local.home> References: <20240108133723.031cf322@gandalf.local.home> <20240108214744.GA100-beaub@linux.microsoft.com> <20240108171312.475190cf@gandalf.local.home> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 8 Jan 2024 17:13:12 -0500 Steven Rostedt wrote: > On Mon, 8 Jan 2024 21:47:44 +0000 > Beau Belgrave 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) Note that checkpatch is a guideline and not a rule. The general rule is, if the code looks worse when applying the checkpatch rule, don't do it. - Steve