kconfig: use true and false for bool variable
diff mbox series

Message ID 1615791344-48675-1-git-send-email-yang.lee@linux.alibaba.com
State Accepted
Commit a69b191f6297310ff140f2868b89fe2a2f355b90
Headers show
Series
  • kconfig: use true and false for bool variable
Related show

Commit Message

Yang Li March 15, 2021, 6:55 a.m. UTC
fixed the following coccicheck:
./scripts/kconfig/confdata.c:36:9-10: WARNING: return of 0/1 in function
'is_dir' with return type bool

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 scripts/kconfig/confdata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Masahiro Yamada March 25, 2021, 4:47 a.m. UTC | #1
On Mon, Mar 15, 2021 at 3:55 PM Yang Li <yang.lee@linux.alibaba.com> wrote:
>
> fixed the following coccicheck:
> ./scripts/kconfig/confdata.c:36:9-10: WARNING: return of 0/1 in function
> 'is_dir' with return type bool
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---

Applied. Thanks.




>  scripts/kconfig/confdata.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
> index 2568dbe..b65b8c3 100644
> --- a/scripts/kconfig/confdata.c
> +++ b/scripts/kconfig/confdata.c
> @@ -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
>

Patch
diff mbox series

diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 2568dbe..b65b8c3 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -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);
 }