All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: Felipe Balbi <balbi@ti.com>,
	devicetree@vger.kernel.org, Tony Lindgren <tony@atomide.com>,
	Linux OMAP Mailing List <linux-omap@vger.kernel.org>
Subject: Re: [RFC/PATCH 2/2] of: allow for boolean flags to have value
Date: Thu, 05 Feb 2015 19:16:47 +0100	[thread overview]
Message-ID: <2914350.UYQI23DbG0@wuerfel> (raw)
In-Reply-To: <1423159266-25561-2-git-send-email-balbi@ti.com>

On Thursday 05 February 2015 12:01:06 Felipe Balbi wrote:
> +       /*
> +        * if property doesn't have a value, or prop->length == 0 and
> +        * we overflow, treat it as simple value-less flag.
> +        */
> +       if (rc == -ENODATA || rc == -EOVERFLOW)
> +               return true;
> +       if (WARN(rc < 0, "failed to read '%s' value -> %d\n",
> +                               propname, rc))
> +               return false;
> 

I think there are drivers today that use of_property_read_bool()
to check for the presence of a property that is not already empty.
If the property starts with a zero cell, that would break here.

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC/PATCH 2/2] of: allow for boolean flags to have value
Date: Thu, 05 Feb 2015 19:16:47 +0100	[thread overview]
Message-ID: <2914350.UYQI23DbG0@wuerfel> (raw)
In-Reply-To: <1423159266-25561-2-git-send-email-balbi@ti.com>

On Thursday 05 February 2015 12:01:06 Felipe Balbi wrote:
> +       /*
> +        * if property doesn't have a value, or prop->length == 0 and
> +        * we overflow, treat it as simple value-less flag.
> +        */
> +       if (rc == -ENODATA || rc == -EOVERFLOW)
> +               return true;
> +       if (WARN(rc < 0, "failed to read '%s' value -> %d\n",
> +                               propname, rc))
> +               return false;
> 

I think there are drivers today that use of_property_read_bool()
to check for the presence of a property that is not already empty.
If the property starts with a zero cell, that would break here.

	Arnd

  reply	other threads:[~2015-02-05 18:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-05 18:01 [RFC/PATCH 1/2] of: move of_property_read_bool further down Felipe Balbi
2015-02-05 18:01 ` Felipe Balbi
     [not found] ` <1423159266-25561-1-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
2015-02-05 18:01   ` [RFC/PATCH 2/2] of: allow for boolean flags to have value Felipe Balbi
2015-02-05 18:01     ` Felipe Balbi
2015-02-05 18:16     ` Arnd Bergmann [this message]
2015-02-05 18:16       ` Arnd Bergmann
     [not found]     ` <1423159266-25561-2-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
2015-02-05 18:22       ` Mark Rutland
2015-02-05 18:22         ` Mark Rutland
2015-02-05 18:34         ` Tony Lindgren
2015-02-05 18:34           ` Tony Lindgren
2015-02-05 18:39       ` Uwe Kleine-König
2015-02-05 18:39         ` Uwe Kleine-König

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=2914350.UYQI23DbG0@wuerfel \
    --to=arnd@arndb.de \
    --cc=balbi@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.