Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4039315ybg; Fri, 25 Oct 2019 12:26:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqwMBRBYeryPQAJ7dqVgoYrrlI8dmko6zS2RG1VPuUXknDJYpxs/hbZ20ORnr2MVhTieHj+i X-Received: by 2002:aa7:d81a:: with SMTP id v26mr5702148edq.213.1572031596055; Fri, 25 Oct 2019 12:26:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572031596; cv=none; d=google.com; s=arc-20160816; b=sGbo+oSZufzbVtNzuJz3pQw0I5TejTBz7h/jsYGJuME+eDK+h7N8b1jHYn0ZUniuZm VYXDAswCmPc08tVPo4PZp9YfOSOXW06zKRyj6g+vQooVQlrPSYVeXMW5vDar5lEhuOcW JcJthp1eaNDSrW6G7E6R7oU3MwYd1/n6M4HttWO2Yys0TjwTKNF4+GevbzSZhS8+lYG4 56V2yWrkbJE/Ya3hQfcQK8aQTX9UQ7OIZNFPRr3ytXmTG3V2CKas71bduD9Fa62tfGXD OfZB+3fOE3J+4dajW91yZgbbRo2MzKHQKpuruq9r+LJKNQqpkcRn3K2ruerQZFZLKDzo 6Y8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:mime-version:user-agent:date:message-id:subject :from:cc:to; bh=5CtSOBMcTH3l1qGuJyxvSbWcLwKhM3MYOmxj09H+S5w=; b=u5aemh6kVWyKBPxhMlLNKCXO2a2aqIYkrNTSS/oFEPu9M3Md7ax9RL4JQXWK5oMY2z iSd1EHBFQp8CjY3mEa0L8OOCNy9julhJ8YT/Xzm7MNrU4v3qdJY6hDDzbRMNb9q+SeG/ 2rfi8rhJyY3yCJAvOiYRFXLTCYBEAgKZf7Dkg7PrBwo7eaD/AO1vd/RwvjNoApEsxOjG WXfxaT011FDlokbVWaUzU8iKi+CGlSs1Ebccj3KRiK1EqWcsK+zzB7wv8sJ32vG0pqpE ZUnh2hzyQp+OjuM9+Py8cozhDRq6aOQWpiqFRokggvExCKKjY5ouwzWnBvHBcLYsICN6 /0aQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z35si1964457edz.260.2019.10.25.12.26.13; Fri, 25 Oct 2019 12:26:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406865AbfJYHYB (ORCPT + 99 others); Fri, 25 Oct 2019 03:24:01 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:42690 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2391415AbfJYHYB (ORCPT ); Fri, 25 Oct 2019 03:24:01 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id B5BBB970A9270F51CACF; Fri, 25 Oct 2019 15:23:58 +0800 (CST) Received: from [127.0.0.1] (10.177.251.225) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.439.0; Fri, 25 Oct 2019 15:23:48 +0800 To: , Herbert Xu , , CC: , , "hushiyuan@huawei.com" , "linfeilong@huawei.com" From: Yunfeng Ye Subject: [PATCH] crypto: qat - remove redundant condition accel_dev->is_vf Message-ID: <78b1532c-f8bf-48e4-d0a7-30ea0137d408@huawei.com> Date: Fri, 25 Oct 2019 15:23:05 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.251.225] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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