mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 4/5] of: silence of_diff output for negative indents
Date: Mon, 7 Feb 2022 09:17:30 +0100	[thread overview]
Message-ID: <20220207081730.GB18637@pengutronix.de> (raw)
In-Reply-To: <20220207075621.1014381-4-a.fatoum@pengutronix.de>

On Mon, Feb 07, 2022 at 08:56:20AM +0100, Ahmad Fatoum wrote:
> Negative indents just led to strange behavior so far. Repurpose them to
> mean that the caller is not interested in console output. This makes
> them useful for negative tests (Sanity check that two different nodes
> are indeed different).
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  drivers/of/base.c | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index 99be24254203..ffa79785f80e 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -2087,6 +2087,8 @@ int of_diff(struct device_node *a, struct device_node *b, int indent)

Can we add a

	bool do_print = indent >= 0;

variable and use it for the tests below? I think this makes the code a
bit clearer.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  reply	other threads:[~2022-02-07  8:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-07  7:56 [PATCH 1/5] test: self: printf: log skipped tests Ahmad Fatoum
2022-02-07  7:56 ` [PATCH 2/5] test: self: printf: add tests for %*ph prints Ahmad Fatoum
2022-02-07  7:56 ` [PATCH 3/5] of: report whether of_diff found differences in return code Ahmad Fatoum
2022-02-07  7:56 ` [PATCH 4/5] of: silence of_diff output for negative indents Ahmad Fatoum
2022-02-07  8:17   ` Sascha Hauer [this message]
2022-02-07  8:22     ` Sascha Hauer
2022-02-07  8:23       ` Ahmad Fatoum
2022-02-07  7:56 ` [PATCH 5/5] test: self: add device tree manipulation test Ahmad Fatoum

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=20220207081730.GB18637@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.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