From patchwork Thu Feb 4 15:42:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 376286 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp1394761jah; Thu, 4 Feb 2021 07:44:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJyuOq/DaW2Ea9Dn7Q92681POejy2Eo4EgxRsGuMmBI1YHkUQIU+HyKUngM7RBpQey4QNk6U X-Received: by 2002:a17:906:7d97:: with SMTP id v23mr6644421ejo.222.1612453487972; Thu, 04 Feb 2021 07:44:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612453487; cv=none; d=google.com; s=arc-20160816; b=dMwX3Xpd6bSq1al4ft/rlMG14/dnFK7Sr/+yOlRcAwqw9nBP8GE7p8N1o8YFdHDk2b 2UXYzY4pJJeniwP22z7dHlwqNaDS+Vi0eI5RKqo4XjvzkXtitUJmWf24zZ+yLzPbjabv prgt0uNQ+bvKAsLEjh/h0XLDyX2BhsPWUfL20tP5uK0Bc5DYQBV02egz3EIdLVhWfm4E aTFudNLjlR/7LaiZfWTuVAUlQA9/iQYIdKifkNncoaYalOp2Tj4Skfwa50t7AESHnF6D CEJmHIJlP8Kutx02CpqsURmD/TiL+zYEP1q7O8KfTbTqvethlKpm5kmB2grQKkzVU2Dm mD8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=imT2ksGyGYUSbKECxziM0t8x5y+NReTFaDBpHMDGVSk=; b=HGCUfivrGQIZBurwXZBkg6Vzw9meMsDBj76bdiOu809gSecH61W5a+33b4fGu0kO2m W0USmTooH7CEus2PU56P3Z68rTI6/lUKS3t78N9MFSIkNgD5I6G9jOuUTMykC+y9czua oVIlfktpna3d5oExSIOxDeEesyKxjCgC4pUsU/Dr8MVsNcKI3Av3PHDO1Im8uq+xhROK 2NoJ72pGLVMbDXs5mVpXRlh3TAxhdVAUNrBUHoR77XiePuo/AcH4nDToejca2fGhEBpY Vvir4nkp1Nn/01Z+GMAeUh2NL9wBDxvfD/cENPv2DhP5yJ2UxxCJ8JJ+Ji6pyvXAtYej zq8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VASP5nnE; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j6si3431414ejc.262.2021.02.04.07.44.47; Thu, 04 Feb 2021 07:44:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VASP5nnE; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237469AbhBDPny (ORCPT + 2 others); Thu, 4 Feb 2021 10:43:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:33162 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237168AbhBDPnQ (ORCPT ); Thu, 4 Feb 2021 10:43:16 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 671D664F4D; Thu, 4 Feb 2021 15:42:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612453355; bh=EU2GB+SDJu3n1HEJNYfa0RUxpSUsohAvo/RCzjgzAGE=; h=From:To:Cc:Subject:Date:From; b=VASP5nnEDUJGGbJFGfnAdjemfxE7GLDMZ0oUaAd4SL5n+OlyfnEjEk+wg80IOADgo LjKRvbMkxjCMH74dmBs3UPnAxA0D7FxqMt11fjv9eX6R4/038/Hs+vdHG6dBMnYqwj ysxqB+JuqQl+4gUmtlIqlVHlljz9f5N3F9ZC+wUl08czrwOyNgh6ihEoTGCWKwzzo0 RXtiDP6N8qQxuZUxGGMN1yTBTmwSH6gyRORRSkMVeVLkehsde33zmeGdE4PgTMWhgU 0wa/A5D4GQIOGZtLpHYUNOlJFEw/MyhBiz+oUxBx94paBcVdjBo/sueH8i9Mg3rSwZ 6IwZ3uQ1a8gIw== From: Arnd Bergmann 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@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: [PATCH 1/2] crypto: octeontx2 - fix -Wpointer-bool-conversion warning Date: Thu, 4 Feb 2021 16:42:15 +0100 Message-Id: <20210204154230.1702563-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Arnd Bergmann 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 --- drivers/crypto/marvell/octeontx2/otx2_cptlf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.29.2 Reviewed-by: Nathan Chancellor 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); } }