lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 29 Feb 2016 19:05:36 -0500
From:	Alexandre Bounine <alexandre.bounine@....com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Alexandre Bounine <alexandre.bounine@....com>,
	Randy Dunlap <rdunlap@...radead.org>,
	Matt Porter <mporter@...nel.crashing.org>,
	linux-kernel@...r.kernel.org, linux-next@...r.kernel.org
Subject: [PATCH] rapidio/rio_mport_cdev: fix conflicting DMA configuration options

Fix to ensure that only CONFIG_RAPIDIO_DMA_ENGINE option is used to control
DMA code build.

Signed-off-by: Alexandre Bounine <alexandre.bounine@....com>
Reported-by: Randy Dunlap <rdunlap@...radead.org>
Cc: Randy Dunlap <rdunlap@...radead.org>
Cc: Matt Porter <mporter@...nel.crashing.org>
Cc: linux-kernel@...r.kernel.org
Cc: linux-next@...r.kernel.org
---
 drivers/rapidio/devices/rio_mport_cdev.c |   32 +++++++++++++----------------
 1 files changed, 14 insertions(+), 18 deletions(-)

diff --git a/drivers/rapidio/devices/rio_mport_cdev.c b/drivers/rapidio/devices/rio_mport_cdev.c
index e9ec8dd..9faf4d5 100644
--- a/drivers/rapidio/devices/rio_mport_cdev.c
+++ b/drivers/rapidio/devices/rio_mport_cdev.c
@@ -178,7 +178,7 @@ struct mport_dev {
 	struct list_head		portwrites;
 	spinlock_t			pw_lock;
 	struct list_head	mappings;
-#ifdef CONFIG_DMA_ENGINE
+#ifdef CONFIG_RAPIDIO_DMA_ENGINE
 	struct dma_chan *dma_chan;
 	struct kref	dma_ref;
 	struct completion comp;
@@ -209,7 +209,7 @@ struct mport_cdev_priv {
 	wait_queue_head_t       event_rx_wait;
 	spinlock_t              fifo_lock;
 	unsigned int            event_mask; /* RIO_DOORBELL, RIO_PORTWRITE */
-#ifdef CONFIG_DMA_ENGINE
+#ifdef CONFIG_RAPIDIO_DMA_ENGINE
 	struct dma_chan		*dmach;
 	struct list_head	async_list;
 	struct list_head	pend_list;
@@ -532,7 +532,7 @@ static int maint_comptag_set(struct mport_cdev_priv *priv, void __user *arg)
 	return 0;
 }
 
-#ifdef CONFIG_DMA_ENGINE
+#ifdef CONFIG_RAPIDIO_DMA_ENGINE
 
 struct mport_dma_req {
 	struct list_head node;
@@ -1127,19 +1127,6 @@ err_tmo:
 	spin_unlock(&priv->req_lock);
 	return ret;
 }
-#else /* CONFIG_DMA_ENGINE */
-static int rio_mport_transfer_ioctl(struct file *filp, void *arg)
-{
-	return -ENODEV;
-}
-
-static int rio_mport_wait_for_async_dma(struct file *filp, void __user *arg)
-{
-	return -ENODEV;
-}
-#endif /* CONFIG_DMA_ENGINE */
-
-#ifdef CONFIG_RAPIDIO_DMA_ENGINE
 
 static int rio_mport_create_dma_mapping(struct mport_dev *md, struct file *filp,
 			uint64_t size, struct rio_mport_mapping **mapping)
@@ -1228,6 +1215,16 @@ static int rio_mport_free_dma(struct file *filp, void __user *arg)
 	return 0;
 }
 #else
+static int rio_mport_transfer_ioctl(struct file *filp, void *arg)
+{
+	return -ENODEV;
+}
+
+static int rio_mport_wait_for_async_dma(struct file *filp, void __user *arg)
+{
+	return -ENODEV;
+}
+
 static int rio_mport_alloc_dma(struct file *filp, void __user *arg)
 {
 	return -ENODEV;
@@ -1237,7 +1234,6 @@ static int rio_mport_free_dma(struct file *filp, void __user *arg)
 {
 	return -ENODEV;
 }
-
 #endif /* CONFIG_RAPIDIO_DMA_ENGINE */
 
 /*
@@ -1956,7 +1952,7 @@ static int mport_cdev_open(struct inode *inode, struct file *filp)
 		goto err_fifo;
 	}
 
-#ifdef CONFIG_DMA_ENGINE
+#ifdef CONFIG_RAPIDIO_DMA_ENGINE
 	INIT_LIST_HEAD(&priv->async_list);
 	INIT_LIST_HEAD(&priv->pend_list);
 	spin_lock_init(&priv->req_lock);
-- 
1.7.8.4

Powered by blists - more mailing lists