Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1897956rdb; Mon, 8 Jan 2024 14:12:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IE83e3Gd0fQUz5S9Au7ZpY1opM2u3woaJY8MOtF2tn/dE5n8ArhTyUgtn0rl3E4d7uASRjN X-Received: by 2002:a05:6a20:1612:b0:199:dab1:f4e7 with SMTP id l18-20020a056a20161200b00199dab1f4e7mr1027938pzj.32.1704751943776; Mon, 08 Jan 2024 14:12:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704751943; cv=none; d=google.com; s=arc-20160816; b=A04spJ9ChNnLAA+gAk5cxQjhDGXtXmQMtt5DGWK3WFY1D9F0IPNXhHhQajbFWTf7E6 83Vv3mX/8pSLNshVsxP74Ttc/arV6OrhaCLRXt3eUsoBa8KXX9Ll0vNGCoG2q+6jXHBJ Jqvs7RTlHZGQgt1+Is6kfev43oi5P+5E/8nXA9xnOOapGRA5FQ7f24jLl3mtQ0b4117L 0uQ8R6UEYIwifWp5VYo84iRhxW9WbDiiNIhnKPOQ30+NaXuZ9ZMolXoFE+zt/AzgSAe/ LeN5GPyR37OL2GuUdwZU/Hte1seexY4OFFL9CvQTCgUgx2sKzy3PepJKHQnym8gbSpLR CLsA== 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=XZ0dFzGYTCy60lwojxUObMXXj1/VPIbjpGfWa24ou6g=; fh=S4OnhFRbzhmZXN9l8LpGN169h0V4ZsmOE0pv0MJ+ZNM=; b=U7ZfkCIwCzwivx/LZ0ip8DM8PkPHDEEfqLl+H7UjwQkjWmZAxqLkNRu51cOBKVuz0X N1hY5DVJ0MezBZAbCmvo55Q8uvmEU4kvOrNORRsrhV1iCKgMRgdoHRWZEJeznTh174v1 7u5TZFAmuYS/BruoMQyH1bYjLwUXUYbEjy4vLSg5K6xYUmGQJ7KcrmD2IX5VT6St4VbP qyt3GhEbhUbp5K71Wu93F2zlpRfj1z4Hw+S8EvTQUb1+Wr+yR4AOgmIZMnYANvIQfp5I cfw1U/jN8uTVqC2HORr048c1LBTcEW0TiaKn1rnUq9F5EeJvyUPqoNzjoSEp0PbqSCrf OH0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-20143-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20143-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 16-20020a17090a0f1000b0028c3042a7c2si501808pjy.47.2024.01.08.14.12.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 14:12:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20143-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-20143-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20143-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 5B87F282B8F for ; Mon, 8 Jan 2024 22:12:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C5FCD56467; Mon, 8 Jan 2024 22:12:17 +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 55FA355776; Mon, 8 Jan 2024 22:12:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3031CC433C7; Mon, 8 Jan 2024 22:12:16 +0000 (UTC) Date: Mon, 8 Jan 2024 17:13:12 -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: <20240108171312.475190cf@gandalf.local.home> In-Reply-To: <20240108214744.GA100-beaub@linux.microsoft.com> References: <20240108133723.031cf322@gandalf.local.home> <20240108214744.GA100-beaub@linux.microsoft.com> 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 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) > 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