From: Bart Van Assche <Bart.VanAssche-Sjgp3cTcYWE@public.gmane.org>
To: "davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org"
<davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
"ubraun-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org"
<ubraun-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Cc: "raspl-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org"
<raspl-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>,
"netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"heiko.carstens-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org"
<heiko.carstens-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>,
"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"jwi-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org"
<jwi-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>,
"schwidefsky-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org"
<schwidefsky-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>,
"linux-s390-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-s390-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH net-next 5/5] net/smc: return booleans instead of integers
Date: Fri, 26 Jan 2018 15:57:15 +0000 [thread overview]
Message-ID: <1516982235.2651.3.camel@wdc.com> (raw)
In-Reply-To: <20180126082850.20655-6-ubraun-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
On Fri, 2018-01-26 at 09:28 +0100, Ursula Braun wrote:
> From: Gustavo A. R. Silva <gustavo@embeddedor.com>
>
> 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>
> Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
> ---
> net/smc/smc.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/smc/smc.h b/net/smc/smc.h
> index bfbe20234105..9518986c97b1 100644
> --- a/net/smc/smc.h
> +++ b/net/smc/smc.h
> @@ -252,12 +252,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;
> }
Hello Ursula,
If you ever have to touch this code again, please follow the style of other kernel
code and leave out the "? true : false" part and also the parentheses. Both are
superfluous.
Thanks,
Bart.
next prev parent reply other threads:[~2018-01-26 15:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-26 8:28 [PATCH net-next 0/5] net/smc: fixes 2018-01-26 Ursula Braun
2018-01-26 8:28 ` [PATCH net-next 1/5] net/smc: handle device, port, and QP error events Ursula Braun
2018-01-26 8:28 ` [PATCH net-next 2/5] net/smc: smc_poll improvements Ursula Braun
2018-01-26 8:28 ` [PATCH net-next 4/5] net/smc: release clcsock from tcp_listen_worker Ursula Braun
2018-01-26 8:28 ` [PATCH net-next 5/5] net/smc: return booleans instead of integers Ursula Braun
[not found] ` <20180126082850.20655-6-ubraun-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2018-01-26 15:57 ` Bart Van Assche [this message]
[not found] ` <20180126082850.20655-1-ubraun-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2018-01-26 8:28 ` [PATCH net-next 3/5] net/smc: replace sock_put worker by socket refcounting Ursula Braun
2018-01-26 15:42 ` [PATCH net-next 0/5] net/smc: fixes 2018-01-26 David Miller
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=1516982235.2651.3.camel@wdc.com \
--to=bart.vanassche-sjgp3ctcywe@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=heiko.carstens-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org \
--cc=jwi-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-s390-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=raspl-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
--cc=schwidefsky-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org \
--cc=ubraun-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.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;
as well as URLs for NNTP newsgroup(s).