From: Yunfeng Ye <yeyunfeng@huawei.com>
To: <giovanni.cabiddu@intel.com>,
Herbert Xu <herbert@gondor.apana.org.au>, <davem@davemloft.net>,
<qat-linux@intel.com>
Cc: <linux-crypto@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
"hushiyuan@huawei.com" <hushiyuan@huawei.com>,
"linfeilong@huawei.com" <linfeilong@huawei.com>
Subject: [PATCH] crypto: qat - remove redundant condition accel_dev->is_vf
Date: Fri, 25 Oct 2019 15:23:05 +0800 [thread overview]
Message-ID: <78b1532c-f8bf-48e4-d0a7-30ea0137d408@huawei.com> (raw)
Warning is found by the code analysis tool:
"Redundant condition: accel_dev->is_vf"
So remove the redundant condition accel_dev->is_vf.
Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
---
drivers/crypto/qat/qat_common/adf_dev_mgr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/qat/qat_common/adf_dev_mgr.c b/drivers/crypto/qat/qat_common/adf_dev_mgr.c
index 2d06409bd3c4..b54b8850fe20 100644
--- a/drivers/crypto/qat/qat_common/adf_dev_mgr.c
+++ b/drivers/crypto/qat/qat_common/adf_dev_mgr.c
@@ -196,7 +196,7 @@ int adf_devmgr_add_dev(struct adf_accel_dev *accel_dev,
atomic_set(&accel_dev->ref_count, 0);
/* PF on host or VF on guest */
- if (!accel_dev->is_vf || (accel_dev->is_vf && !pf)) {
+ if (!accel_dev->is_vf || !pf) {
struct vf_id_map *map;
list_for_each(itr, &accel_table) {
@@ -292,7 +292,7 @@ void adf_devmgr_rm_dev(struct adf_accel_dev *accel_dev,
struct adf_accel_dev *pf)
{
mutex_lock(&table_lock);
- if (!accel_dev->is_vf || (accel_dev->is_vf && !pf)) {
+ if (!accel_dev->is_vf || !pf) {
id_map[accel_dev->accel_id] = 0;
num_devices--;
} else if (accel_dev->is_vf && pf) {
--
2.7.4
next reply other threads:[~2019-10-25 7:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-25 7:23 Yunfeng Ye [this message]
2019-10-25 9:33 ` Ard Biesheuvel
2019-10-25 9:45 ` Yunfeng Ye
[not found] ` <77832b26242f4987877d6122ba14a0d0@irsmsx101.ger.corp.intel.com>
2019-10-25 9:50 ` Giovanni Cabiddu
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=78b1532c-f8bf-48e4-d0a7-30ea0137d408@huawei.com \
--to=yeyunfeng@huawei.com \
--cc=davem@davemloft.net \
--cc=giovanni.cabiddu@intel.com \
--cc=herbert@gondor.apana.org.au \
--cc=hushiyuan@huawei.com \
--cc=linfeilong@huawei.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=qat-linux@intel.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®