All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] of: correct of_console_check()'s return value
@ 2014-09-03 18:06 ` Brian Norris
  0 siblings, 0 replies; 9+ messages in thread
From: Brian Norris @ 2014-09-03 18:06 UTC (permalink / raw)
  To: Grant Likely; +Cc: Rob Herring, Linux Kernel, devicetree, Brian Norris

The comments above of_console_check() say that it will return TRUE if it
registers a preferred console, but add_preferred_console() uses a
0-equals-success convention, so ths leaves of_console_check() with an
inconsistent policy for its return values.

Fortunately, nobody was actually checking the return value of
of_console_check(), so this isn't significant at the moment.

But let's match the comments, so we're doing what we say.

Fixes: 3482f2c52b77 ('of: Create of_console_check() for selecting a console specified in /chosen')
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: Grant Likely <grant.likely@linaro.org>
---
This is one way to fix it. Another possibility includes changing
of_console_check() to use 0-as-success

 drivers/of/base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index d8574adf0d62..bcfd08c2795c 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -1986,7 +1986,7 @@ bool of_console_check(struct device_node *dn, char *name, int index)
 {
 	if (!dn || dn != of_stdout || console_set_on_cmdline)
 		return false;
-	return add_preferred_console(name, index, NULL);
+	return !add_preferred_console(name, index, NULL);
 }
 EXPORT_SYMBOL_GPL(of_console_check);
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH] of: correct of_console_check()'s return value
@ 2014-09-03 18:06 ` Brian Norris
  0 siblings, 0 replies; 9+ messages in thread
From: Brian Norris @ 2014-09-03 18:06 UTC (permalink / raw)
  To: Grant Likely
  Cc: Rob Herring, Linux Kernel, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Brian Norris

The comments above of_console_check() say that it will return TRUE if it
registers a preferred console, but add_preferred_console() uses a
0-equals-success convention, so ths leaves of_console_check() with an
inconsistent policy for its return values.

Fortunately, nobody was actually checking the return value of
of_console_check(), so this isn't significant at the moment.

But let's match the comments, so we're doing what we say.

Fixes: 3482f2c52b77 ('of: Create of_console_check() for selecting a console specified in /chosen')
Signed-off-by: Brian Norris <computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
This is one way to fix it. Another possibility includes changing
of_console_check() to use 0-as-success

 drivers/of/base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index d8574adf0d62..bcfd08c2795c 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -1986,7 +1986,7 @@ bool of_console_check(struct device_node *dn, char *name, int index)
 {
 	if (!dn || dn != of_stdout || console_set_on_cmdline)
 		return false;
-	return add_preferred_console(name, index, NULL);
+	return !add_preferred_console(name, index, NULL);
 }
 EXPORT_SYMBOL_GPL(of_console_check);
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] of: correct of_console_check()'s return value
@ 2014-09-08 10:42   ` Grant Likely
  0 siblings, 0 replies; 9+ messages in thread
From: Grant Likely @ 2014-09-08 10:42 UTC (permalink / raw)
  To: Brian Norris; +Cc: Rob Herring, Linux Kernel, devicetree, Brian Norris

On Wed,  3 Sep 2014 11:06:43 -0700, Brian Norris <computersforpeace@gmail.com> wrote:
> The comments above of_console_check() say that it will return TRUE if it
> registers a preferred console, but add_preferred_console() uses a
> 0-equals-success convention, so ths leaves of_console_check() with an
> inconsistent policy for its return values.
> 
> Fortunately, nobody was actually checking the return value of
> of_console_check(), so this isn't significant at the moment.
> 
> But let's match the comments, so we're doing what we say.
> 
> Fixes: 3482f2c52b77 ('of: Create of_console_check() for selecting a console specified in /chosen')
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> Cc: Grant Likely <grant.likely@linaro.org>

Good catch. Applied, thanks.

g.

> ---
> This is one way to fix it. Another possibility includes changing
> of_console_check() to use 0-as-success
> 
>  drivers/of/base.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index d8574adf0d62..bcfd08c2795c 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -1986,7 +1986,7 @@ bool of_console_check(struct device_node *dn, char *name, int index)
>  {
>  	if (!dn || dn != of_stdout || console_set_on_cmdline)
>  		return false;
> -	return add_preferred_console(name, index, NULL);
> +	return !add_preferred_console(name, index, NULL);
>  }
>  EXPORT_SYMBOL_GPL(of_console_check);
>  
> -- 
> 1.9.1
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] of: correct of_console_check()'s return value
@ 2014-09-08 10:42   ` Grant Likely
  0 siblings, 0 replies; 9+ messages in thread
From: Grant Likely @ 2014-09-08 10:42 UTC (permalink / raw)
  Cc: Rob Herring, Linux Kernel, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Brian Norris

On Wed,  3 Sep 2014 11:06:43 -0700, Brian Norris <computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> The comments above of_console_check() say that it will return TRUE if it
> registers a preferred console, but add_preferred_console() uses a
> 0-equals-success convention, so ths leaves of_console_check() with an
> inconsistent policy for its return values.
> 
> Fortunately, nobody was actually checking the return value of
> of_console_check(), so this isn't significant at the moment.
> 
> But let's match the comments, so we're doing what we say.
> 
> Fixes: 3482f2c52b77 ('of: Create of_console_check() for selecting a console specified in /chosen')
> Signed-off-by: Brian Norris <computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Cc: Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

Good catch. Applied, thanks.

g.

> ---
> This is one way to fix it. Another possibility includes changing
> of_console_check() to use 0-as-success
> 
>  drivers/of/base.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index d8574adf0d62..bcfd08c2795c 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -1986,7 +1986,7 @@ bool of_console_check(struct device_node *dn, char *name, int index)
>  {
>  	if (!dn || dn != of_stdout || console_set_on_cmdline)
>  		return false;
> -	return add_preferred_console(name, index, NULL);
> +	return !add_preferred_console(name, index, NULL);
>  }
>  EXPORT_SYMBOL_GPL(of_console_check);
>  
> -- 
> 1.9.1
> 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] of: correct of_console_check()'s return value
@ 2014-09-25 23:53     ` Brian Norris
  0 siblings, 0 replies; 9+ messages in thread
From: Brian Norris @ 2014-09-25 23:53 UTC (permalink / raw)
  To: Grant Likely; +Cc: Rob Herring, Linux Kernel, devicetree

Hi Grant,

On Mon, Sep 08, 2014 at 11:42:38AM +0100, Grant Likely wrote:
> On Wed,  3 Sep 2014 11:06:43 -0700, Brian Norris <computersforpeace@gmail.com> wrote:
> > The comments above of_console_check() say that it will return TRUE if it
> > registers a preferred console, but add_preferred_console() uses a
> > 0-equals-success convention, so ths leaves of_console_check() with an
> > inconsistent policy for its return values.
> > 
> > Fortunately, nobody was actually checking the return value of
> > of_console_check(), so this isn't significant at the moment.
> > 
> > But let's match the comments, so we're doing what we say.
> > 
> > Fixes: 3482f2c52b77 ('of: Create of_console_check() for selecting a console specified in /chosen')
> > Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> > Cc: Grant Likely <grant.likely@linaro.org>
> 
> Good catch. Applied, thanks.

Applied to what? I don't see it in linux-next.

Regards,
Brian

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] of: correct of_console_check()'s return value
@ 2014-09-25 23:53     ` Brian Norris
  0 siblings, 0 replies; 9+ messages in thread
From: Brian Norris @ 2014-09-25 23:53 UTC (permalink / raw)
  To: Grant Likely; +Cc: Rob Herring, Linux Kernel, devicetree-u79uwXL29TY76Z2rM5mHXA

Hi Grant,

On Mon, Sep 08, 2014 at 11:42:38AM +0100, Grant Likely wrote:
> On Wed,  3 Sep 2014 11:06:43 -0700, Brian Norris <computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > The comments above of_console_check() say that it will return TRUE if it
> > registers a preferred console, but add_preferred_console() uses a
> > 0-equals-success convention, so ths leaves of_console_check() with an
> > inconsistent policy for its return values.
> > 
> > Fortunately, nobody was actually checking the return value of
> > of_console_check(), so this isn't significant at the moment.
> > 
> > But let's match the comments, so we're doing what we say.
> > 
> > Fixes: 3482f2c52b77 ('of: Create of_console_check() for selecting a console specified in /chosen')
> > Signed-off-by: Brian Norris <computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > Cc: Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> 
> Good catch. Applied, thanks.

Applied to what? I don't see it in linux-next.

Regards,
Brian
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] of: correct of_console_check()'s return value
  2014-09-25 23:53     ` Brian Norris
  (?)
@ 2014-09-28  8:55     ` Grant Likely
  -1 siblings, 0 replies; 9+ messages in thread
From: Grant Likely @ 2014-09-28  8:55 UTC (permalink / raw)
  To: Brian Norris; +Cc: devicetree, Linux Kernel Mailing List, Rob Herring

[-- Attachment #1: Type: text/plain, Size: 1117 bytes --]

It got merged into mainline on Thursday.

g.
On 26 Sep 2014 00:53, "Brian Norris" <computersforpeace@gmail.com> wrote:

> Hi Grant,
>
> On Mon, Sep 08, 2014 at 11:42:38AM +0100, Grant Likely wrote:
> > On Wed,  3 Sep 2014 11:06:43 -0700, Brian Norris <
> computersforpeace@gmail.com> wrote:
> > > The comments above of_console_check() say that it will return TRUE if
> it
> > > registers a preferred console, but add_preferred_console() uses a
> > > 0-equals-success convention, so ths leaves of_console_check() with an
> > > inconsistent policy for its return values.
> > >
> > > Fortunately, nobody was actually checking the return value of
> > > of_console_check(), so this isn't significant at the moment.
> > >
> > > But let's match the comments, so we're doing what we say.
> > >
> > > Fixes: 3482f2c52b77 ('of: Create of_console_check() for selecting a
> console specified in /chosen')
> > > Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> > > Cc: Grant Likely <grant.likely@linaro.org>
> >
> > Good catch. Applied, thanks.
>
> Applied to what? I don't see it in linux-next.
>
> Regards,
> Brian
>

[-- Attachment #2: Type: text/html, Size: 1724 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] of: correct of_console_check()'s return value
  2014-09-25 23:53     ` Brian Norris
@ 2014-09-28  8:56       ` Grant Likely
  -1 siblings, 0 replies; 9+ messages in thread
From: Grant Likely @ 2014-09-28  8:56 UTC (permalink / raw)
  To: Brian Norris; +Cc: Rob Herring, Linux Kernel, devicetree

On Fri, Sep 26, 2014 at 12:53 AM, Brian Norris
<computersforpeace@gmail.com> wrote:
> Hi Grant,
>
> On Mon, Sep 08, 2014 at 11:42:38AM +0100, Grant Likely wrote:
>> On Wed,  3 Sep 2014 11:06:43 -0700, Brian Norris <computersforpeace@gmail.com> wrote:
>> > The comments above of_console_check() say that it will return TRUE if it
>> > registers a preferred console, but add_preferred_console() uses a
>> > 0-equals-success convention, so ths leaves of_console_check() with an
>> > inconsistent policy for its return values.
>> >
>> > Fortunately, nobody was actually checking the return value of
>> > of_console_check(), so this isn't significant at the moment.
>> >
>> > But let's match the comments, so we're doing what we say.
>> >
>> > Fixes: 3482f2c52b77 ('of: Create of_console_check() for selecting a console specified in /chosen')
>> > Signed-off-by: Brian Norris <computersforpeace@gmail.com>
>> > Cc: Grant Likely <grant.likely@linaro.org>
>>
>> Good catch. Applied, thanks.
>
> Applied to what? I don't see it in linux-next.

It got merged into mainline on Thursday.

g.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] of: correct of_console_check()'s return value
@ 2014-09-28  8:56       ` Grant Likely
  0 siblings, 0 replies; 9+ messages in thread
From: Grant Likely @ 2014-09-28  8:56 UTC (permalink / raw)
  To: Brian Norris; +Cc: Rob Herring, Linux Kernel, devicetree-u79uwXL29TY76Z2rM5mHXA

On Fri, Sep 26, 2014 at 12:53 AM, Brian Norris
<computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi Grant,
>
> On Mon, Sep 08, 2014 at 11:42:38AM +0100, Grant Likely wrote:
>> On Wed,  3 Sep 2014 11:06:43 -0700, Brian Norris <computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> > The comments above of_console_check() say that it will return TRUE if it
>> > registers a preferred console, but add_preferred_console() uses a
>> > 0-equals-success convention, so ths leaves of_console_check() with an
>> > inconsistent policy for its return values.
>> >
>> > Fortunately, nobody was actually checking the return value of
>> > of_console_check(), so this isn't significant at the moment.
>> >
>> > But let's match the comments, so we're doing what we say.
>> >
>> > Fixes: 3482f2c52b77 ('of: Create of_console_check() for selecting a console specified in /chosen')
>> > Signed-off-by: Brian Norris <computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> > Cc: Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
>>
>> Good catch. Applied, thanks.
>
> Applied to what? I don't see it in linux-next.

It got merged into mainline on Thursday.

g.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-09-28  8:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-03 18:06 [PATCH] of: correct of_console_check()'s return value Brian Norris
2014-09-03 18:06 ` Brian Norris
2014-09-08 10:42 ` Grant Likely
2014-09-08 10:42   ` Grant Likely
2014-09-25 23:53   ` Brian Norris
2014-09-25 23:53     ` Brian Norris
2014-09-28  8:55     ` Grant Likely
2014-09-28  8:56     ` Grant Likely
2014-09-28  8:56       ` Grant Likely

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.