[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <78b1532c-f8bf-48e4-d0a7-30ea0137d408@huawei.com>
Date: Fri, 25 Oct 2019 15:23:05 +0800
From: Yunfeng Ye <yeyunfeng@...wei.com>
To: <giovanni.cabiddu@...el.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
<davem@...emloft.net>, <qat-linux@...el.com>
CC: <linux-crypto@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
"hushiyuan@...wei.com" <hushiyuan@...wei.com>,
"linfeilong@...wei.com" <linfeilong@...wei.com>
Subject: [PATCH] crypto: qat - remove redundant condition accel_dev->is_vf
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@...wei.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
Powered by blists - more mailing lists