lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 1 Jun 2013 09:01:07 -0500
From:	Rob Herring <robherring2@...il.com>
To:	Arnd Bergmann <arnd@...db.de>
Cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Grant Likely <grant.likely@...aro.org>,
	patches@...ts.linaro.org, Rob Herring <rob.herring@...xeda.com>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>
Subject: Re: [PATCH 15/15] OF: remove #ifdef from linux/of_platform.h

On Fri, May 31, 2013 at 5:22 PM, Arnd Bergmann <arnd@...db.de> wrote:
> A lot of code uses the functions from of_platform.h when built for
> devicetree-enabled platforms but can also be built without them.
> In order to avoid using #ifdef everywhere in drivers, this
> makes all the function declarations visible, which means we
> can use "if (IS_ENABLED(CONFIG_OF))" in driver code and get build
> coverage over the code but let the compiler drop the reference
> in the object code.
>
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> Cc: Grant Likely <grant.likely@...aro.org>
> Cc: Rob Herring <rob.herring@...xeda.com>

I've got a more complete series for 3.11 that removes OF_DEVICE and
of_platform_driver completely. I'm waiting on ack from Ben H.

Rob

> ---
>  include/linux/of_platform.h | 14 +++-----------
>  1 file changed, 3 insertions(+), 11 deletions(-)
>
> diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
> index 2a93b64..7747ad0 100644
> --- a/include/linux/of_platform.h
> +++ b/include/linux/of_platform.h
> @@ -13,8 +13,6 @@
>
>  #include <linux/device.h>
>  #include <linux/mod_devicetable.h>
> -
> -#ifdef CONFIG_OF_DEVICE
>  #include <linux/pm.h>
>  #include <linux/of_device.h>
>  #include <linux/platform_device.h>
> @@ -82,7 +80,6 @@ extern struct platform_device *of_device_alloc(struct device_node *np,
>                                          struct device *parent);
>  extern struct platform_device *of_find_device_by_node(struct device_node *np);
>
> -#ifdef CONFIG_OF_ADDRESS /* device reg helpers depend on OF_ADDRESS */
>  /* Platform devices and busses creation */
>  extern struct platform_device *of_platform_device_create(struct device_node *np,
>                                                    const char *bus_id,
> @@ -91,17 +88,12 @@ extern struct platform_device *of_platform_device_create(struct device_node *np,
>  extern int of_platform_bus_probe(struct device_node *root,
>                                  const struct of_device_id *matches,
>                                  struct device *parent);
> +#ifdef CONFIG_OF_ADDRESS
>  extern int of_platform_populate(struct device_node *root,
>                                 const struct of_device_id *matches,
>                                 const struct of_dev_auxdata *lookup,
>                                 struct device *parent);
> -#endif /* CONFIG_OF_ADDRESS */
> -
> -#endif /* CONFIG_OF_DEVICE */
> -
> -#if !defined(CONFIG_OF_ADDRESS)
> -struct of_dev_auxdata;
> -struct device_node;
> +#else
>  static inline int of_platform_populate(struct device_node *root,
>                                         const struct of_device_id *matches,
>                                         const struct of_dev_auxdata *lookup,
> @@ -109,6 +101,6 @@ static inline int of_platform_populate(struct device_node *root,
>  {
>         return -ENODEV;
>  }
> -#endif /* !CONFIG_OF_ADDRESS */
> +#endif
>
>  #endif /* _LINUX_OF_PLATFORM_H */
> --
> 1.8.1.2
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ