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

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Feb 7 00:23:32 PST 2022


On 07.02.22 09:22, Sascha Hauer wrote:
> On Mon, Feb 07, 2022 at 09:17:30AM +0100, Sascha Hauer wrote:
>> 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.
> 
> Changed while applying, so when you agree with this we are good to go.

I'd have called it silent to avoid having negative conditions. I did the
change locally as well as fixed two typos. I will send a v2.

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