From: Ursula Braun <ubraun@linux.vnet.ibm.com>
To: Joe Perches <joe@perches.com>,
"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
"David S. Miller" <davem@davemloft.net>
Cc: linux-s390@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
"Gustavo A. R. Silva" <garsilva@embeddedor.com>
Subject: Re: [PATCH v2] smc: return booleans instead of integers
Date: Tue, 23 Jan 2018 12:44:01 +0100 [thread overview]
Message-ID: <032c06a8-e9ce-9c06-d142-70bfeae2117a@linux.vnet.ibm.com> (raw)
In-Reply-To: <1516667515.8378.24.camel@perches.com>
On 01/23/2018 01:31 AM, Joe Perches wrote:
> On Mon, 2018-01-22 at 12:58 +0100, Ursula Braun wrote:
>>
>> On 01/19/2018 09:54 PM, 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 <gustavo@embeddedor.com>
>>> ---
>>> Changes in v2:
>>> - Fix function using_ipsec as suggested by Ursula Braun.
>>> - Update subject line.
>>>
>>> net/smc/smc.h | 4 ++--
>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/net/smc/smc.h b/net/smc/smc.h
> []
>>> @@ -253,12 +253,12 @@ static inline int smc_uncompress_bufsize(u8 compressed)
>>> static inline bool using_ipsec(struct smc_sock *smc)
>>> {
>>> return (smc->clcsock->sk->sk_policy[0] ||
>>> - smc->clcsock->sk->sk_policy[1]) ? 1 : 0;
>>> + smc->clcsock->sk->sk_policy[1]) ? true : false;
>
> Generally, any bool return like
>
> return condition ? true : false;
>
> could be written
>
> return condition;
>
This would be shorter, but is it really better readable/understandable?
Do you have a reference for us confirming your proposed style is the way to go?
prev parent reply other threads:[~2018-01-23 11:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-19 20:54 [PATCH v2] smc: return booleans instead of integers Gustavo A. R. Silva
2018-01-22 11:58 ` Ursula Braun
2018-01-22 23:38 ` Gustavo A. R. Silva
2018-01-23 0:31 ` Joe Perches
2018-01-23 11:44 ` Ursula Braun [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=032c06a8-e9ce-9c06-d142-70bfeae2117a@linux.vnet.ibm.com \
--to=ubraun@linux.vnet.ibm.com \
--cc=davem@davemloft.net \
--cc=garsilva@embeddedor.com \
--cc=gustavo@embeddedor.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox