diff options
author | Marco Chiappero <marco.chiappero@intel.com> | 2021-12-16 09:13:21 +0000 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2021-12-24 14:18:25 +1100 |
commit | 952f4e81274131eda4ab0d751d6f2700b0356542 (patch) | |
tree | c8a24e42961d40e589ead6ea1792f3cf88e10312 /drivers/crypto/qat/qat_common/adf_pfvf_vf_msg.c | |
parent | crypto: qat - abstract PFVF messages with struct pfvf_message (diff) | |
download | linux-dev-952f4e81274131eda4ab0d751d6f2700b0356542.tar.xz linux-dev-952f4e81274131eda4ab0d751d6f2700b0356542.zip |
crypto: qat - leverage bitfield.h utils for PFVF messages
The PFVF protocol defines messages composed of a number of control
bitfields. Replace all the code setting and retrieving such bits
with the utilities from bitfield.h, to improve code quality and
readability.
Signed-off-by: Marco Chiappero <marco.chiappero@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r-- | drivers/crypto/qat/qat_common/adf_pfvf_vf_msg.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/crypto/qat/qat_common/adf_pfvf_vf_msg.c b/drivers/crypto/qat/qat_common/adf_pfvf_vf_msg.c index 5184a77598d2..130d7b9c12ea 100644 --- a/drivers/crypto/qat/qat_common/adf_pfvf_vf_msg.c +++ b/drivers/crypto/qat/qat_common/adf_pfvf_vf_msg.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only) /* Copyright(c) 2015 - 2021 Intel Corporation */ +#include <linux/bitfield.h> #include "adf_accel_devices.h" #include "adf_common_drv.h" #include "adf_pfvf_msg.h" @@ -67,10 +68,8 @@ int adf_vf2pf_request_version(struct adf_accel_dev *accel_dev) return ret; } - pf_version = (resp.data >> ADF_PF2VF_VERSION_RESP_VERS_SHIFT) - & ADF_PF2VF_VERSION_RESP_VERS_MASK; - compat = (resp.data >> ADF_PF2VF_VERSION_RESP_RESULT_SHIFT) - & ADF_PF2VF_VERSION_RESP_RESULT_MASK; + pf_version = FIELD_GET(ADF_PF2VF_VERSION_RESP_VERS_MASK, resp.data); + compat = FIELD_GET(ADF_PF2VF_VERSION_RESP_RESULT_MASK, resp.data); /* Response from PF received, check compatibility */ switch (compat) { |