# \[PATCH\] smc: return boolean instead of integer in using\_ipsec

- Subsystems: SHARED MEMORY COMMUNICATIONS (SMC) SOCKETS, NETWORKING \[GENERAL\], THE REST
- Maintainers: D. Wythe, Dust Li, Sidraya Jayagond, Mahanta Jambigi, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Willem de Bruijn, Linus Torvalds
- List: linux-s390
- 3 messages, 2 authors
- Page: https://ratatoskr.run/linux-s390/2018/01/5187708/t

## \[PATCH\] smc: return boolean instead of integer in using\_ipsec

- From: Gustavo A. R. Silva \<hidden\>
- Date: 2018-01-18 23:57:19 
- Message: https://ratatoskr.run/linux-s390/2018/01/5187708.md

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

This issue was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <redacted>
---
 net/smc/smc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/smc/smc.h b/net/smc/smc.h
index 0bee9d1..ef13af4 100644
--- a/net/smc/smc.h
+++ b/net/smc/smc.h
@@ -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
 
-- 
2.7.4
```

## Re: \[PATCH\] smc: return boolean instead of integer in using\_ipsec

- From: Ursula Braun \<hidden\>
- Date: 2018-01-19 08:36:30 
- Message: https://ratatoskr.run/linux-s390/2018/01/5187845.md

```text


On 01/19/2018 12:33 AM, Gustavo A. R. Silva wrote:
> Return statements in functions returning bool should use
> true/false instead of 1/0.
> 
> This issue was detected with the help of Coccinelle.
> 
> Signed-off-by: Gustavo A. R. Silva <redacted>
> ---
>  net/smc/smc.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/smc/smc.h b/net/smc/smc.h
> index 0bee9d1..ef13af4 100644
> --- a/net/smc/smc.h
> +++ b/net/smc/smc.h
> @@ -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
```

## Re: \[PATCH\] smc: return boolean instead of integer in using\_ipsec

- From: Gustavo A. R. Silva \<hidden\>
- Date: 2018-01-19 21:09:53 
- Message: https://ratatoskr.run/linux-s390/2018/01/5188225.md

```text
Hi Ursula,

Quoting Ursula Braun [ref]:

> On 01/19/2018 12:33 AM, Gustavo A. R. Silva wrote:
>> Return statements in functions returning bool should use
>> true/false instead of 1/0.
>>
>> This issue was detected with the help of Coccinelle.
>>
>> Signed-off-by: Gustavo A. R. Silva <redacted>
>> ---
>>  net/smc/smc.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/net/smc/smc.h b/net/smc/smc.h
>> index 0bee9d1..ef13af4 100644
>> --- a/net/smc/smc.h
>> +++ b/net/smc/smc.h
>> @@ -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?
>

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

Thanks for the feedback.
--
Gustavo
```
