[PATCH 4/5] of: silence of_diff output for negative indents

Sascha Hauer sha at pengutronix.de
Mon Feb 7 00:17:30 PST 2022


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 at 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 |



More information about the barebox mailing list