From: Guo Zhengkui <guozhengkui@vivo.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Potnuri Bharat Teja <bharat@chelsio.com>,
Leon Romanovsky <leon@kernel.org>,
Bernard Metzler <bmt@zurich.ibm.com>,
"open list:CXGB4 IWARP RNIC DRIVER (IW_CXGB4)"
<linux-rdma@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>,
zhengkui_guo@outlook.com
Subject: Re: [PATCH] RDMA: replace ternary operator with min()
Date: Thu, 12 May 2022 22:39:42 +0800 [thread overview]
Message-ID: <88e501de-9653-0570-74da-d1f7b858a2f0@vivo.com> (raw)
In-Reply-To: <20220512141108.GC63055@ziepe.ca>
On 2022/5/12 22:11, Jason Gunthorpe wrote:
> On Thu, May 12, 2022 at 09:58:37PM +0800, Guo Zhengkui wrote:
>> Fix the following coccicheck warnings:
>>
>> drivers/infiniband/sw/siw/siw_cm.c:1326:11-12: WARNING opportunity for min()
>> drivers/infiniband/sw/siw/siw_cm.c:488:11-12: WARNING opportunity for min()
>> drivers/infiniband/hw/cxgb4/cm.c:217:14-15: WARNING opportunity for min()
>> drivers/infiniband/hw/cxgb4/cm.c:232:14-15: WARNING opportunity for min()
>>
>> min() macro is defined in include/linux/minmax.h. It avoids multiple
>> evaluations of the arguments when non-constant and performs strict
>> type-checking.
>
> no, these are all error return patterns, if you want to change them to
> something change them to
>
> if (error < 0)
> return error;
> return 0;
Do you mean we need to stress that they are error return patterns
instead of taking "minimum value" style code?
Zhengkui
>
> Jason
prev parent reply other threads:[~2022-05-12 14:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-12 13:58 Guo Zhengkui
2022-05-12 14:11 ` Jason Gunthorpe
2022-05-12 14:39 ` Guo Zhengkui [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=88e501de-9653-0570-74da-d1f7b858a2f0@vivo.com \
--to=guozhengkui@vivo.com \
--cc=bharat@chelsio.com \
--cc=bmt@zurich.ibm.com \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=zhengkui_guo@outlook.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®