All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] crypto: octeontx2 - fix -Wpointer-bool-conversion warning
@ 2021-02-04 15:42 Arnd Bergmann
  2021-02-04 15:42 ` [PATCH 2/2] crypto: marvell - fix ethernet driver dependency Arnd Bergmann
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Arnd Bergmann @ 2021-02-04 15:42 UTC (permalink / raw)
  To: Boris Brezillon, Arnaud Ebalard, Srujana Challa, Herbert Xu,
	David S. Miller, Nathan Chancellor, Nick Desaulniers,
	Suheil Chandran, Lukasz Bartosik
  Cc: Arnd Bergmann, linux-crypto, linux-kernel, clang-built-linux

From: Arnd Bergmann <arnd@arndb.de>

When CONFIG_CPUMASK_OFFSTACK is disabled, clang reports a warning
about a bogus condition:

drivers/crypto/marvell/octeontx2/otx2_cptlf.c:334:21: error: address of array 'lfs->lf[slot].affinity_mask' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
                if (lfs->lf[slot].affinity_mask)
                ~~  ~~~~~~~~~~~~~~^~~~~~~~~~~~~

In this configuration, the free_cpumask_var() function does nothing,
so the condition could be skipped.

When the option is enabled, there is no warning, but the check
is also redundant because free_cpumask_var() falls back to kfree(),
which is documented as ignoring NULL pointers.

Remove the check to avoid the warning.

Fixes: 64506017030d ("crypto: octeontx2 - add LF framework")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/crypto/marvell/octeontx2/otx2_cptlf.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/crypto/marvell/octeontx2/otx2_cptlf.c b/drivers/crypto/marvell/octeontx2/otx2_cptlf.c
index e27ea8909368..823a4571fd67 100644
--- a/drivers/crypto/marvell/octeontx2/otx2_cptlf.c
+++ b/drivers/crypto/marvell/octeontx2/otx2_cptlf.c
@@ -331,8 +331,7 @@ void otx2_cptlf_free_irqs_affinity(struct otx2_cptlfs_info *lfs)
 			irq_set_affinity_hint(pci_irq_vector(lfs->pdev,
 					      lfs->lf[slot].msix_offset +
 					      offs), NULL);
-		if (lfs->lf[slot].affinity_mask)
-			free_cpumask_var(lfs->lf[slot].affinity_mask);
+		free_cpumask_var(lfs->lf[slot].affinity_mask);
 	}
 }
 
-- 
2.29.2


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

end of thread, other threads:[~2021-02-10  7:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-04 15:42 [PATCH 1/2] crypto: octeontx2 - fix -Wpointer-bool-conversion warning Arnd Bergmann
2021-02-04 15:42 ` [PATCH 2/2] crypto: marvell - fix ethernet driver dependency Arnd Bergmann
2021-02-04 19:47   ` Herbert Xu
2021-02-04 21:22 ` [PATCH 1/2] crypto: octeontx2 - fix -Wpointer-bool-conversion warning Nathan Chancellor
2021-02-10  7:24 ` 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.