devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: Sylwester Nawrocki
	<s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	g.liakhovetski-Mmb7MZpHnFY@public.gmane.org,
	linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	sw0312.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org,
	kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org
Subject: Re: [PATCH RFC 03/13] OF: define of_*_cmp() macros also if CONFIG_OF isn't set
Date: Tue, 11 Dec 2012 08:45:09 +0000	[thread overview]
Message-ID: <20121211084509.2DEE83E076D@localhost> (raw)
In-Reply-To: <1355168499-5847-4-git-send-email-s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>

On Mon, 10 Dec 2012 20:41:29 +0100, Sylwester Nawrocki <s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> wrote:
> From: Guennadi Liakhovetski <g.liakhovetski-Mmb7MZpHnFY@public.gmane.org>
> 
> of_*_cmp() macros do not depend on any OF functions and can be defined also
> if CONFIG_OF isn't set. Also include linux/string.h, required by those
> macros.

Patch looks fine, but I'd like to know the situation where you found
this problem. Again, anything calling these of_ helpers is probably
CONFIG_OF specific code.

I've resisted doing a blanket add of these helpers outside of CONFIG_OF
exactly because it helps identify CONFIG_OF code that should be compiled
out when CONFIG_OF=n

g.

> 
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski-Mmb7MZpHnFY@public.gmane.org>
> ---
>  include/linux/of.h |   15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/include/linux/of.h b/include/linux/of.h
> index 9ba8cf1..38d4b1a 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -85,6 +85,14 @@ static inline struct device_node *of_node_get(struct device_node *node)
>  static inline void of_node_put(struct device_node *node) { }
>  #endif /* !CONFIG_OF_DYNAMIC */
>  
> +/* Default string compare functions, Allow arch asm/prom.h to override */
> +#if !defined(of_compat_cmp)
> +#include <linux/string.h>
> +#define of_compat_cmp(s1, s2, l)	strcasecmp((s1), (s2))
> +#define of_prop_cmp(s1, s2)		strcmp((s1), (s2))
> +#define of_node_cmp(s1, s2)		strcasecmp((s1), (s2))
> +#endif
> +
>  #ifdef CONFIG_OF
>  
>  /* Pointer for first entry in chain of all nodes. */
> @@ -143,13 +151,6 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size)
>  #define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
>  #endif
>  
> -/* Default string compare functions, Allow arch asm/prom.h to override */
> -#if !defined(of_compat_cmp)
> -#define of_compat_cmp(s1, s2, l)	strcasecmp((s1), (s2))
> -#define of_prop_cmp(s1, s2)		strcmp((s1), (s2))
> -#define of_node_cmp(s1, s2)		strcasecmp((s1), (s2))
> -#endif
> -
>  /* flag descriptions */
>  #define OF_DYNAMIC	1 /* node and properties were allocated via kmalloc */
>  #define OF_DETACHED	2 /* node has been detached from the device tree */
> -- 
> 1.7.9.5
> 

-- 
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies, Ltd.

  parent reply	other threads:[~2012-12-11  8:45 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-10 19:41 [PATCH RFC 00/13] Common video input interfaces bindings and V4L2 OF helpers Sylwester Nawrocki
2012-12-10 19:41 ` [PATCH RFC 03/13] OF: define of_*_cmp() macros also if CONFIG_OF isn't set Sylwester Nawrocki
     [not found]   ` <1355168499-5847-4-git-send-email-s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2012-12-11  8:45     ` Grant Likely [this message]
2012-12-10 19:41 ` [PATCH RFC 04/13] OF: make a function pointer argument const Sylwester Nawrocki
2012-12-11  8:51   ` Grant Likely
     [not found] ` <1355168499-5847-1-git-send-email-s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2012-12-10 19:41   ` [PATCH RFC 01/13] i2c: add dummy inline functions for when CONFIG_OF_I2C(_MODULE) isn't defined Sylwester Nawrocki
2012-12-11  8:39     ` Grant Likely
2012-12-10 19:41   ` [PATCH RFC 02/13] of: add a dummy inline function for when CONFIG_OF is not defined Sylwester Nawrocki
2012-12-11  8:42     ` Grant Likely
2012-12-10 19:41   ` [PATCH RFC 05/13] of: Add empty for_each_available_child_of_node() macro definition Sylwester Nawrocki
     [not found]     ` <1355168499-5847-6-git-send-email-s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2012-12-11  8:57       ` Grant Likely
2012-12-11 16:09         ` Sylwester Nawrocki
2012-12-10 19:41 ` [PATCH RFC 06/13] of: Add empty of_find_device_by_node() function definition Sylwester Nawrocki
2012-12-11  8:59   ` Grant Likely
2012-12-10 19:41 ` [PATCH RFC 07/13] of: Add empty of_get_next_child() " Sylwester Nawrocki
2012-12-10 19:41 ` [PATCH RFC 08/13] media: add V4L2 DT binding documentation Sylwester Nawrocki
2012-12-15 21:13   ` [PATCH] [media] Add common binding documentation for video interfaces Sylwester Nawrocki
2012-12-18 17:14     ` Stephen Warren
     [not found]       ` <50D0A475.7010800-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-12-31 19:51         ` Sylwester Nawrocki
2012-12-31 21:55     ` Rob Herring
2012-12-10 19:41 ` [PATCH RFC 09/13] media: add a V4L2 OF parser Sylwester Nawrocki
2012-12-10 19:41 ` [PATCH RFC 10/13] v4l2-of: Support variable length of data-lanes property Sylwester Nawrocki
2012-12-10 19:41 ` [PATCH RFC 11/13] v4l2-of: Add v4l2_of_parse_data_lanes() function Sylwester Nawrocki
2012-12-10 19:41 ` [PATCH RFC 12/13] v4l2-of: Corrected v4l2_of_parse_link() function declaration Sylwester Nawrocki
2012-12-10 19:41 ` [PATCH RFC 13/13] v4l2-of: Replace "remote" property with "remote-endpoint" Sylwester Nawrocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121211084509.2DEE83E076D@localhost \
    --to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=g.liakhovetski-Mmb7MZpHnFY@public.gmane.org \
    --cc=kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
    --cc=s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=sw0312.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).