netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: ipv6: ndisc: fix bool assignment in ndisc_send_na
@ 2018-01-22 22:22 Gustavo A. R. Silva
  2018-01-23 15:02 ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Gustavo A. R. Silva @ 2018-01-22 22:22 UTC (permalink / raw)
  To: David S. Miller, Alexey Kuznetsov, Hideaki YOSHIFUJI
  Cc: netdev, linux-kernel, Gustavo A. R. Silva

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 <garsilva@embeddedor.com>
---
 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

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

* Re: [PATCH] net: ipv6: ndisc: fix bool assignment in ndisc_send_na
  2018-01-22 22:22 [PATCH] net: ipv6: ndisc: fix bool assignment in ndisc_send_na Gustavo A. R. Silva
@ 2018-01-23 15:02 ` David Miller
  2018-01-23 15:21   ` Gustavo A. R. Silva
  0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2018-01-23 15:02 UTC (permalink / raw)
  To: garsilva; +Cc: kuznet, yoshfuji, netdev, linux-kernel

From: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
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 <garsilva@embeddedor.com>

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.

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

* Re: [PATCH] net: ipv6: ndisc: fix bool assignment in ndisc_send_na
  2018-01-23 15:02 ` David Miller
@ 2018-01-23 15:21   ` Gustavo A. R. Silva
  2018-01-23 16:28     ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Gustavo A. R. Silva @ 2018-01-23 15:21 UTC (permalink / raw)
  To: David Miller; +Cc: kuznet, yoshfuji, netdev, linux-kernel


Quoting David Miller <davem@davemloft.net>:

> From: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
> 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 <garsilva@embeddedor.com>
>
> 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

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

* Re: [PATCH] net: ipv6: ndisc: fix bool assignment in ndisc_send_na
  2018-01-23 15:21   ` Gustavo A. R. Silva
@ 2018-01-23 16:28     ` David Miller
  2018-01-23 16:30       ` Gustavo A. R. Silva
  0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2018-01-23 16:28 UTC (permalink / raw)
  To: garsilva; +Cc: kuznet, yoshfuji, netdev, linux-kernel

From: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Date: Tue, 23 Jan 2018 09:21:00 -0600

> 
> Quoting David Miller <davem@davemloft.net>:
> 
>> From: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
>> 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 <garsilva@embeddedor.com>
>>
>> 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.

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

* Re: [PATCH] net: ipv6: ndisc: fix bool assignment in ndisc_send_na
  2018-01-23 16:28     ` David Miller
@ 2018-01-23 16:30       ` Gustavo A. R. Silva
  0 siblings, 0 replies; 5+ messages in thread
From: Gustavo A. R. Silva @ 2018-01-23 16:30 UTC (permalink / raw)
  To: David Miller; +Cc: kuznet, yoshfuji, netdev, linux-kernel


Quoting David Miller <davem@davemloft.net>:

[..]
>>> 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

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

end of thread, other threads:[~2018-01-23 16:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-22 22:22 [PATCH] net: ipv6: ndisc: fix bool assignment in ndisc_send_na Gustavo A. R. Silva
2018-01-23 15:02 ` David Miller
2018-01-23 15:21   ` Gustavo A. R. Silva
2018-01-23 16:28     ` David Miller
2018-01-23 16:30       ` Gustavo A. R. Silva

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