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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 14 Jan 2019 12:23:48 +0100
From:   Christoph Hellwig <hch@....de>
To:     "James E.J. Bottomley" <jejb@...isc-linux.org>,
        Helge Deller <deller@....de>
Cc:     linux-parisc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 3/8] parisc: turn GET_IOC into an inline function

This makes the function both more readable and more typesafe.

Signed-off-by: Christoph Hellwig <hch@....de>
---
 drivers/parisc/iommu.h | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/parisc/iommu.h b/drivers/parisc/iommu.h
index c72c4fe51a3a..94d5eae98bf6 100644
--- a/drivers/parisc/iommu.h
+++ b/drivers/parisc/iommu.h
@@ -24,10 +24,14 @@ static inline void *parisc_walk_tree(struct device *dev)
 	return dev->platform_data;
 }
 
-#define GET_IOC(dev) ({					\
-	void *__pdata = parisc_walk_tree(dev);		\
-	__pdata ? HBA_DATA(__pdata)->iommu : NULL;	\
-})
+static inline struct ioc *GET_IOC(struct device *dev)
+{
+	struct pci_hba_data *pdata = parisc_walk_tree(dev);
+
+	if (!pdata)
+		return NULL;
+	return pdata->iommu;
+}
 
 #ifdef CONFIG_IOMMU_CCIO
 void *ccio_get_iommu(const struct parisc_device *dev);
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ