Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1901686rdb; Mon, 8 Jan 2024 14:22:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IEgrXBf+T+auZvt8+9bfOucu0OcXsd3IHTT49KoYdhAYTMYlsF6ONagjEHA1IQGGcpgP5Ac X-Received: by 2002:a17:906:2549:b0:a29:1648:6030 with SMTP id j9-20020a170906254900b00a2916486030mr40466ejb.86.1704752529639; Mon, 08 Jan 2024 14:22:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704752529; cv=none; d=google.com; s=arc-20160816; b=PpKJsKCo2bWCHMEeOS44XZtZHoyoq2BpEJvjXKMoyMxpvyJWMqJWNKUs0ZTPAnIDW+ 2bCdxLtIMFYov69BepwyawZ3BM5auHwFYwB0FLHmcJqLYmZn8zQks8EK5531Cj6SYhRg Bf2Lfv3c6407bk7U5qcZHlUv0cQUR+BsMNno05df+ccMOJXNILq46KD4nq0rIQx6UV5y 65OyQGdeufQNDnF5dCGQdA4PefqMrq8Xrv1++KyPW7IrIaMf7ZyYcLnQWCk676H36qUc HxlzSkfnMSlbGt/YIOsQxOBYdnZao8rW2gPREmxAN03lasJgByOjD127ey+HrQMznbzi qRrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=ljlSgp1rfkhs/dg5n2mnkJy6B5Yw3BfTchme9uCqi7I=; fh=S4OnhFRbzhmZXN9l8LpGN169h0V4ZsmOE0pv0MJ+ZNM=; b=YrFclZevRvb4MZwL0nTBOnBVK2BGeg+MJvyq5aRNjGvbSpm7HZiJO8/RZ+Ns0ySuV0 EfDzjtCloEjO0Y5/U2WErMSr2/9LB5FzPQ8cNvXqcWFoV1H/+i0LXYq9TVKCw1DjnHHl wdjXHGrTpW2vReHayv4zZ6MgqtD22oKwUI+ufWID/80YfAyC4y8H0+F+t1/iNIRjVT9E bveBZp3EiL1i899A1uTDfZei1l8rSAM9t0ZblW/p42qMN9URPrEpKoAKknOTSeWXbXdA SlMxLuA2hD0F3TJcKzE9KIsIr9g8Y3AzqiB7xbl3K77xEg8cqPfjgnOAtima5dq6miyw gQ5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-20145-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20145-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id k8-20020a1709062a4800b00a2a1aac18fcsi258346eje.316.2024.01.08.14.22.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 14:22:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20145-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-20145-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20145-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 56F0D1F23F05 for ; Mon, 8 Jan 2024 22:22:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BF79B56469; Mon, 8 Jan 2024 22:22:01 +0000 (UTC) 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-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