linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kconfig: use true and false for bool variable
@ 2021-03-15  6:55 Yang Li
  2021-03-25  4:47 ` Masahiro Yamada
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Li @ 2021-03-15  6:55 UTC (permalink / raw)
  To: masahiroy; +Cc: linux-kbuild, linux-kernel, 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

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

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] kconfig: use true and false for bool variable
  2021-03-15  6:55 [PATCH] kconfig: use true and false for bool variable Yang Li
@ 2021-03-25  4:47 ` Masahiro Yamada
  0 siblings, 0 replies; 2+ messages in thread
From: Masahiro Yamada @ 2021-03-25  4:47 UTC (permalink / raw)
  To: Yang Li; +Cc: Linux Kbuild mailing list, Linux Kernel Mailing List

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
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-25  4:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-15  6:55 [PATCH] kconfig: use true and false for bool variable Yang Li
2021-03-25  4:47 ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).