Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2974439lqz; Wed, 3 Apr 2024 14:13:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW2odJ2J7OGV3BTEC4/FFEeEpsMr1hN6XXhRG4437b5B9oxw5aCg16xwIv5fb4g9YgLnEqCJYfdHteka2HVWVWM91pGjI4BwH6N47ARwQ== X-Google-Smtp-Source: AGHT+IHASB6oHVUi/Bo2LW89f40ZiU9vyEpYQ0ZSZJCf/2SqIJ0F4YKYQJpML/o3YW1qsI90Ohnd X-Received: by 2002:a17:903:1c7:b0:1e0:999f:c9bf with SMTP id e7-20020a17090301c700b001e0999fc9bfmr569937plh.47.1712178819155; Wed, 03 Apr 2024 14:13:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712178819; cv=pass; d=google.com; s=arc-20160816; b=STFCG81yLQ5NGMVeCTrY7orW0MOLXGvsITjdb4PYmhQLdbI1ngDX80CcwdMkeTiUCH wyx2M/YcvJQFqfQe1Dw+OGh0SzAkszfzFGJSEcKLabXC9w4eXhyLQIwFs0q4GemstYMs ihxqZpIlgMR7QjzQ9XNkCLdPYIrvklOnaVKupPDMaIcL2HXyN6L66PTpvKSY8jSCVk5/ EoN2GjCB0IFdy6TBraBmp/OmAEG+RtgARByIFuTr26xCZgZ19twFeJwrx3phUaie9Ebi phDWwcAMWxjuIou9d2OgUwvMhf0bot0DUirlEN8TElk3W9a/1Y5eP/FTJdAt7GRiagqB DwAg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:date:from; bh=O0H7+h/C8fX+q7uhD4YOn9fRN66oIwlGb0NoKRq2vWo=; fh=MLR15/twTPTeWwlPs5RnroEVWQrToXLm3TkNrj/vy1c=; b=r3tHwmeenusS6p+5LsLQXP6pQemlU00orvqpRi7T4VBn3sV+l3OwH+C8iXuhF7zytI iBHI6k5o3B+mXbOVjhcfMC8PWhu7QNLVLx7KpmpeZZtwDP710mm9zwdGetsVwzLQs7vg 5t+kJUAiwlR7CkLXNZsVeFqc1XW9Ink34s8YDK7gkoRe5kqUULWfAy+I1wrrgi1s/1Gs aYLtpvE7eAJdrivGOphwcVAYFrxAiAOGPS8d3l9HSqT1JLAXaoVgdWmOkpnX3JdhCv3Y g6xiX7IBMps09YMWDblN61akVsDy8HQbUkwIE1m23X4VQDUAQAvABruFVsJ9I8bGjnpC tkCg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-130609-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130609-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id a17-20020a170902ecd100b001de256e5d6esi14051600plh.534.2024.04.03.14.13.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 14:13:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130609-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-130609-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130609-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 BD1AC2830C6 for ; Wed, 3 Apr 2024 21:13:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8696F156665; Wed, 3 Apr 2024 21:13:33 +0000 (UTC) Received: from fgw22-7.mail.saunalahti.fi (fgw22-7.mail.saunalahti.fi [62.142.5.83]) (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 74B6115664A for ; Wed, 3 Apr 2024 21:13:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.83 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712178813; cv=none; b=usTUvHBOqZgy6Oq5CYEyR+vluEDjh+l0RGdwP34Np8ecT6hPFO6EFjCDNeOi3UGjSd5wTw0X/gETj+nv1YeL9AiJqvP7J49UtfVZcWG0F8RzMtBX8efOt0SJVkTG0+fkWq13WqrD3qBPaL0hlerT0VMa1Z3dXKfk34V/+EPVYfE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712178813; c=relaxed/simple; bh=eupMfwrp+Cz8ikeI7PjS0/ZKJUeLsKmYnSUICd//p3g=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fzNxndlvi40B8bqeJoirsD3fA2ivmlwZAugQO2NsEAfTdo8MI9+vFsYmSzJUaxlEfCIU4ovy4lo2HgAMlsG40vDieFmXhvo/aS5Hqs8lcvMTm9abaMDRE88AP9g10Ny/JdvqwFca9hJWn7h2RltLfrm8OZRtdUdUdZekLVa4iEU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.83 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-217.elisa-laajakaista.fi [88.113.26.217]) by fgw22.mail.saunalahti.fi (Halon) with ESMTP id 0290e41f-f1ff-11ee-a9de-005056bdf889; Thu, 04 Apr 2024 00:13:28 +0300 (EEST) From: Andy Shevchenko Date: Thu, 4 Apr 2024 00:13:25 +0300 To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Mark Brown , Arnd Bergmann , linux-kernel@vger.kernel.org, Neil Armstrong , Kevin Hilman , Heiko Stuebner , Andi Shyti , Krzysztof Kozlowski , Arnd Bergmann , 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 Message-ID: References: <20240403080702.3509288-1-arnd@kernel.org> <20240403080702.3509288-32-arnd@kernel.org> <5f3qvhasho4mfnf6f7i6djak3ankje375mt4fzvv3gqrlj242o@zdk2ajvha6hx> 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5f3qvhasho4mfnf6f7i6djak3ankje375mt4fzvv3gqrlj242o@zdk2ajvha6hx> Wed, Apr 03, 2024 at 11:05:51PM +0200, Uwe Kleine-K?nig 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: > > > > > These appear to all be copied from the same original driver, so fix 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 configurations that > > > have CONFIG_OF enabled. > > > > Why are we not fixing of_match_ptr() here, or at least adding the ifdefs > > in case someone does end up wanting to run without OF? > > Fixing of_match_ptr = > > 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_data(const struct device *dev) > return NULL; > } > > -#define of_match_ptr(_ptr) NULL > +#define of_match_ptr(_ptr) (0 ? (_ptr) : NULL) FWIW, we have PTR_IF() (with a side note to split it from kernel.h in a separate header or less twisted one). > #define of_match_node(_matches, _node) NULL > #endif /* CONFIG_OF */ > > ? > > 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. -- With Best Regards, Andy Shevchenko