Commit da6d5794 authored by kernel test robot's avatar kernel test robot Committed by Herbert Xu

crypto: qat - fix excluded_middle.cocci warnings

 Condition !A || A && B is equivalent to !A || B.

Generated by: scripts/coccinelle/misc/excluded_middle.cocci

Fixes: b76f0ea0 ("coccinelle: misc: add excluded_middle.cocci script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarJulia Lawall <julia.lawall@inria.fr>
Signed-off-by: default avatarGiovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 1148a965
...@@ -151,8 +151,8 @@ int adf_devmgr_add_dev(struct adf_accel_dev *accel_dev, ...@@ -151,8 +151,8 @@ int adf_devmgr_add_dev(struct adf_accel_dev *accel_dev,
mutex_lock(&table_lock); mutex_lock(&table_lock);
atomic_set(&accel_dev->ref_count, 0); atomic_set(&accel_dev->ref_count, 0);
/* PF on host or VF on guest */ /* PF on host or VF on guest - optimized to remove redundant is_vf */
if (!accel_dev->is_vf || (accel_dev->is_vf && !pf)) { if (!accel_dev->is_vf || !pf) {
struct vf_id_map *map; struct vf_id_map *map;
list_for_each(itr, &accel_table) { list_for_each(itr, &accel_table) {
...@@ -248,7 +248,8 @@ void adf_devmgr_rm_dev(struct adf_accel_dev *accel_dev, ...@@ -248,7 +248,8 @@ void adf_devmgr_rm_dev(struct adf_accel_dev *accel_dev,
struct adf_accel_dev *pf) struct adf_accel_dev *pf)
{ {
mutex_lock(&table_lock); mutex_lock(&table_lock);
if (!accel_dev->is_vf || (accel_dev->is_vf && !pf)) { /* PF on host or VF on guest - optimized to remove redundant is_vf */
if (!accel_dev->is_vf || !pf) {
id_map[accel_dev->accel_id] = 0; id_map[accel_dev->accel_id] = 0;
num_devices--; num_devices--;
} else if (accel_dev->is_vf && pf) { } else if (accel_dev->is_vf && pf) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment