Skip to contentSkip to conversation

net: ipv6: ndisc: fix bool assignment in ndisc_send_na

PATCH In review Gustavo A. R. Silva 2 participants 5 messages Jan 22, 2018 – Jan 23, 2018

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

PATCH 1/1 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.")
---
 net/ipv6/ndisc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/ndisc.c +1 -1
index b3cea20..936f13c 100644
@@ -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);
Signature · 1 line
2.7.4
maintainer
#1 lore raw

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

Quoted 6 lines

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

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.

#2 lore raw

Quoting David Miller <[email protected]>:

Quoted 7 lines

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

Quoted 4 lines

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

This issue was detected with the help of Coccinelle.

Quoted 8 lines
Quoted 2 lines
Fixes 1cb3fe513f62 ("ndisc: Break down ndisc_build_skb() and build message directly.")

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

maintainer
#3 lore raw

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

Quoted 14 lines

Quoting David Miller <[email protected]>:

Quoted 11 lines

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

Quoted 7 lines

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

Quoted 7 lines
Quoted 5 lines

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.

#4 lore raw

Quoting David Miller <[email protected]>:

[..]

Quoted 9 lines
Quoted 7 lines
Quoted 5 lines

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