Skip to contentSkip to conversation

kconfig: use true and false for bool variable

PATCH Applied Yang Li 2 participants 2 messages Mar 15, 2021 – Mar 25, 2021

Subsystems (2)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 kconfig: use true and false for bool variable

fixed the following coccicheck:
./scripts/kconfig/confdata.c:36:9-10: WARNING: return of 0/1 in function 'is_dir' with return type bool

---
 scripts/kconfig/confdata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/kconfig/confdata.c +1 -1
index 2568dbe..b65b8c3 100644
@@ -33,7 +33,7 @@ static bool is_dir(const char *path)
 	struct stat st;
 
 	if (stat(path, &st))
-		return 0;
+		return false;
 
 	return S_ISDIR(st.st_mode);
 }
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 8 lines · Yang Li

fixed the following coccicheck:
./scripts/kconfig/confdata.c:36:9-10: WARNING: return of 0/1 in function 'is_dir' with return type bool

---

Applied. Thanks.

Quoted 19 lines
 scripts/kconfig/confdata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/kconfig/confdata.c +1 -2
index 2568dbe..b65b8c3 100644
@@ -33,7 +33,7 @@ static bool is_dir(const char *path)
        struct stat st;
 
        if (stat(path, &st))
-               return 0;
+               return false;
 
        return S_ISDIR(st.st_mode);
 }
--

1.8.3.1

Signature · 2 lines
Best Regards
Masahiro Yamada