All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] crypto: qat - resolve warnings reported by clang
@ 2022-03-04 18:03 Giovanni Cabiddu
  2022-03-04 18:03 ` [PATCH 1/3] crypto: qat - remove unneeded assignment Giovanni Cabiddu
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Giovanni Cabiddu @ 2022-03-04 18:03 UTC (permalink / raw)
  To: herbert; +Cc: linux-crypto, qat-linux, 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 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(-)

-- 
2.35.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] crypto: qat - remove unneeded assignment
  2022-03-04 18:03 [PATCH 0/3] crypto: qat - resolve warnings reported by clang Giovanni Cabiddu
@ 2022-03-04 18:03 ` Giovanni Cabiddu
  2022-03-04 18:03 ` [PATCH 2/3] crypto: qat - fix initialization of pfvf cap_msg structures Giovanni Cabiddu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Giovanni Cabiddu @ 2022-03-04 18:03 UTC (permalink / raw)
  To: herbert; +Cc: linux-crypto, qat-linux, Giovanni Cabiddu

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;
                   ^      ~~~~~

Fixes: 5901b4af6e07 ("crypto: qat - fix access to PFVF interrupt registers for GEN4")
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
---
 drivers/crypto/qat/qat_common/adf_gen4_pfvf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/qat/qat_common/adf_gen4_pfvf.c b/drivers/crypto/qat/qat_common/adf_gen4_pfvf.c
index 3b3ea849c5e5..d80d493a7756 100644
--- a/drivers/crypto/qat/qat_common/adf_gen4_pfvf.c
+++ b/drivers/crypto/qat/qat_common/adf_gen4_pfvf.c
@@ -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,
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] crypto: qat - fix initialization of pfvf cap_msg structures
  2022-03-04 18:03 [PATCH 0/3] crypto: qat - resolve warnings reported by clang Giovanni Cabiddu
  2022-03-04 18:03 ` [PATCH 1/3] crypto: qat - remove unneeded assignment Giovanni Cabiddu
@ 2022-03-04 18:03 ` Giovanni Cabiddu
  2022-03-04 18:03 ` [PATCH 3/3] crypto: qat - fix initialization of pfvf rts_map_msg structures Giovanni Cabiddu
  2022-03-09  3:23 ` [PATCH 0/3] crypto: qat - resolve warnings reported by clang Herbert Xu
  3 siblings, 0 replies; 5+ messages in thread
From: Giovanni Cabiddu @ 2022-03-04 18:03 UTC (permalink / raw)
  To: herbert; +Cc: linux-crypto, qat-linux, Giovanni Cabiddu

Initialize 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 }, };
                                                      ^

Fixes: 851ed498dba1 ("crypto: qat - exchange device capabilities over PFVF")
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
---
 drivers/crypto/qat/qat_common/adf_pfvf_vf_msg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 14b222691c9c..c5b326f63e95 100644
--- a/drivers/crypto/qat/qat_common/adf_pfvf_vf_msg.c
+++ b/drivers/crypto/qat/qat_common/adf_pfvf_vf_msg.c
@@ -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)
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] crypto: qat - fix initialization of pfvf rts_map_msg structures
  2022-03-04 18:03 [PATCH 0/3] crypto: qat - resolve warnings reported by clang Giovanni Cabiddu
  2022-03-04 18:03 ` [PATCH 1/3] crypto: qat - remove unneeded assignment Giovanni Cabiddu
  2022-03-04 18:03 ` [PATCH 2/3] crypto: qat - fix initialization of pfvf cap_msg structures Giovanni Cabiddu
@ 2022-03-04 18:03 ` Giovanni Cabiddu
  2022-03-09  3:23 ` [PATCH 0/3] crypto: qat - resolve warnings reported by clang Herbert Xu
  3 siblings, 0 replies; 5+ messages in thread
From: Giovanni Cabiddu @ 2022-03-04 18:03 UTC (permalink / raw)
  To: herbert; +Cc: linux-crypto, qat-linux, Giovanni Cabiddu

Initialize 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 }, };
                                                             ^
Fixes: e1b176af3d7e ("crypto: qat - exchange ring-to-service mappings over PFVF")
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
---
 drivers/crypto/qat/qat_common/adf_pfvf_vf_msg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 c5b326f63e95..1141258db4b6 100644
--- a/drivers/crypto/qat/qat_common/adf_pfvf_vf_msg.c
+++ b/drivers/crypto/qat/qat_common/adf_pfvf_vf_msg.c
@@ -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)
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/3] crypto: qat - resolve warnings reported by clang
  2022-03-04 18:03 [PATCH 0/3] crypto: qat - resolve warnings reported by clang Giovanni Cabiddu
                   ` (2 preceding siblings ...)
  2022-03-04 18:03 ` [PATCH 3/3] crypto: qat - fix initialization of pfvf rts_map_msg structures Giovanni Cabiddu
@ 2022-03-09  3:23 ` Herbert Xu
  3 siblings, 0 replies; 5+ messages in thread
From: Herbert Xu @ 2022-03-09  3:23 UTC (permalink / raw)
  To: Giovanni Cabiddu; +Cc: linux-crypto, qat-linux

On Fri, Mar 04, 2022 at 06:03:53PM +0000, Giovanni Cabiddu wrote:
> 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(-)

All applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-03-09  3:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-04 18:03 [PATCH 0/3] crypto: qat - resolve warnings reported by clang Giovanni Cabiddu
2022-03-04 18:03 ` [PATCH 1/3] crypto: qat - remove unneeded assignment Giovanni Cabiddu
2022-03-04 18:03 ` [PATCH 2/3] crypto: qat - fix initialization of pfvf cap_msg structures Giovanni Cabiddu
2022-03-04 18:03 ` [PATCH 3/3] crypto: qat - fix initialization of pfvf rts_map_msg structures Giovanni Cabiddu
2022-03-09  3:23 ` [PATCH 0/3] crypto: qat - resolve warnings reported by clang Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.