From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Weinberger Subject: Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource' Date: Thu, 17 Jul 2014 11:26:57 +0200 Message-ID: <53C796E1.8080708@nod.at> References: <201407130545.23004.marex@denx.de> <53C53CE1.4090803@gmail.com> <53C7269E.4010702@gmail.com> <6823014.2plXDE9VA9@wuerfel> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <6823014.2plXDE9VA9@wuerfel> Sender: linux-iio-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Arnd Bergmann , Chen Gang Cc: Guenter Roeck , Lars-Peter Clausen , Greg Kroah-Hartman , dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Benjamin Herrenschmidt , teg-B22kvLQNl6c@public.gmane.org, Thierry Reding , Lennox Wu , Marek Vasut , Liqin Chen , msalter-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, linux-pwm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org, linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , knaack.h-Mmb7MZpHnFY@public.gmane.org, Martin Schwidefsky , Mischa.Jonker-HKixBCOQz3hWk0Htik3J/w@public.gmane.org, jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, Geert Uytterhoeven List-Id: linux-input@vger.kernel.org Am 17.07.2014 11:20, schrieb Arnd Bergmann: > On Thursday 17 July 2014 09:27:58 Chen Gang wrote: >> gfp_t gfp_mask, unsigned int order); >> extern void devm_free_pages(struct device *dev, unsigned long addr); >> >> +#ifdef CONFIG_HAS_IOMEM >> void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res); >> +#elif defined(CONFIG_COMPILE_TEST) >> +static inline void __iomem *devm_ioremap_resource(struct device *dev, >> + struct resource *res) >> +{ >> + pr_warn("no hardware io memory, only for COMPILE_TEST\n"); >> + return (__force void __iomem *)ERR_PTR(-ENXIO); >> +} >> +#endif /* CONFIG_HAS_IOMEM || CONFIG_COMPILE_TEST */ >> >> /* allows to add/remove a custom action to devres stack */ > > To be honest, I think it's a bad idea to introduce wrappers functions > that are only available when CONFIG_COMPILE_TEST is set. > > COMPILE_TEST is a great tool in general, but it has its limits. > In particular, the case for !CONFIG_IOMEM is completely obscure > and we won't find any bugs by allowing more drivers to be built > in those configurations, but attempting to do it would cause > endless churn by changing each instance of 'depends on HAS_IOMEM' > to 'depends on HAS_IOMEM || COMPILE_TEST'. > > Note that s390 no has gained support for IOMEM, tile has it most > of the time (when PCI is enabled, so you get it in half the > test builds already), score should set HAS_IOMEM and doesn't > even have public compilers, and uml doesn't even compile in > latest mainline. Nothing else ever sets NO_IOMEM. Huh? UML (v3.16-rc5-143-gb6603fe) builds fine here. What build issue are you facing? Thanks, //richard From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from a.ns.miles-group.at ([95.130.255.143]:65278 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754849AbaGQJ1I (ORCPT ); Thu, 17 Jul 2014 05:27:08 -0400 Message-ID: <53C796E1.8080708@nod.at> Date: Thu, 17 Jul 2014 11:26:57 +0200 From: Richard Weinberger MIME-Version: 1.0 To: Arnd Bergmann , Chen Gang CC: Guenter Roeck , Lars-Peter Clausen , Greg Kroah-Hartman , dmitry.torokhov@gmail.com, linux-iio@vger.kernel.org, Benjamin Herrenschmidt , teg@jklm.no, Thierry Reding , Lennox Wu , Marek Vasut , Liqin Chen , msalter@redhat.com, linux-pwm@vger.kernel.org, devel@driverdev.osuosl.org, linux-watchdog@vger.kernel.org, linux-input@vger.kernel.org, "linux-kernel@vger.kernel.org" , knaack.h@gmx.de, Martin Schwidefsky , Mischa.Jonker@synopsys.com, jic23@kernel.org, Geert Uytterhoeven Subject: Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource' References: <201407130545.23004.marex@denx.de> <53C53CE1.4090803@gmail.com> <53C7269E.4010702@gmail.com> <6823014.2plXDE9VA9@wuerfel> In-Reply-To: <6823014.2plXDE9VA9@wuerfel> Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-iio-owner@vger.kernel.org List-Id: linux-iio@vger.kernel.org Am 17.07.2014 11:20, schrieb Arnd Bergmann: > On Thursday 17 July 2014 09:27:58 Chen Gang wrote: >> gfp_t gfp_mask, unsigned int order); >> extern void devm_free_pages(struct device *dev, unsigned long addr); >> >> +#ifdef CONFIG_HAS_IOMEM >> void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res); >> +#elif defined(CONFIG_COMPILE_TEST) >> +static inline void __iomem *devm_ioremap_resource(struct device *dev, >> + struct resource *res) >> +{ >> + pr_warn("no hardware io memory, only for COMPILE_TEST\n"); >> + return (__force void __iomem *)ERR_PTR(-ENXIO); >> +} >> +#endif /* CONFIG_HAS_IOMEM || CONFIG_COMPILE_TEST */ >> >> /* allows to add/remove a custom action to devres stack */ > > To be honest, I think it's a bad idea to introduce wrappers functions > that are only available when CONFIG_COMPILE_TEST is set. > > COMPILE_TEST is a great tool in general, but it has its limits. > In particular, the case for !CONFIG_IOMEM is completely obscure > and we won't find any bugs by allowing more drivers to be built > in those configurations, but attempting to do it would cause > endless churn by changing each instance of 'depends on HAS_IOMEM' > to 'depends on HAS_IOMEM || COMPILE_TEST'. > > Note that s390 no has gained support for IOMEM, tile has it most > of the time (when PCI is enabled, so you get it in half the > test builds already), score should set HAS_IOMEM and doesn't > even have public compilers, and uml doesn't even compile in > latest mainline. Nothing else ever sets NO_IOMEM. Huh? UML (v3.16-rc5-143-gb6603fe) builds fine here. What build issue are you facing? Thanks, //richard