Skip to contentSkip to conversation

mm/kasan/kasan_init: use true and false for boolean values

PATCH In review Gustavo A. R. Silva 2 participants 4 messages Aug 4, 2018 – Aug 6, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/kasan/kasan_init: use true and false for boolean values

Return statements in functions returning bool should use true or false instead of an integer value.

This code was detected with the help of Coccinelle.

---
 mm/kasan/kasan_init.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
mm/kasan/kasan_init.c +3 -3
index 7a2a2f1..c742dc5 100644
@@ -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_zero_pte[PTRS_PER_PTE] __page_aligned_bss;
Signature · 1 line
2.7.4
reviewer
#1 lore raw
Quoted 6 lines · Gustavo A. R. Silva

Return statements in functions returning bool should use true or false instead of an integer value.

This code was detected with the help of Coccinelle.

Hi Gustavo,

I don't see this code in upstream tree. Is it against some other tree? Which?

Thanks

Quoted 37 lines
---
 mm/kasan/kasan_init.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
mm/kasan/kasan_init.c +3 -4
index 7a2a2f1..c742dc5 100644
@@ -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_zero_pte[PTRS_PER_PTE] __page_aligned_bss;
--

2.7.4

#2 lore raw

Hi Dmitry,

Quoted 5 lines · Dmitry Vyukov
Quoted 3 lines · Gustavo A. R. Silva

Return statements in functions returning bool should use true or false instead of an integer value.

Quoted 8 lines
Quoted 3 lines

This code was detected with the help of Coccinelle.

Hi Gustavo,

I don't see this code in upstream tree. Is it against some other tree? Which?

Yep. It's against linux-next.

Should I use [PATCH next] in the subject next time?

Thanks
--
Gustavo

Quoted 39 lines

Thanks

Quoted 37 lines
---
 mm/kasan/kasan_init.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
mm/kasan/kasan_init.c +3 -4
index 7a2a2f1..c742dc5 100644
@@ -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_zero_pte[PTRS_PER_PTE] __page_aligned_bss;
--

2.7.4

reviewer Acked-by
#3 lore raw
Quoted 10 lines · Gustavo A. R. Silva

Hi Dmitry,

Quoted 7 lines · Dmitry Vyukov
Quoted 5 lines · Gustavo A. R. Silva

Return statements in functions returning bool should use true or false instead of an integer value.

This code was detected with the help of Coccinelle.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Hi Gustavo,

I don't see this code in upstream tree. Is it against some other tree? Which?

Yep. It's against linux-next.

See it now.

Thanks

Quoted 1 line

Should I use [PATCH next] in the subject next time?

I dunno. I just find this part of kernel development process strange and confusing. Say, how should testing of kernel patches work? Usually today base commit is just captured by review system.

Quoted 43 lines

Thanks
--
Gustavo

Quoted 39 lines

Thanks

Quoted 37 lines
---
 mm/kasan/kasan_init.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
mm/kasan/kasan_init.c +3 -4
index 7a2a2f1..c742dc5 100644
@@ -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_zero_pte[PTRS_PER_PTE] __page_aligned_bss;
--

2.7.4