Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp3004228lqz; Wed, 3 Apr 2024 15:20:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUKe1d03E0+8PXC3QbcNzgoh4hn6nrCjp7yqWoNjR8rUV6cyTsOQZnCsoOhUuepd6QYQuas6MQKpRmmDLkoVBEA1TW4ZHeh8j858Yh20A== X-Google-Smtp-Source: AGHT+IGgRsmhqQT6Je/fK4KPZBqY2Uzj2j7pyfco/39Qfa6hUkvO0kWWieuhwePWLbJXeohirdHz X-Received: by 2002:a05:6214:2388:b0:692:494f:f0aa with SMTP id fw8-20020a056214238800b00692494ff0aamr1598658qvb.9.1712182820947; Wed, 03 Apr 2024 15:20:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712182820; cv=pass; d=google.com; s=arc-20160816; b=khNN6KFqhUKj5rqXZ9iTbkvD5KnQix1BvGGrlCCpdPMZliBhubhM2+ZYWunC+BpwQn qAtxoiCXjcyJgpZljEWTKuXUky0R8cmWNWemGJiSHcuWCi0v2xxijxp4X2mhEKfupOWw a0n2MDi8SJeQhbkb/4GTSfm98fiFaMPWEpJATL83RL3X8/FfLRa9TUvKEozl8xFo6m5q sSivY5asKVA7PyuYTOHX9Rj21nI6Zk6P2G7Gm5HCYnH5efparlOj0oD2YE3GzDQ2TT4b GK1xbEEdOMjN43p3D5vvIAKf7ABCht34Pze05MxxE1lLPcHO3nmVyLXC0Js1BitTSrSs ZUxg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:subject:cc:to:from:date:references :in-reply-to:message-id:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:user-agent:feedback-id:dkim-signature :dkim-signature; bh=Xbt92os27lL5H9pYrJJJSECna8SqfJoMjVwzgkuyoZM=; fh=ZWulpt5aN9Xzs75Dbon/nNjyHomN70owWwlFwwhDRvg=; b=w7t87Xe85Mlij9IAs+r4aMpAEezYF1EeuHXBAEvBVn49Tgm6sw4fP42tHWrznArv4C Wt5PB27+JyZqqUjesRbcyU0ZWfONwgUfkv24qlRqXYNNuBhNKYoQo5azptTReRhbfHON XpXsXeI1gRPrmv4gEWlBbP8KdbIezt5xXOfJx7kaQnLyB7Erhky5qeCkB6UEbs8JJkcw O0lnEOd/sJWi1CQ9tI6QkVr+EXeY7w8dyaWVJTEzHikhHSK4vi1HObJsxOCRW5vohBQ+ QRm5YqGZIjjzAyWZwNIjvDqbU3wr0Y9j/sc6hGDkCWJ6zpvEyXEAu27+uRYCwO9XPwXc gFZg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=cJesWQV6; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=wvGu6xtO; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-130674-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130674-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h7-20020a0cf8c7000000b0069932468fccsi89168qvo.423.2024.04.03.15.20.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 15:20:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130674-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=cJesWQV6; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=wvGu6xtO; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-130674-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130674-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 337331C23B0F for ; Wed, 3 Apr 2024 22:20:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 15D23156980; Wed, 3 Apr 2024 22:20:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="cJesWQV6"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="wvGu6xtO" Received: from wfout6-smtp.messagingengine.com (wfout6-smtp.messagingengine.com [64.147.123.149]) (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 33919156257; Wed, 3 Apr 2024 22:20:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.149 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712182812; cv=none; b=nKm2/1omOXYBtHGGconP4FtZYBbahrTXznjEvwivwgMzUA93Uea93ftPW5YV1d6GoKMAmyCzhlaGxBNzKstJ0b3/g2abkob//+wIbzTZdSYTsFeE9D5RtMKFhr6v0L5wcQIr6rK8jLI1Gp3W7hpr2pR/A+HPi2ltTJgnsp9POFs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712182812; c=relaxed/simple; bh=lhxZXpWe2OEgaHRkPZP3vfJA0SWyKK989dfzTEI4d+g=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=la9R95PsZ46GDAhU18WqDtEj9O/x0ubIaMcyTLLXX5gG2lahpNW6Ino+bOr63AntW0pAEhKTQJu1HTbiO2oGjusvKMf8O7cJJUcZGufnetkJMnRgEfOef02pqPj5vPlQeKXxV9HAArrjSZNlkICwifPqHiy0dpmu3/+0q/uCzNk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=cJesWQV6; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=wvGu6xtO; arc=none smtp.client-ip=64.147.123.149 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.west.internal (Postfix) with ESMTP id E66511C000D6; Wed, 3 Apr 2024 18:20:05 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Wed, 03 Apr 2024 18:20:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1712182805; x=1712269205; bh=Xbt92os27lL5H9pYrJJJSECna8SqfJoMjVwzgkuyoZM=; b= cJesWQV6sdI6FrzfX4Lid/lEGt6FnxnOnyh9gq0kDbchrgT68okmI4OuEg1r492/ DQCj2kqFBdSg9f4v6PxKlwP3WJ0O2Gvq5+2rWETAzirKeRMxX4S6fuckou+9DtfQ UHcn/mNG6lnEE6byR7hr+uy7geJK8si93XjFbB5FNiFhY4rrKiS7H8jKjBdZjnY5 UJsWFBC6TVig2jTzaxJiLECLQCw5EoiutJJw8v9tKcjnCwyZc098EWgIuqvwIyG9 mND4GEj/1BxLEBB0LBRffwARQftQftUvvaV+0OP7hhITzN2AEtNUvKw0X+nP/E4S uYss4K1DglH6KZ5SYYt7hA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1712182805; x= 1712269205; bh=Xbt92os27lL5H9pYrJJJSECna8SqfJoMjVwzgkuyoZM=; b=w vGu6xtOGcCz9d9iyhRkHEdJk+qDMi9unSaDst+Fg2yk7d3lTD7aYZC7WkjS0PhC/ gOdopkn+KZthmg9+FTE/uRJ5yF36BuWnIFtd8C5kV8XJHaORKs+591FbtVBYxJ0h mpHmNItIxNT3WTJzXS1+TxYkeXpKx746regGbPsBvsMB+YPCIfIDyy0ntAq/urEz RrohZpr2o03YQ8aPUh3EWbRcT4xNfSmNf6RZiQna6io7rOTC5+jx03MOYe0wCTGe 3XWNGWtwEchsbzLSfYtNuAmjAyhxsrA9Vwg31AHT63Fi7cbB73fc1BDDkYOn+emM upWAjEMBBVe8kEUWMagxQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefjedguddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtgfesthhqredtreerjeenucfhrhhomhepfdet rhhnugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrg htthgvrhhnpeegfeejhedvledvffeijeeijeeivddvhfeliedvleevheejleetgedukedt gfejveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grrhhnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 05200B60092; Wed, 3 Apr 2024 18:20:04 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-333-gbfea15422e-fm-20240327.001-gbfea1542 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: In-Reply-To: References: <20240403080702.3509288-1-arnd@kernel.org> <20240403080702.3509288-32-arnd@kernel.org> <5f3qvhasho4mfnf6f7i6djak3ankje375mt4fzvv3gqrlj242o@zdk2ajvha6hx> Date: Thu, 04 Apr 2024 00:19:41 +0200 From: "Arnd Bergmann" To: "Andy Shevchenko" , =?UTF-8?Q?Uwe_Kleine-K=C3=B6nig?= Cc: "Mark Brown" , "Arnd Bergmann" , linux-kernel@vger.kernel.org, "Neil Armstrong" , "Kevin Hilman" , =?UTF-8?Q?Heiko_St=C3=BCbner?= , "Andi Shyti" , "Krzysztof Kozlowski" , "Jerome Brunet" , "Martin Blumenstingl" , "Alim Akhtar" , "Li Zetao" , "Jonathan Cameron" , "Rob Herring" , "Yang Yingliang" , "Andy Shevchenko" , "Luis de Arquer" , "Tudor Ambarus" , "Sam Protsenko" , "Peter Griffin" , "Jaewon Kim" , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: Re: [PATCH 31/34] spi: remove incorrect of_match_ptr annotations Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable On Wed, Apr 3, 2024, at 23:13, Andy Shevchenko wrote: > Wed, Apr 03, 2024 at 11:05:51PM +0200, Uwe Kleine-K=C3=B6nig kirjoitti: >> On Wed, Apr 03, 2024 at 10:56:58AM +0100, Mark Brown wrote: >> > On Wed, Apr 03, 2024 at 10:06:49AM +0200, Arnd Bergmann wrote: >> >=20 >> > > These appear to all be copied from the same original driver, so f= ix them at the >> > > same time by removing the unnecessary of_match_ptr() annotation. = As far as I >> > > can tell, all these drivers are only actually used on configurati= ons that >> > > have CONFIG_OF enabled. >> >=20 >> > Why are we not fixing of_match_ptr() here, or at least adding the i= fdefs >> > in case someone does end up wanting to run without OF? >>=20 >> Fixing of_match_ptr =3D >>=20 >> diff --git a/include/linux/of.h b/include/linux/of.h >> index a0bedd038a05..d980bccffda0 100644 >> --- a/include/linux/of.h >> +++ b/include/linux/of.h >> @@ -890,7 +890,7 @@ static inline const void *of_device_get_match_dat= a(const struct device *dev) >> return NULL; >> } >> =20 >> -#define of_match_ptr(_ptr) NULL >> +#define of_match_ptr(_ptr) (0 ? (_ptr) : NULL) This would require removing several hundred "#ifdef CONFIG_OF" checks around the of_device_id tables at the same time unfortunately. Most of those are completely unnecessary, so if we wanted to remove those, we should remove the of_match_ptr() instances at the same time. >> #define of_match_node(_matches, _node) NULL >> #endif /* CONFIG_OF */ >> =20 >> ? >>=20 >> Assuming this helps, I agree this would be the better fix. > > Why? I mean why do we need to even have this API? It's always > good to know which devices are supported by the module even > if you have no need in such support or it's not compiled in. > One of the reasons why is to be able to google for compatible hardware, > for example. As far as I can tell, the of_match_ptr() helper was a historic mistake, it makes pretty much no sense in its current form. The version that Uwe proposes would have made sense but we can't change it now. Arnd