diff mbox series

[3/8] parisc: turn GET_IOC into an inline function

Message ID 20190114112353.30616-4-hch@lst.de (mailing list archive)
State Awaiting Upstream
Delegated to: Helge Deller
Headers show
Series [1/8] parisc: don't include <asm/cacheflush.h> in <asm/dma-mapping.h> | expand

Commit Message

Christoph Hellwig Jan. 14, 2019, 11:23 a.m. UTC
This makes the function both more readable and more typesafe.

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

Comments

kernel test robot Jan. 14, 2019, 11:32 p.m. UTC | #1
Hi Christoph,

I love your patch! Yet something to improve:

[auto build test ERROR on hp-parisc/for-next]
[also build test ERROR on v5.0-rc2 next-20190114]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Christoph-Hellwig/parisc-don-t-include-asm-cacheflush-h-in-asm-dma-mapping-h/20190115-034634
base:   https://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux.git for-next
config: parisc-b180_defconfig (attached as .config)
compiler: hppa-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=parisc 

All errors (new ones prefixed by >>):

   In file included from drivers/parisc/hppb.c:26:0:
   drivers/parisc/iommu.h: In function 'GET_IOC':
>> drivers/parisc/iommu.h:33:14: error: dereferencing pointer to incomplete type 'struct pci_hba_data'
     return pdata->iommu;
                 ^~

vim +33 drivers/parisc/iommu.h

    26	
    27	static inline struct ioc *GET_IOC(struct device *dev)
    28	{
    29		struct pci_hba_data *pdata = parisc_walk_tree(dev);
    30	
    31		if (!pdata)
    32			return NULL;
  > 33		return pdata->iommu;
    34	}
    35	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox series

Patch

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);