* [PATCH] mm/kasan/kasan_init: use true and false for boolean values
@ 2018-08-04 22:08 Gustavo A. R. Silva
2018-08-06 9:04 ` Dmitry Vyukov
0 siblings, 1 reply; 4+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-04 22:08 UTC (permalink / raw)
To: Andrey Ryabinin, Alexander Potapenko, Dmitry Vyukov
Cc: kasan-dev, linux-mm, linux-kernel, 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.
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
mm/kasan/kasan_init.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/kasan/kasan_init.c b/mm/kasan/kasan_init.c
index 7a2a2f1..c742dc5 100644
--- a/mm/kasan/kasan_init.c
+++ b/mm/kasan/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_zero_pte[PTRS_PER_PTE] __page_aligned_bss;
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mm/kasan/kasan_init: use true and false for boolean values
2018-08-04 22:08 [PATCH] mm/kasan/kasan_init: use true and false for boolean values Gustavo A. R. Silva
@ 2018-08-06 9:04 ` Dmitry Vyukov
2018-08-06 11:39 ` Gustavo A. R. Silva
0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Vyukov @ 2018-08-06 9:04 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Andrey Ryabinin, Alexander Potapenko, kasan-dev, Linux-MM, LKML
On Sun, Aug 5, 2018 at 12:08 AM, Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:
> 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.
>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Hi Gustavo,
I don't see this code in upstream tree. Is it against some other tree? Which?
Thanks
> ---
> mm/kasan/kasan_init.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/mm/kasan/kasan_init.c b/mm/kasan/kasan_init.c
> index 7a2a2f1..c742dc5 100644
> --- a/mm/kasan/kasan_init.c
> +++ b/mm/kasan/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_zero_pte[PTRS_PER_PTE] __page_aligned_bss;
> --
> 2.7.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mm/kasan/kasan_init: use true and false for boolean values
2018-08-06 9:04 ` Dmitry Vyukov
@ 2018-08-06 11:39 ` Gustavo A. R. Silva
2018-08-06 12:05 ` Dmitry Vyukov
0 siblings, 1 reply; 4+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-06 11:39 UTC (permalink / raw)
To: Dmitry Vyukov
Cc: Andrey Ryabinin, Alexander Potapenko, kasan-dev, Linux-MM, LKML
Hi Dmitry,
On 08/06/2018 04:04 AM, Dmitry Vyukov wrote:
> On Sun, Aug 5, 2018 at 12:08 AM, Gustavo A. R. Silva
> <gustavo@embeddedor.com> wrote:
>> 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.
>>
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>
> 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
> Thanks
>
>> ---
>> mm/kasan/kasan_init.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/mm/kasan/kasan_init.c b/mm/kasan/kasan_init.c
>> index 7a2a2f1..c742dc5 100644
>> --- a/mm/kasan/kasan_init.c
>> +++ b/mm/kasan/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_zero_pte[PTRS_PER_PTE] __page_aligned_bss;
>> --
>> 2.7.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mm/kasan/kasan_init: use true and false for boolean values
2018-08-06 11:39 ` Gustavo A. R. Silva
@ 2018-08-06 12:05 ` Dmitry Vyukov
0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Vyukov @ 2018-08-06 12:05 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Andrey Ryabinin, Alexander Potapenko, kasan-dev, Linux-MM, LKML
On Mon, Aug 6, 2018 at 1:39 PM, Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:
> Hi Dmitry,
>
> On 08/06/2018 04:04 AM, Dmitry Vyukov wrote:
>> On Sun, Aug 5, 2018 at 12:08 AM, Gustavo A. R. Silva
>> <gustavo@embeddedor.com> wrote:
>>> 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.
>>>
>>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>>
>> 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.
Acked-by: Dmitry Vyukov <dvyukov@google.com>
Thanks
> 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.
> Thanks
> --
> Gustavo
>
>> Thanks
>>
>>> ---
>>> mm/kasan/kasan_init.c | 6 +++---
>>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/mm/kasan/kasan_init.c b/mm/kasan/kasan_init.c
>>> index 7a2a2f1..c742dc5 100644
>>> --- a/mm/kasan/kasan_init.c
>>> +++ b/mm/kasan/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_zero_pte[PTRS_PER_PTE] __page_aligned_bss;
>>> --
>>> 2.7.4
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-08-06 12:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-04 22:08 [PATCH] mm/kasan/kasan_init: use true and false for boolean values Gustavo A. R. Silva
2018-08-06 9:04 ` Dmitry Vyukov
2018-08-06 11:39 ` Gustavo A. R. Silva
2018-08-06 12:05 ` Dmitry Vyukov
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).