From: Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
Sebastian Andrzej Siewior
<bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>,
Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>
Subject: Re: [RFC] OF: make of_property_for_each_u32() use parameters if OF is not enabled
Date: Sat, 15 Jun 2013 15:00:18 +0100 [thread overview]
Message-ID: <20130615140018.572793E0A2E@localhost> (raw)
In-Reply-To: <1371137331-4652-1-git-send-email-bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1299 bytes --]
On Thu, 13 Jun 2013 17:28:51 +0200, Sebastian Andrzej Siewior <bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org> wrote:
> I am getting a few
> |warning: unused variable âpâ [-Wunused-variable]
> |warning: unused variable âpropâ [-Wunused-variable]
>
> in the case where CONFIG_OF is not defined and the parameters are only
> used in the loop macro.
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
> ---
> include/linux/of.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/of.h b/include/linux/of.h
> index 1fd08ca..5a89f3f 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -507,8 +507,8 @@ static inline int of_machine_is_compatible(const char *compat)
>
> #define of_match_ptr(_ptr) NULL
> #define of_match_node(_matches, _node) NULL
> -#define of_property_for_each_u32(np, propname, prop, p, u) \
> - while (0)
> +#define of_property_for_each_u32(np, propname, prop, p, u) \
Unrelated whitespace change
> + for (prop = NULL, p = NULL; 0; prop++, p++)
The prop++ and p++ bits should be dropped. It would probably be better
to move the of_property_for_each_* macros outside the #ifdef/#else block
and have an empty definition of of_prop_next_string/of_prop_next_u32.
g.
[-- Attachment #2: Type: text/plain, Size: 192 bytes --]
_______________________________________________
devicetree-discuss mailing list
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
https://lists.ozlabs.org/listinfo/devicetree-discuss
next prev parent reply other threads:[~2013-06-15 14:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-13 15:28 [RFC] OF: make of_property_for_each_u32() use parameters if OF is not enabled Sebastian Andrzej Siewior
[not found] ` <1371137331-4652-1-git-send-email-bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2013-06-15 14:00 ` Grant Likely [this message]
2013-06-17 6:59 ` Sebastian Andrzej Siewior
2013-06-17 14:48 ` [PATCH v2] OF: make of_property_for_each_{u32|string}() " Sebastian Andrzej Siewior
[not found] ` <20130617144813.GA10582-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2013-07-20 5:28 ` Grant Likely
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=20130615140018.572793E0A2E@localhost \
--to=grant.likely-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
--cc=bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@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).