From: David Laight <David.Laight@ACULAB.COM>
To: 'Bo Liu' <liubo03@inspur.com>,
"pbonzini@redhat.com" <pbonzini@redhat.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] KVM: replace ternary operator with min()
Date: Tue, 1 Nov 2022 11:16:17 +0000 [thread overview]
Message-ID: <d8a518c4a4014307b30020b38022d633@AcuMS.aculab.com> (raw)
In-Reply-To: <20221101072513.7364-1-liubo03@inspur.com>
From: Bo Liu
> Sent: 01 November 2022 07:25
>
> Fix the following coccicheck warning:
>
> virt/kvm/kvm_main.c:5289:10-11: WARNING opportunity for min()
...
> - return r < 0 ? r : 0;
> + return min(r, 0);
As has been repeatedly pointer out this is bogus.
min() should only be used for 'sizes'.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
prev parent reply other threads:[~2022-11-01 11:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-01 7:25 Bo Liu
2022-11-01 11:16 ` David Laight [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=d8a518c4a4014307b30020b38022d633@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liubo03@inspur.com \
--cc=pbonzini@redhat.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
all inboxes | Powered by JetHome®