Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2326272ybp; Thu, 10 Oct 2019 05:56:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqykcDYRqHQrkIDNuRXN86TProGabq7NbVTF3Lg9VcMccB8HGo1W8D01doXWh+ifzX/yWU/I X-Received: by 2002:a05:6402:649:: with SMTP id u9mr7730596edx.200.1570712169573; Thu, 10 Oct 2019 05:56:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570712169; cv=none; d=google.com; s=arc-20160816; b=LZJLr1N7ctgURHk1yjao5gRVdRm5UB0DAR5D9yz6EW68BalVtTTKOd0MmU6iVH4uAx WdononuEJpFq3zK4Jj89XzXekQHoXr97gFB0mSZgPeiBPFlldJM/yF2FgcdAn/xm9I0o m7qRW6PbKwbXQf0QPgEnpXdaA3KwAXmgaukoVSgspWShvapMRJD9PY6vmMfdcfnoFfP8 8v1v5aqd6sLmytNWEzBhAz+1EqKj3lhiun8QbfuXSUEbx6xcl7p1U1Btisozso5+WvIf 68Me6G1R+I4rUQz2/ZL5uqPjhuJLltpNPS2l5caJtj9Bbpt1LqUapzrtVj7chO3uuFlL dB+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=09NO69mV7TXICasFd44SdxAzlLdDWYLiFAdT1RYtoLg=; b=oBMPd7660xwzv/KFX17rKZKinOzRvDB3qMiJVYQ7UAloPDo5ixICKmr44MNSJG1quH 6h095nlaYQp4vx7hcN1gCSJClX2krkT3duoPzcNVHLYFruEyAL7MPGwvguFcdzrlnoMt Kr8UBz/P5fbdRnI+DvILRuC095dt3omjySjLbFud7kDJZjO6J27COX3j4Sq9RJ4vltQq c9Iw2oT1kB+1sTqnqlcmL1VDwSw39ThtFgtTILnGqYEH0QOLcmQ4dgRzY69JVBPRppLZ bBLmqpaPaCCie9Ydn5MSCg9IX9U9NNNeWK7ldWltR/6+1zpRwcYDIuBiBvZ2NnH9/EWb dubw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c20si3052504ejs.197.2019.10.10.05.55.45; Thu, 10 Oct 2019 05:56:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387862AbfJJMzT (ORCPT + 99 others); Thu, 10 Oct 2019 08:55:19 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:37638 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728274AbfJJMzS (ORCPT ); Thu, 10 Oct 2019 08:55:18 -0400 Received: from gwarestrin.arnor.me.apana.org.au ([192.168.0.7]) by fornost.hmeau.com with smtp (Exim 4.89 #2 (Debian)) id 1iIXy9-0001sw-7h; Thu, 10 Oct 2019 23:55:02 +1100 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Thu, 10 Oct 2019 23:55:00 +1100 Date: Thu, 10 Oct 2019 23:55:00 +1100 From: Herbert Xu To: Arnd Bergmann Cc: Antoine Tenart , "David S. Miller" , Bjorn Helgaas , Pascal van Leeuwen , Pascal van Leeuwen , Kelsey Skunberg , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: Re: [PATCH 3/3] crypto: inside-secure - Remove #ifdef checks Message-ID: <20191010125500.GE31566@gondor.apana.org.au> References: <20190930121520.1388317-1-arnd@arndb.de> <20190930121520.1388317-3-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190930121520.1388317-3-arnd@arndb.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 30, 2019 at 02:14:35PM +0200, Arnd Bergmann wrote: > When both PCI and OF are disabled, no drivers are registered, and > we get some unused-function warnings: > > drivers/crypto/inside-secure/safexcel.c:1221:13: error: unused function 'safexcel_unregister_algorithms' [-Werror,-Wunused-function] > static void safexcel_unregister_algorithms(struct safexcel_crypto_priv *priv) > drivers/crypto/inside-secure/safexcel.c:1307:12: error: unused function 'safexcel_probe_generic' [-Werror,-Wunused-function] > static int safexcel_probe_generic(void *pdev, > drivers/crypto/inside-secure/safexcel.c:1531:13: error: unused function 'safexcel_hw_reset_rings' [-Werror,-Wunused-function] > static void safexcel_hw_reset_rings(struct safexcel_crypto_priv *priv) > > It's better to make the compiler see what is going on and remove > such ifdef checks completely. In case of PCI, this is trivial since > pci_register_driver() is defined to an empty function that makes the > compiler subsequently drop all unused code silently. > > The global pcireg_rc/ofreg_rc variables are not actually needed here > since the driver registration does not fail in ways that would make > it helpful. > > For CONFIG_OF, an IS_ENABLED() check is still required, since platform > drivers can exist both with and without it. > > A little change to linux/pci.h is needed to ensure that > pcim_enable_device() is visible to the driver. Moving the declaration > outside of ifdef would be sufficient here, but for consistency with the > rest of the file, adding an inline helper is probably best. > > Fixes: 212ef6f29e5b ("crypto: inside-secure - Fix unused variable warning when CONFIG_PCI=n") > Signed-off-by: Arnd Bergmann > --- > drivers/crypto/inside-secure/safexcel.c | 49 ++++++------------------- > include/linux/pci.h | 1 + > 2 files changed, 13 insertions(+), 37 deletions(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt