[PATCH linux-next] scripts/dtc/util: fix boolreturn.cocci warnings

From: CGEL
Date: Tue Aug 24 2021 - 02:45:16 EST


From: Jing Yangyang <jing.yangyang@xxxxxxxxxx>

Return statements in functions returning bool should use true/false
instead of 1/0.

Generated by: scripts/coccinelle/misc/boolreturn.cocci

Reported-by: Zeal Robot <zealci@xxxxxxxxxx>
Signed-off-by: Jing Yangyang <jing.yangyang@xxxxxxxxxx>
---
scripts/dtc/util.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/dtc/util.c b/scripts/dtc/util.c
index 40274fb..1faded1 100644
--- a/scripts/dtc/util.c
+++ b/scripts/dtc/util.c
@@ -112,11 +112,11 @@ bool util_is_printable_string(const void *data, int len)

/* zero length is not */
if (len == 0)
- return 0;
+ return false;

/* must terminate with zero */
if (s[len - 1] != '\0')
- return 0;
+ return false;

se = s + len;

@@ -127,12 +127,12 @@ bool util_is_printable_string(const void *data, int len)

/* not zero, or not done yet */
if (*s != '\0' || s == ss)
- return 0;
+ return false;

s++;
}

- return 1;
+ return true;
}

/*
--
1.8.3.1