From: Heiko Carstens <hca@linux.ibm.com>
To: Thorsten Blum <thorsten.blum@toblux.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Sven Schnelle <svens@linux.ibm.com>,
Frederic Weisbecker <frederic@kernel.org>,
Ilya Leoshkevich <iii@linux.ibm.com>,
linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] s390/smp: Use min() to fix Coccinelle warning
Date: Mon, 8 Apr 2024 13:48:34 +0200 [thread overview]
Message-ID: <20240408114834.9447-B-hca@linux.ibm.com> (raw)
In-Reply-To: <20240408105124.2162-2-thorsten.blum@toblux.com>
On Mon, Apr 08, 2024 at 12:51:25PM +0200, Thorsten Blum wrote:
> Fixes the following Coccinelle/coccicheck warning reported by
> minmax.cocci:
>
> WARNING opportunity for min()
>
> Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
> ---
> arch/s390/kernel/smp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
> index 0324649aae0a..d69cf2475744 100644
> --- a/arch/s390/kernel/smp.c
> +++ b/arch/s390/kernel/smp.c
> @@ -1205,7 +1205,7 @@ static int __init s390_smp_init(void)
>
> rc = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "s390/smp:online",
> smp_cpu_online, smp_cpu_pre_down);
> - rc = rc <= 0 ? rc : 0;
> + rc = min(rc, 0);
No. This decreases readability. Please do not send such patches just
because Coccinelle reports something.
prev parent reply other threads:[~2024-04-08 11:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-08 10:51 [PATCH] s390/smp: Use min() to fix Coccinelle warning Thorsten Blum
2024-04-08 11:48 ` Heiko Carstens [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=20240408114834.9447-B-hca@linux.ibm.com \
--to=hca@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=frederic@kernel.org \
--cc=gor@linux.ibm.com \
--cc=iii@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=svens@linux.ibm.com \
--cc=thorsten.blum@toblux.com \
/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