All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Boris Brezillon <bbrezillon@kernel.org>,
	Arnaud Ebalard <arno@natisbad.org>,
	Srujana Challa <schalla@marvell.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Suheil Chandran <schandran@marvell.com>,
	Lukasz Bartosik <lbartosik@marvell.com>,
	Arnd Bergmann <arnd@arndb.de>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	clang-built-linux@googlegroups.com
Subject: Re: [PATCH 1/2] crypto: octeontx2 - fix -Wpointer-bool-conversion warning
Date: Thu, 4 Feb 2021 14:22:50 -0700	[thread overview]
Message-ID: <20210204212250.GA385551@localhost> (raw)
In-Reply-To: <20210204154230.1702563-1-arnd@kernel.org>

On Thu, Feb 04, 2021 at 04:42:15PM +0100, Arnd Bergmann wrote:
> 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>

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
>  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
> 

  parent reply	other threads:[~2021-02-04 21:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Nathan Chancellor [this message]
2021-02-10  7:24 ` [PATCH 1/2] crypto: octeontx2 - fix -Wpointer-bool-conversion warning Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210204212250.GA385551@localhost \
    --to=nathan@kernel.org \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=arno@natisbad.org \
    --cc=bbrezillon@kernel.org \
    --cc=clang-built-linux@googlegroups.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=lbartosik@marvell.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=schalla@marvell.com \
    --cc=schandran@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.