linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] crypto: inside-secure - Fix build error without CONFIG_PCI
@ 2019-09-02 14:19 YueHaibing
  2019-09-03  1:32 ` Ard Biesheuvel
  2019-09-03  1:45 ` [PATCH v2 " YueHaibing
  0 siblings, 2 replies; 17+ messages in thread
From: YueHaibing @ 2019-09-02 14:19 UTC (permalink / raw)
  To: antoine.tenart, herbert, davem, pvanleeuwen
  Cc: linux-crypto, linux-kernel, YueHaibing

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@huawei.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)
+	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



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

end of thread, other threads:[~2019-09-20 23:17 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-02 14:19 [PATCH -next] crypto: inside-secure - Fix build error without CONFIG_PCI YueHaibing
2019-09-03  1:32 ` Ard Biesheuvel
2019-09-03  1:45 ` [PATCH v2 " YueHaibing
2019-09-04 11:57   ` Pascal Van Leeuwen
2019-09-04 12:10     ` Ard Biesheuvel
2019-09-04 12:25       ` Pascal Van Leeuwen
2019-09-04 12:27         ` Ard Biesheuvel
2019-09-04 12:31           ` Herbert Xu
2019-09-04 12:45             ` Pascal Van Leeuwen
2019-09-04 13:08               ` Herbert Xu
2019-09-04 12:43           ` Pascal Van Leeuwen
2019-09-04 12:26       ` PCI: Add stub pci_irq_vector and others Herbert Xu
2019-09-04 14:33         ` Yuehaibing
2019-09-05 21:07         ` Bjorn Helgaas
2019-09-05 22:53           ` Herbert Xu
2019-09-20 19:42         ` Bjorn Helgaas
2019-09-20 23:16           ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).