Message ID | 20221124161618.34ca07b3@endymion.delvare |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3458012wrr; Thu, 24 Nov 2022 07:20:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf5h9znUpE5t/RkNGzFI+Crpv/lavoH1vO6KA6sxhq3UBHWOvRWHlb/lglc/Xp1YIm++ZjxW X-Received: by 2002:a05:6402:4311:b0:458:c66a:3664 with SMTP id m17-20020a056402431100b00458c66a3664mr16598177edc.79.1669303242842; Thu, 24 Nov 2022 07:20:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669303242; cv=none; d=google.com; s=arc-20160816; b=LVeu5rLXJpzXWjiO+SpsEiqkxjQeyDceudOiDLSxHBp/Ckvh0OcPLPLiMyac6AYGDY GdwS3V4my2DKa+n+9omay860oIPwCtBjiLNnv//O9CugyU7QzwlqQU7yS5ZvL/RDWNVO QxAziJcjsdnDEOUqXDBqY9TaBcmxlO3dGtF2fKRlZBZslBLDRJqNDcetWUAmjDaK8PDd Oxhx5UW4afqJZUPC+YJ2CcNrYHRabv5BzLZcVFPFSdMf99D6zCabdciZsmb0K2aOoXCS B7vLUd6LLJWHqSmH1bCg+gOEPi7DbLHTNhxnoWNjnA/+RbqdG3DcXEXfWtv3I33DEKh7 hApQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=lFWIP7ovUYBT8Xkxu4psBSN8B2MwPFxyKnu9NZvDse8=; b=c++WRYQVk+aRIgLB5aV0SUM89yeaI/QocgXdMEXRkdQN11QZ6POY2eOHjh8TTmbOng wbU7TNdlGLqjx6Ds+J8IVKVVIDGsoOCQbycQh7EIrOF1YPqcmb3JDZS4CYzPHlaKZgW9 USp3HVwZqt9KUrw55XE3HDIRiRwbkhW4ZzF1JEEHeMQHmTVyVFwDXU+HKTcPbgBU7FVa LtmoEwWU40JBpByBmGs7iK/cZ4bpFSjmDoHJUytjIGUZWlWTuki2pvsJDgBrJIu9LjUD DUc1vcT72P3q6CsMb5AB88RP0Ml+1fTh1oAOUMP75UiYJZahbFK+bwrJ9Xemy0L1Saba wpqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=h5dS5qqv; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sh38-20020a1709076ea600b007ae4717bf1esi1101136ejc.99.2022.11.24.07.20.18; Thu, 24 Nov 2022 07:20:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=h5dS5qqv; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229850AbiKXPRO (ORCPT <rfc822;fengqi706@gmail.com> + 99 others); Thu, 24 Nov 2022 10:17:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbiKXPRJ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 24 Nov 2022 10:17:09 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5270316E8D9 for <linux-kernel@vger.kernel.org>; Thu, 24 Nov 2022 07:16:21 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 112C621AAE; Thu, 24 Nov 2022 15:16:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1669302980; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lFWIP7ovUYBT8Xkxu4psBSN8B2MwPFxyKnu9NZvDse8=; b=h5dS5qqvRG1CQZDiISI0EJAo07yH6fMI3KCARQnzvdnaSo1MajGwR1WnW1+vNnhUZuzjwT rR8XHJ19Wy+/a7Aclkw3rdlQ9bPu+4ZzeckQYUamOzpB3pgbALzPxafyyofxqqDyDRTnNC DNtp6V//zgSlRXcPXuQsVjjJ0Fu3j3c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1669302980; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lFWIP7ovUYBT8Xkxu4psBSN8B2MwPFxyKnu9NZvDse8=; b=iostWWR3qeJpqnrd2mviUerTNOOPeK0J82ozf4ZChq+tCpDONx/7rVFfpJseDGFv6Dqgj9 0DXiTBNxRP+NFrDg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D567B13488; Thu, 24 Nov 2022 15:16:19 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ZE2HMsOKf2PzYwAAMHmgww (envelope-from <jdelvare@suse.de>); Thu, 24 Nov 2022 15:16:19 +0000 Date: Thu, 24 Nov 2022 16:16:18 +0100 From: Jean Delvare <jdelvare@suse.de> To: LKML <linux-kernel@vger.kernel.org> Cc: Karol Gugala <kgugala@antmicro.com>, Mateusz Holenko <mholenko@antmicro.com>, Gabriel Somlo <gsomlo@gmail.com>, Joel Stanley <joel@jms.id.au> Subject: [PATCH] drivers/soc/litex: drop obsolete dependency on COMPILE_TEST Message-ID: <20221124161618.34ca07b3@endymion.delvare> Organization: SUSE Linux X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750391317494543992?= X-GMAIL-MSGID: =?utf-8?q?1750391317494543992?= |
Series |
drivers/soc/litex: drop obsolete dependency on COMPILE_TEST
|
|
Commit Message
Jean Delvare
Nov. 24, 2022, 3:16 p.m. UTC
Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), it
is possible to test-build any driver which depends on OF on any
architecture by explicitly selecting OF. Therefore depending on
COMPILE_TEST as an alternative is no longer needed.
It is actually better to always build such drivers with OF enabled,
so that the test builds are closer to how each driver will actually be
built on its intended target. Building them without OF may not test
much as the compiler will optimize out potentially large parts of the
code. In the worst case, this could even pop false positive warnings.
Dropping COMPILE_TEST here improves the quality of our testing and
avoids wasting time on non-existent issues.
As a minor optimization, this also lets us drop of_match_ptr() and
ifdef-guarding, as we now know what they will resolve to, we might as
well save cpp some work.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Karol Gugala <kgugala@antmicro.com>
Cc: Mateusz Holenko <mholenko@antmicro.com>
Cc: Gabriel Somlo <gsomlo@gmail.com>
Cc: Joel Stanley <joel@jms.id.au>
---
drivers/soc/litex/Kconfig | 2 +-
drivers/soc/litex/litex_soc_ctrl.c | 4 +---
2 files changed, 2 insertions(+), 4 deletions(-)
Comments
On Thu, Nov 24, 2022 at 04:16:18PM +0100, Jean Delvare wrote: > Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), it > is possible to test-build any driver which depends on OF on any > architecture by explicitly selecting OF. Therefore depending on > COMPILE_TEST as an alternative is no longer needed. > > It is actually better to always build such drivers with OF enabled, > so that the test builds are closer to how each driver will actually be > built on its intended target. Building them without OF may not test > much as the compiler will optimize out potentially large parts of the > code. In the worst case, this could even pop false positive warnings. > Dropping COMPILE_TEST here improves the quality of our testing and > avoids wasting time on non-existent issues. > > As a minor optimization, this also lets us drop of_match_ptr() and > ifdef-guarding, as we now know what they will resolve to, we might as > well save cpp some work. Acked-by: Gabriel Somlo <gsomlo@gmail.com> Thanks, --G > Signed-off-by: Jean Delvare <jdelvare@suse.de> > Cc: Karol Gugala <kgugala@antmicro.com> > Cc: Mateusz Holenko <mholenko@antmicro.com> > Cc: Gabriel Somlo <gsomlo@gmail.com> > Cc: Joel Stanley <joel@jms.id.au> > --- > drivers/soc/litex/Kconfig | 2 +- > drivers/soc/litex/litex_soc_ctrl.c | 4 +--- > 2 files changed, 2 insertions(+), 4 deletions(-) > > --- linux-6.0.orig/drivers/soc/litex/Kconfig > +++ linux-6.0/drivers/soc/litex/Kconfig > @@ -7,7 +7,7 @@ config LITEX > > config LITEX_SOC_CONTROLLER > tristate "Enable LiteX SoC Controller driver" > - depends on OF || COMPILE_TEST > + depends on OF > depends on HAS_IOMEM > select LITEX > help > --- linux-6.0.orig/drivers/soc/litex/litex_soc_ctrl.c > +++ linux-6.0/drivers/soc/litex/litex_soc_ctrl.c > @@ -82,13 +82,11 @@ static int litex_reset_handler(struct no > return NOTIFY_DONE; > } > > -#ifdef CONFIG_OF > static const struct of_device_id litex_soc_ctrl_of_match[] = { > {.compatible = "litex,soc-controller"}, > {}, > }; > MODULE_DEVICE_TABLE(of, litex_soc_ctrl_of_match); > -#endif /* CONFIG_OF */ > > static int litex_soc_ctrl_probe(struct platform_device *pdev) > { > @@ -131,7 +129,7 @@ static int litex_soc_ctrl_remove(struct > static struct platform_driver litex_soc_ctrl_driver = { > .driver = { > .name = "litex-soc-controller", > - .of_match_table = of_match_ptr(litex_soc_ctrl_of_match) > + .of_match_table = litex_soc_ctrl_of_match, > }, > .probe = litex_soc_ctrl_probe, > .remove = litex_soc_ctrl_remove, > > > -- > Jean Delvare > SUSE L3 Support
Hi Gabriel, On Fri, 25 Nov 2022 09:00:02 -0500, Gabriel L. Somlo wrote: > On Thu, Nov 24, 2022 at 04:16:18PM +0100, Jean Delvare wrote: > > Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), it > > is possible to test-build any driver which depends on OF on any > > architecture by explicitly selecting OF. Therefore depending on > > COMPILE_TEST as an alternative is no longer needed. > > > > It is actually better to always build such drivers with OF enabled, > > so that the test builds are closer to how each driver will actually be > > built on its intended target. Building them without OF may not test > > much as the compiler will optimize out potentially large parts of the > > code. In the worst case, this could even pop false positive warnings. > > Dropping COMPILE_TEST here improves the quality of our testing and > > avoids wasting time on non-existent issues. > > > > As a minor optimization, this also lets us drop of_match_ptr() and > > ifdef-guarding, as we now know what they will resolve to, we might as > > well save cpp some work. > > Acked-by: Gabriel Somlo <gsomlo@gmail.com> Despite your ack, this patch was never committed. Was it forgotten somehow? Should I resubmit? Thanks,
On Thu, Nov 16, 2023 at 03:03:57PM +0100, Jean Delvare wrote: > Hi Gabriel, > > On Fri, 25 Nov 2022 09:00:02 -0500, Gabriel L. Somlo wrote: > > On Thu, Nov 24, 2022 at 04:16:18PM +0100, Jean Delvare wrote: > > > Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), it > > > is possible to test-build any driver which depends on OF on any > > > architecture by explicitly selecting OF. Therefore depending on > > > COMPILE_TEST as an alternative is no longer needed. > > > > > > It is actually better to always build such drivers with OF enabled, > > > so that the test builds are closer to how each driver will actually be > > > built on its intended target. Building them without OF may not test > > > much as the compiler will optimize out potentially large parts of the > > > code. In the worst case, this could even pop false positive warnings. > > > Dropping COMPILE_TEST here improves the quality of our testing and > > > avoids wasting time on non-existent issues. > > > > > > As a minor optimization, this also lets us drop of_match_ptr() and > > > ifdef-guarding, as we now know what they will resolve to, we might as > > > well save cpp some work. > > > > Acked-by: Gabriel Somlo <gsomlo@gmail.com> > > Despite your ack, this patch was never committed. Was it forgotten > somehow? Should I resubmit? AFAIK, LiteX is too small to have its own direct path into Linus's upstream tree, and so far any changes to LiteX specific kernel code were filtered upstream through the respective dedicated subsystems affected (e.g., mmc, networking, block, etc.). IIRC Joel (cc-ed) might have been involved in the upstreaming of the original LiteX soc driver -- is that correct? If so, which way did it end up going upstream, and can we replicate that for Jean's patch? Thanks much, --Gabriel > Thanks, > -- > Jean Delvare > SUSE L3 Support
On Thu, 24 Nov 2022 at 16:16:18 +0100, Jean Delvare wrote: > Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), it > is possible to test-build any driver which depends on OF on any > architecture by explicitly selecting OF. Therefore depending on > COMPILE_TEST as an alternative is no longer needed. > > It is actually better to always build such drivers with OF enabled, > so that the test builds are closer to how each driver will actually be > built on its intended target. Building them without OF may not test > much as the compiler will optimize out potentially large parts of the > code. In the worst case, this could even pop false positive warnings. > Dropping COMPILE_TEST here improves the quality of our testing and > avoids wasting time on non-existent issues. > > As a minor optimization, this also lets us drop of_match_ptr() and > ifdef-guarding, as we now know what they will resolve to, we might as > well save cpp some work. > > Signed-off-by: Jean Delvare <jdelvare@suse.de> > Cc: Karol Gugala <kgugala@antmicro.com> > Cc: Mateusz Holenko <mholenko@antmicro.com> > Cc: Gabriel Somlo <gsomlo@gmail.com> > Cc: Joel Stanley <joel@jms.id.au> Reviewed-by: Gabriel Somlo <gsomlo@gmail.com> Arnd: since it's been a while (sorry about that), please advise on whether Jean should re-send the original patch, unless you can grab it directly from here and pull it through the soc tree: https://lore.kernel.org/lkml/20221125142756.3e51a28d@endymion.delvare/ Thanks much, --Gabriel > --- > drivers/soc/litex/Kconfig | 2 +- > drivers/soc/litex/litex_soc_ctrl.c | 4 +--- > 2 files changed, 2 insertions(+), 4 deletions(-) > > --- linux-6.0.orig/drivers/soc/litex/Kconfig > +++ linux-6.0/drivers/soc/litex/Kconfig > @@ -7,7 +7,7 @@ config LITEX > > config LITEX_SOC_CONTROLLER > tristate "Enable LiteX SoC Controller driver" > - depends on OF || COMPILE_TEST > + depends on OF > depends on HAS_IOMEM > select LITEX > help > --- linux-6.0.orig/drivers/soc/litex/litex_soc_ctrl.c > +++ linux-6.0/drivers/soc/litex/litex_soc_ctrl.c > @@ -82,13 +82,11 @@ static int litex_reset_handler(struct no > return NOTIFY_DONE; > } > > -#ifdef CONFIG_OF > static const struct of_device_id litex_soc_ctrl_of_match[] = { > {.compatible = "litex,soc-controller"}, > {}, > }; > MODULE_DEVICE_TABLE(of, litex_soc_ctrl_of_match); > -#endif /* CONFIG_OF */ > > static int litex_soc_ctrl_probe(struct platform_device *pdev) > { > @@ -131,7 +129,7 @@ static int litex_soc_ctrl_remove(struct > static struct platform_driver litex_soc_ctrl_driver = { > .driver = { > .name = "litex-soc-controller", > - .of_match_table = of_match_ptr(litex_soc_ctrl_of_match) > + .of_match_table = litex_soc_ctrl_of_match, > }, > .probe = litex_soc_ctrl_probe, > .remove = litex_soc_ctrl_remove, > > > -- > Jean Delvare > SUSE L3 Support >
--- linux-6.0.orig/drivers/soc/litex/Kconfig +++ linux-6.0/drivers/soc/litex/Kconfig @@ -7,7 +7,7 @@ config LITEX config LITEX_SOC_CONTROLLER tristate "Enable LiteX SoC Controller driver" - depends on OF || COMPILE_TEST + depends on OF depends on HAS_IOMEM select LITEX help --- linux-6.0.orig/drivers/soc/litex/litex_soc_ctrl.c +++ linux-6.0/drivers/soc/litex/litex_soc_ctrl.c @@ -82,13 +82,11 @@ static int litex_reset_handler(struct no return NOTIFY_DONE; } -#ifdef CONFIG_OF static const struct of_device_id litex_soc_ctrl_of_match[] = { {.compatible = "litex,soc-controller"}, {}, }; MODULE_DEVICE_TABLE(of, litex_soc_ctrl_of_match); -#endif /* CONFIG_OF */ static int litex_soc_ctrl_probe(struct platform_device *pdev) { @@ -131,7 +129,7 @@ static int litex_soc_ctrl_remove(struct static struct platform_driver litex_soc_ctrl_driver = { .driver = { .name = "litex-soc-controller", - .of_match_table = of_match_ptr(litex_soc_ctrl_of_match) + .of_match_table = litex_soc_ctrl_of_match, }, .probe = litex_soc_ctrl_probe, .remove = litex_soc_ctrl_remove,