2018-01-22 22:23:13

by Gustavo A. R. Silva

[permalink] [raw]
Subject: [PATCH] net: ipv6: ndisc: fix bool assignment in ndisc_send_na

Assign true or false to boolean variables instead of an integer value.

This issue was detected with the help of Coccinelle.

Fixes: 1cb3fe513f62 ("ndisc: Break down ndisc_build_skb() and build message directly.")
Signed-off-by: Gustavo A. R. Silva <[email protected]>
---
net/ipv6/ndisc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index b3cea20..936f13c 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -527,7 +527,7 @@ void ndisc_send_na(struct net_device *dev, const struct in6_addr *daddr,
}

if (!dev->addr_len)
- inc_opt = 0;
+ inc_opt = false;
if (inc_opt)
optlen += ndisc_opt_addr_space(dev,
NDISC_NEIGHBOUR_ADVERTISEMENT);
--
2.7.4



2018-01-23 15:03:34

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] net: ipv6: ndisc: fix bool assignment in ndisc_send_na

From: "Gustavo A. R. Silva" <[email protected]>
Date: Mon, 22 Jan 2018 16:22:13 -0600

> Assign true or false to boolean variables instead of an integer value.
>
> This issue was detected with the help of Coccinelle.
>
> Fixes: 1cb3fe513f62 ("ndisc: Break down ndisc_build_skb() and build message directly.")
> Signed-off-by: Gustavo A. R. Silva <[email protected]>

Please don't use the word "fix".

'0' is the same as 'false', it's just that the latter is more
consistent type wise.

You aren't fixing any bugs with these changes at all.

2018-01-23 15:22:16

by Gustavo A. R. Silva

[permalink] [raw]
Subject: Re: [PATCH] net: ipv6: ndisc: fix bool assignment in ndisc_send_na


Quoting David Miller <[email protected]>:

> From: "Gustavo A. R. Silva" <[email protected]>
> Date: Mon, 22 Jan 2018 16:22:13 -0600
>
>> Assign true or false to boolean variables instead of an integer value.
>>
>> This issue was detected with the help of Coccinelle.
>>
>> Fixes: 1cb3fe513f62 ("ndisc: Break down ndisc_build_skb() and build
>> message directly.")
>> Signed-off-by: Gustavo A. R. Silva <[email protected]>
>
> Please don't use the word "fix".
>
> '0' is the same as 'false', it's just that the latter is more
> consistent type wise.
>

So "Use true and false for boolean value" would be a better subject?

Thanks
--
Gustavo





2018-01-23 16:29:22

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] net: ipv6: ndisc: fix bool assignment in ndisc_send_na

From: "Gustavo A. R. Silva" <[email protected]>
Date: Tue, 23 Jan 2018 09:21:00 -0600

>
> Quoting David Miller <[email protected]>:
>
>> From: "Gustavo A. R. Silva" <[email protected]>
>> Date: Mon, 22 Jan 2018 16:22:13 -0600
>>
>>> Assign true or false to boolean variables instead of an integer value.
>>>
>>> This issue was detected with the help of Coccinelle.
>>>
>>> Fixes: 1cb3fe513f62 ("ndisc: Break down ndisc_build_skb() and build
>>> message directly.")
>>> Signed-off-by: Gustavo A. R. Silva <[email protected]>
>>
>> Please don't use the word "fix".
>>
>> '0' is the same as 'false', it's just that the latter is more
>> consistent type wise.
>>
>
> So "Use true and false for boolean value" would be a better subject?

Yes.

2018-01-23 16:30:44

by Gustavo A. R. Silva

[permalink] [raw]
Subject: Re: [PATCH] net: ipv6: ndisc: fix bool assignment in ndisc_send_na


Quoting David Miller <[email protected]>:

[..]
>>> Please don't use the word "fix".
>>>
>>> '0' is the same as 'false', it's just that the latter is more
>>> consistent type wise.
>>>
>>
>> So "Use true and false for boolean value" would be a better subject?
>
> Yes.

I got it.

Thanks
--
Gustavo