linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kasan: fix coccinelle warnings in kasan_p*_table
@ 2019-03-04 17:04 Andrey Konovalov
  2019-03-05 16:14 ` Andrey Ryabinin
  0 siblings, 1 reply; 3+ messages in thread
From: Andrey Konovalov @ 2019-03-04 17:04 UTC (permalink / raw)
  To: Andrey Ryabinin, Alexander Potapenko, Dmitry Vyukov, kasan-dev,
	linux-mm, linux-kernel
  Cc: Kostya Serebryany, Andrey Konovalov, kbuild test robot

kasan_p4d_table, kasan_pmd_table and kasan_pud_table are declared as
returning bool, but return 0 instead of false, which produces a coccinelle
warning. Fix it.

Fixes: 0207df4fa1a8 ("kernel/memremap, kasan: make ZONE_DEVICE with work with KASAN")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
---
 mm/kasan/init.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mm/kasan/init.c b/mm/kasan/init.c
index 45a1b5e38e1e..fcaa1ca03175 100644
--- a/mm/kasan/init.c
+++ b/mm/kasan/init.c
@@ -42,7 +42,7 @@ static inline bool kasan_p4d_table(pgd_t pgd)
 #else
 static inline bool kasan_p4d_table(pgd_t pgd)
 {
-	return 0;
+	return false;
 }
 #endif
 #if CONFIG_PGTABLE_LEVELS > 3
@@ -54,7 +54,7 @@ static inline bool kasan_pud_table(p4d_t p4d)
 #else
 static inline bool kasan_pud_table(p4d_t p4d)
 {
-	return 0;
+	return false;
 }
 #endif
 #if CONFIG_PGTABLE_LEVELS > 2
@@ -66,7 +66,7 @@ static inline bool kasan_pmd_table(pud_t pud)
 #else
 static inline bool kasan_pmd_table(pud_t pud)
 {
-	return 0;
+	return false;
 }
 #endif
 pte_t kasan_early_shadow_pte[PTRS_PER_PTE] __page_aligned_bss;
-- 
2.21.0.352.gf09ad66450-goog


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

* Re: [PATCH] kasan: fix coccinelle warnings in kasan_p*_table
  2019-03-04 17:04 [PATCH] kasan: fix coccinelle warnings in kasan_p*_table Andrey Konovalov
@ 2019-03-05 16:14 ` Andrey Ryabinin
  2019-03-08  3:03   ` Souptick Joarder
  0 siblings, 1 reply; 3+ messages in thread
From: Andrey Ryabinin @ 2019-03-05 16:14 UTC (permalink / raw)
  To: Andrey Konovalov, Alexander Potapenko, Dmitry Vyukov, kasan-dev,
	linux-mm, linux-kernel, Andrew Morton
  Cc: Kostya Serebryany, kbuild test robot



On 3/4/19 8:04 PM, Andrey Konovalov wrote:
> kasan_p4d_table, kasan_pmd_table and kasan_pud_table are declared as
> returning bool, but return 0 instead of false, which produces a coccinelle
> warning. Fix it.
> 
> Fixes: 0207df4fa1a8 ("kernel/memremap, kasan: make ZONE_DEVICE with work with KASAN")
> Reported-by: kbuild test robot <lkp@intel.com>
> Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> ---

Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com>


>  mm/kasan/init.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/kasan/init.c b/mm/kasan/init.c
> index 45a1b5e38e1e..fcaa1ca03175 100644
> --- a/mm/kasan/init.c
> +++ b/mm/kasan/init.c
> @@ -42,7 +42,7 @@ static inline bool kasan_p4d_table(pgd_t pgd)
>  #else
>  static inline bool kasan_p4d_table(pgd_t pgd)
>  {
> -	return 0;
> +	return false;
>  }
>  #endif
>  #if CONFIG_PGTABLE_LEVELS > 3
> @@ -54,7 +54,7 @@ static inline bool kasan_pud_table(p4d_t p4d)
>  #else
>  static inline bool kasan_pud_table(p4d_t p4d)
>  {
> -	return 0;
> +	return false;
>  }
>  #endif
>  #if CONFIG_PGTABLE_LEVELS > 2
> @@ -66,7 +66,7 @@ static inline bool kasan_pmd_table(pud_t pud)
>  #else
>  static inline bool kasan_pmd_table(pud_t pud)
>  {
> -	return 0;
> +	return false;
>  }
>  #endif
>  pte_t kasan_early_shadow_pte[PTRS_PER_PTE] __page_aligned_bss;
> 

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

* Re: [PATCH] kasan: fix coccinelle warnings in kasan_p*_table
  2019-03-05 16:14 ` Andrey Ryabinin
@ 2019-03-08  3:03   ` Souptick Joarder
  0 siblings, 0 replies; 3+ messages in thread
From: Souptick Joarder @ 2019-03-08  3:03 UTC (permalink / raw)
  To: Andrey Ryabinin
  Cc: Andrey Konovalov, Alexander Potapenko, Dmitry Vyukov, kasan-dev,
	Linux-MM, linux-kernel, Andrew Morton, Kostya Serebryany,
	kbuild test robot

On Tue, Mar 5, 2019 at 9:43 PM Andrey Ryabinin <aryabinin@virtuozzo.com> wrote:
>
>
>
> On 3/4/19 8:04 PM, Andrey Konovalov wrote:
> > kasan_p4d_table, kasan_pmd_table and kasan_pud_table are declared as
> > returning bool, but return 0 instead of false, which produces a coccinelle
> > warning. Fix it.
> >
> > Fixes: 0207df4fa1a8 ("kernel/memremap, kasan: make ZONE_DEVICE with work with KASAN")
> > Reported-by: kbuild test robot <lkp@intel.com>
> > Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
> > ---
>
> Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
>
>
> >  mm/kasan/init.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/mm/kasan/init.c b/mm/kasan/init.c
> > index 45a1b5e38e1e..fcaa1ca03175 100644
> > --- a/mm/kasan/init.c
> > +++ b/mm/kasan/init.c
> > @@ -42,7 +42,7 @@ static inline bool kasan_p4d_table(pgd_t pgd)
> >  #else
> >  static inline bool kasan_p4d_table(pgd_t pgd)
> >  {
> > -     return 0;
> > +     return false;
> >  }
> >  #endif
> >  #if CONFIG_PGTABLE_LEVELS > 3
> > @@ -54,7 +54,7 @@ static inline bool kasan_pud_table(p4d_t p4d)
> >  #else
> >  static inline bool kasan_pud_table(p4d_t p4d)
> >  {
> > -     return 0;
> > +     return false;
> >  }
> >  #endif
> >  #if CONFIG_PGTABLE_LEVELS > 2
> > @@ -66,7 +66,7 @@ static inline bool kasan_pmd_table(pud_t pud)
> >  #else
> >  static inline bool kasan_pmd_table(pud_t pud)
> >  {
> > -     return 0;
> > +     return false;
> >  }
> >  #endif
> >  pte_t kasan_early_shadow_pte[PTRS_PER_PTE] __page_aligned_bss;
> >
>

Acked-by: Souptick Joarder <jrdr.linux@gmail.com>

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

end of thread, other threads:[~2019-03-08  3:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-04 17:04 [PATCH] kasan: fix coccinelle warnings in kasan_p*_table Andrey Konovalov
2019-03-05 16:14 ` Andrey Ryabinin
2019-03-08  3:03   ` Souptick Joarder

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