[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKv+Gu-KFp13gnx=cnVRrU4_sD8qLLXFcTOK8zuc7MC+B+GmcQ@mail.gmail.com>
Date: Mon, 2 Sep 2019 18:32:45 -0700
From: Ard Biesheuvel <ard.biesheuvel@...aro.org>
To: YueHaibing <yuehaibing@...wei.com>
Cc: Antoine Tenart <antoine.tenart@...tlin.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>,
Pascal Van Leeuwen <pvanleeuwen@...idesecure.com>,
"open list:HARDWARE RANDOM NUMBER GENERATOR CORE"
<linux-crypto@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] crypto: inside-secure - Fix build error without CONFIG_PCI
On Mon, 2 Sep 2019 at 07:19, YueHaibing <yuehaibing@...wei.com> wrote:
>
> If CONFIG_PCI is not set, building fails:
>
> rivers/crypto/inside-secure/safexcel.c: In function safexcel_request_ring_irq:
> drivers/crypto/inside-secure/safexcel.c:944:9: error: implicit declaration of function pci_irq_vector;
> did you mean rcu_irq_enter? [-Werror=implicit-function-declaration]
> irq = pci_irq_vector(pci_pdev, irqid);
> ^~~~~~~~~~~~~~
>
> Use #ifdef block to guard this.
>
> Fixes: 625f269a5a7a ("crypto: inside-secure - add support for PCI based FPGA development board")
> Signed-off-by: YueHaibing <yuehaibing@...wei.com>
> ---
> drivers/crypto/inside-secure/safexcel.c | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/crypto/inside-secure/safexcel.c b/drivers/crypto/inside-secure/safexcel.c
> index e12a2a3..c23fe34 100644
> --- a/drivers/crypto/inside-secure/safexcel.c
> +++ b/drivers/crypto/inside-secure/safexcel.c
> @@ -937,7 +937,8 @@ static int safexcel_request_ring_irq(void *pdev, int irqid,
> int ret, irq;
> struct device *dev;
>
> - if (IS_ENABLED(CONFIG_PCI) && is_pci_dev) {
> +#if IS_ENABLED(CONFIG_PCI)
please don't use IS_ENABLED() with preprocessor conditionals - just
use #ifdef CONFIG_PCI instead
> + if (is_pci_dev) {
> struct pci_dev *pci_pdev = pdev;
>
> dev = &pci_pdev->dev;
> @@ -947,7 +948,10 @@ static int safexcel_request_ring_irq(void *pdev, int irqid,
> irqid, irq);
> return irq;
> }
> - } else if (IS_ENABLED(CONFIG_OF)) {
> + } else
> +#endif
> + {
> +#if IS_ENABLED(CONFIG_OF)
> struct platform_device *plf_pdev = pdev;
> char irq_name[6] = {0}; /* "ringX\0" */
>
> @@ -960,6 +964,7 @@ static int safexcel_request_ring_irq(void *pdev, int irqid,
> irq_name, irq);
> return irq;
> }
> +#endif
> }
>
> ret = devm_request_threaded_irq(dev, irq, handler,
> @@ -1137,7 +1142,8 @@ static int safexcel_probe_generic(void *pdev,
>
> safexcel_configure(priv);
>
> - if (IS_ENABLED(CONFIG_PCI) && priv->version == EIP197_DEVBRD) {
> +#if IS_ENABLED(CONFIG_PCI)
> + if (priv->version == EIP197_DEVBRD) {
> /*
> * Request MSI vectors for global + 1 per ring -
> * or just 1 for older dev images
> @@ -1153,6 +1159,7 @@ static int safexcel_probe_generic(void *pdev,
> return ret;
> }
> }
> +#endif
>
> /* Register the ring IRQ handlers and configure the rings */
> priv->ring = devm_kcalloc(dev, priv->config.rings,
> --
> 2.7.4
>
>
Powered by blists - more mailing lists