Skip to contentSkip to conversation

smc: return boolean instead of integer in using_ipsec

PATCH In review Gustavo A. R. Silva 2 participants 3 messages Jan 18, 2018 – Jan 19, 2018

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

PATCH 1/1 smc: return boolean instead of integer in using_ipsec

Return statements in functions returning bool should use true/false instead of 1/0.

This issue was detected with the help of Coccinelle.

---
 net/smc/smc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/smc/smc.h +1 -1
index 0bee9d1..ef13af4 100644
@@ -258,7 +258,7 @@ static inline bool using_ipsec(struct smc_sock *smc)
 #else
 static inline bool using_ipsec(struct smc_sock *smc)
 {
-	return 0;
+	return false;
 }
 #endif
 
Signature · 1 line
2.7.4
#1 lore raw
Quoted 15 lines · Gustavo A. R. Silva

Return statements in functions returning bool should use true/false instead of 1/0.

This issue was detected with the help of Coccinelle.

---
 net/smc/smc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/smc/smc.h +0 -0
index 0bee9d1..ef13af4 100644

net/smc/smc.h static inline bool using_ipsec(struct smc_sock *smc) · line 264

Quoted 8 lines
net/smc/smc.h +1 -1
@@ -258,7 +258,7 @@ static inline bool using_ipsec(struct smc_sock *smc)
 #else
 static inline bool using_ipsec(struct smc_sock *smc)
 {
-	return 0;
+	return false;
 }
 #endif
 

Gustavo,
thanks for reporting, but your improvement seems to be incomplete. Besides changing line 260 of net/smc/smc.h, line 255 should be adapted the same way. Will you come up with a second patch version here?

Kind regards, Ursula Braun

#2 lore raw

Hi Ursula,

Quoting Ursula Braun <[email protected]>:

Quoted 21 lines · Gustavo A. R. Silva
Quoted 20 lines

Return statements in functions returning bool should use true/false instead of 1/0.

This issue was detected with the help of Coccinelle.

---
 net/smc/smc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/smc/smc.h +1 -1
index 0bee9d1..ef13af4 100644
@@ -258,7 +258,7 @@ static inline bool using_ipsec(struct smc_sock *smc)
 #else
 static inline bool using_ipsec(struct smc_sock *smc)
 {
-	return 0;
+	return false;
Quoted 9 lines

net/smc/smc.h static inline bool using_ipsec(struct smc_sock *smc) · line 264

Quoted 3 lines
net/smc/smc.h +0 -0
 }
 #endif
 

Gustavo,
thanks for reporting, but your improvement seems to be incomplete. Besides changing line 260 of net/smc/smc.h, line 255 should be adapted the same way. Will you come up with a second patch version here?

You are correct. I'll send a new patch shortly.

Thanks for the feedback.
--
Gustavo