From: Guo Zhengkui <guozhengkui@vivo.com>
To: Jon Mason <jdmason@kudzu.us>, Dave Jiang <dave.jiang@intel.com>,
Allen Hubbe <allenbh@gmail.com>,
Yang Li <yang.lee@linux.alibaba.com>,
Guo Zhengkui <guozhengkui@vivo.com>,
Alexander Fomichev <fomichev.ru@gmail.com>,
Serge Semin <fancer.lancer@gmail.com>,
ntb@lists.linux.dev (open list:NTB DRIVER CORE),
linux-kernel@vger.kernel.org (open list)
Cc: zhengkui_guo@outlook.com
Subject: [PATCH] ntb_perf: fix doubletest cocci warning
Date: Tue, 19 Apr 2022 15:18:50 +0800 [thread overview]
Message-ID: <20220419071855.23338-1-guozhengkui@vivo.com> (raw)
`!data->ops.init` has been repeated triple. The original logic is to
check whether `.init`, `.run` and `.clear` callbacks are NULL or not.
Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
---
drivers/ntb/test/ntb_perf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c
index c106c3a5097e..dcae4be91365 100644
--- a/drivers/ntb/test/ntb_perf.c
+++ b/drivers/ntb/test/ntb_perf.c
@@ -1451,7 +1451,7 @@ static void perf_ext_lat_work(struct work_struct *work)
{
struct perf_ext_lat_data *data = to_ext_lat_data(work);
- if (!data->ops.init || !data->ops.init || !data->ops.init) {
+ if (!data->ops.init || !data->ops.run || !data->ops.clear) {
struct perf_ctx *perf = data->perf;
data->status = -EFAULT;
--
2.20.1
next reply other threads:[~2022-04-19 7:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-19 7:18 Guo Zhengkui [this message]
2022-04-19 15:37 ` [PATCH] ntb_perf: fix doubletest cocci warning Dave Jiang
2022-04-19 15:49 ` Logan Gunthorpe
2022-04-20 8:46 ` Alexander Fomichev
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=20220419071855.23338-1-guozhengkui@vivo.com \
--to=guozhengkui@vivo.com \
--cc=allenbh@gmail.com \
--cc=dave.jiang@intel.com \
--cc=fancer.lancer@gmail.com \
--cc=fomichev.ru@gmail.com \
--cc=jdmason@kudzu.us \
--cc=linux-kernel@vger.kernel.org \
--cc=ntb@lists.linux.dev \
--cc=yang.lee@linux.alibaba.com \
--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;
as well as URLs for NNTP newsgroup(s).