crypto: qat - resolve warnings reported by clang
cover crypto: qat - resolve warnings reported by clang
Resolve minor issues reported by clang, when compiling the driver with W=2, and by scan-build.
Giovanni Cabiddu (3):
crypto: qat - remove unneeded assignment
crypto: qat - fix initialization of pfvf cap_msg structures
crypto: qat - fix initialization of pfvf rts_map_msg structures
drivers/crypto/qat/qat_common/adf_gen4_pfvf.c | 2 +- drivers/crypto/qat/qat_common/adf_pfvf_vf_msg.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.35.1
PATCH 1/3 crypto: qat - remove unneeded assignment
The function adf_gen4_get_vf2pf_sources() computes a mask which is stored in a variable which is returned and not used. Remove superfluous assignment of variable.
This is to fix the following warning when compiling the QAT driver with clang scan-build:
drivers/crypto/qat/qat_common/adf_gen4_pfvf.c:46:9: warning: Although the value stored to 'sou' is used in the enclosing expression, the value is never actually read from 'sou' [deadcode.DeadStores]
return sou &= ~mask;
^ ~~~~~--- drivers/crypto/qat/qat_common/adf_gen4_pfvf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/qat/qat_common/adf_gen4_pfvf.c +1 -1
@@ -43,7 +43,7 @@ static u32 adf_gen4_get_vf2pf_sources(void __iomem *pmisc_addr) sou =ADF_CSR_RD (pmisc_addr,ADF_4XXX_VM2PF_SOU ); mask =ADF_CSR_RD (pmisc_addr,ADF_4XXX_VM2PF_MSK ); -return sou &= ~mask; +return sou & ~mask; } static void adf_gen4_enable_vf2pf_interrupts(void __iomem *pmisc_addr,
Signature · 1 line
2.35.1
PATCH 2/3 crypto: qat - fix initialization of pfvf cap_msg structures
In reply to Giovanni CabidduInitialize fully the structures cap_msg containing the device capabilities from the host.
This is to fix the following warning when compiling the QAT driver using the clang compiler with CC=clang W=2:
drivers/crypto/qat/qat_common/adf_pfvf_vf_msg.c:99:44: warning: missing field 'ext_dc_caps' initializer [-Wmissing-field-initializers]
struct capabilities_v3 cap_msg = { { 0 }, };
^--- drivers/crypto/qat/qat_common/adf_pfvf_vf_msg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/qat/qat_common/adf_pfvf_vf_msg.c +1 -1
@@ -96,7 +96,7 @@ int adf_vf2pf_request_version(struct adf_accel_dev *accel_dev)int adf_vf2pf_get_capabilities (struct adf_accel_dev *accel_dev) {struct adf_hw_device_data *hw_data = accel_dev->hw_device; -struct capabilities_v3 cap_msg = { {0 }, }; +struct capabilities_v3 cap_msg = {0 };unsigned int len =sizeof (cap_msg);if (accel_dev->vf.pf_compat_ver <ADF_PFVF_COMPAT_CAPABILITIES )
Signature · 1 line
2.35.1
PATCH 3/3 crypto: qat - fix initialization of pfvf rts_map_msg structures
In reply to Giovanni CabidduInitialize fully the structures rts_map_msg containing the ring to service map from the host.
This is to fix the following warning when compiling the QAT driver using the clang compiler with CC=clang W=2:
drivers/crypto/qat/qat_common/adf_pfvf_vf_msg.c:144:51: warning: missing field 'map' initializer [-Wmissing-field-initializers]
struct ring_to_svc_map_v1 rts_map_msg = { { 0 }, };
^--- drivers/crypto/qat/qat_common/adf_pfvf_vf_msg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/qat/qat_common/adf_pfvf_vf_msg.c +1 -1
@@ -141,7 +141,7 @@ int adf_vf2pf_get_capabilities(struct adf_accel_dev *accel_dev)int adf_vf2pf_get_ring_to_svc (struct adf_accel_dev *accel_dev) { -struct ring_to_svc_map_v1 rts_map_msg = { {0 }, }; +struct ring_to_svc_map_v1 rts_map_msg = {0 };unsigned int len =sizeof (rts_map_msg);if (accel_dev->vf.pf_compat_ver <ADF_PFVF_COMPAT_RING_TO_SVC_MAP )
Signature · 1 line
2.35.1
Herbert Xu
maintainerQuoted 11 lines · Giovanni Cabiddu
Resolve minor issues reported by clang, when compiling the driver with W=2, and by scan-build.
Giovanni Cabiddu (3):
crypto: qat - remove unneeded assignment
crypto: qat - fix initialization of pfvfcap_msgstructures
crypto: qat - fix initialization of pfvfrts_map_msgstructuresdrivers/crypto/qat/qat_common/adf_gen4_pfvf.c | 2 +- drivers/crypto/qat/qat_common/adf_pfvf_vf_msg.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
All applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt