Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1482898

[PATCH 01/10] staging: slicoss: slic.h: add a macro IOMEM_GET_FIELDADDR to fix sparse warnings

From Peng Sun <sironhide0null@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 01/10] staging: slicoss: slic.h: add a macro IOMEM_GET_FIELDADDR to fix sparse warnings
Date 2016-09-14 05:10 +0200
Message-ID <sh8Ke-2KP-27@gated-at.bofh.it> (permalink)
References <sh8Kd-2KP-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Signed-off-by: Peng Sun <sironhide0null@gmail.com>
---
 drivers/staging/slicoss/slic.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
index fe1d2ce..7c23190 100644
--- a/drivers/staging/slicoss/slic.h
+++ b/drivers/staging/slicoss/slic.h
@@ -539,6 +539,13 @@ static inline void slic_flush_write(struct adapter *adapter)
 	ioread32(adapter->regs + SLIC_REG_HOSTID);
 }
 
+#define IOMEM_GET_FIELDADDR(base, member)				\
+({									\
+	char __iomem *_base = (char __iomem *)base;			\
+	_base += offsetof(typeof(*base), member);			\
+	(void __iomem *)_base;						\
+})
+
 #define UPDATE_STATS(largestat, newstat, oldstat)                        \
 {                                                                        \
 	if ((newstat) < (oldstat))                                       \
-- 
2.7.4

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/10] staging: slicoss: fix different address space sparse warnings Peng Sun <sironhide0null@gmail.com> - 2016-09-14 05:10 +0200
  [PATCH 05/10] staging: slicoss: slicoss.c: fix different address space sparse warning Peng Sun <sironhide0null@gmail.com> - 2016-09-14 05:10 +0200
  [PATCH 01/10] staging: slicoss: slic.h: add a macro IOMEM_GET_FIELDADDR to fix sparse warnings Peng Sun <sironhide0null@gmail.com> - 2016-09-14 05:10 +0200
    Re: [PATCH 01/10] staging: slicoss: slic.h: add a macro  IOMEM_GET_FIELDADDR to fix sparse warnings Greg KH <gregkh@linuxfoundation.org> - 2016-09-16 10:00 +0200
    Re: [PATCH 01/10] staging: slicoss: slic.h: add a macro  IOMEM_GET_FIELDADDR to fix sparse warnings Greg KH <gregkh@linuxfoundation.org> - 2016-09-16 10:00 +0200
      Re: [PATCH 01/10] staging: slicoss: slic.h: add a macro  IOMEM_GET_FIELDADDR to fix sparse warnings zerons <sironhide0null@gmail.com> - 2016-09-16 12:50 +0200
        Re: [PATCH 01/10] staging: slicoss: slic.h: add a macro  IOMEM_GET_FIELDADDR to fix sparse warnings Greg KH <gregkh@linuxfoundation.org> - 2016-09-16 15:00 +0200
          Re: [PATCH 01/10] staging: slicoss: slic.h: add a macro  IOMEM_GET_FIELDADDR to fix sparse warnings zerons <sironhide0null@gmail.com> - 2016-09-16 16:00 +0200
  [PATCH 09/10] staging: slicoss: slicoss.c: fix different address space sparse warning Peng Sun <sironhide0null@gmail.com> - 2016-09-14 05:10 +0200
  [PATCH 03/10] staging: slicoss: slic.h: add a macro IOMEM_SET_FIELD32 to fix sparse warnings Peng Sun <sironhide0null@gmail.com> - 2016-09-14 05:10 +0200

csiph-web