mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peng Sun <sironhide0null@gmail.com>
To: liodot@gmail.com, charrer@alacritech.com, gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org, Peng Sun <sironhide0null@gmail.com>
Subject: [PATCH 04/10] staging: slicoss: slic.h: add a macro IOMEM_GET_FIELD64 to fix sparse warnings
Date: Tue, 13 Sep 2016 19:59:53 -0700	[thread overview]
Message-ID: <62de4cf8ac3f837d2828cbee3b075b9cbe102bcd.1473821899.git.sironhide0null@gmail.com> (raw)
In-Reply-To: <cover.1473821899.git.sironhide0null@gmail.com>
In-Reply-To: <974f8bea8404695a9440f19b3812300f0ded32b5.1473821899.git.sironhide0null@gmail.com>

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

diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
index 4c22863..b9595c4 100644
--- a/drivers/staging/slicoss/slic.h
+++ b/drivers/staging/slicoss/slic.h
@@ -560,6 +560,31 @@ static inline void slic_flush_write(struct adapter *adapter)
 	iowrite32(value, _base);					\
 })
 
+#ifdef CONFIG_64BIT
+#define IOMEM_GET_FIELD64(base, member)					\
+({									\
+	char __iomem *_base = (char __iomem *)base;			\
+	_base += offsetof(typeof(*base), member);			\
+	readq(_base);							\
+})
+#else
+#define IOMEM_GET_FIELD64(base, member)					\
+({									\
+	char __iomem *_base = (char __iomem *)base;			\
+	u64 val;							\
+	_base += offsetof(typeof(*base), member);			\
+	val = ((u64)ioread8(_base + 7)) << 56;				\
+	val += ((u64)ioread8(_base + 6)) << 48;				\
+	val += ((u64)ioread8(_base + 5)) << 40;				\
+	val += ((u64)ioread8(_base + 4)) << 32;				\
+	val += ((u64)ioread8(_base + 3)) << 24;				\
+	val += ((u64)ioread8(_base + 2)) << 16;				\
+	val += ((u64)ioread8(_base + 1)) << 8;				\
+	val += ioread8(_base);						\
+	le64_to_cpu(val);						\
+})
+#endif
+
 #define UPDATE_STATS(largestat, newstat, oldstat)                        \
 {                                                                        \
 	if ((newstat) < (oldstat))                                       \
-- 
2.7.4

  reply	other threads:[~2016-09-14  3:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14  2:59 [PATCH 00/10] staging: slicoss: fix different address space " Peng Sun
2016-09-14  2:59 ` [PATCH 01/10] staging: slicoss: slic.h: add a macro IOMEM_GET_FIELDADDR to fix " Peng Sun
2016-09-14  2:59   ` [PATCH 02/10] staging: slicoss: slic.h: add a macro IOMEM_GET_FIELD32 " Peng Sun
2016-09-14  2:59     ` [PATCH 03/10] staging: slicoss: slic.h: add a macro IOMEM_SET_FIELD32 " Peng Sun
2016-09-14  2:59       ` Peng Sun [this message]
2016-09-14  2:59         ` [PATCH 05/10] staging: slicoss: slicoss.c: fix different address space sparse warning Peng Sun
2016-09-14  2:59           ` [PATCH 06/10] " Peng Sun
2016-09-14  2:59             ` [PATCH 07/10] " Peng Sun
2016-09-14  2:59               ` [PATCH 08/10] " Peng Sun
2016-09-14  2:59                 ` [PATCH 09/10] " Peng Sun
2016-09-14  2:59                   ` [PATCH 10/10] " Peng Sun
2016-09-16  7:52   ` [PATCH 01/10] staging: slicoss: slic.h: add a macro IOMEM_GET_FIELDADDR to fix sparse warnings Greg KH
2016-09-16  7:52   ` Greg KH
2016-09-16 10:41     ` zerons
2016-09-16 12:57       ` Greg KH
2016-09-16 13:54         ` zerons

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=62de4cf8ac3f837d2828cbee3b075b9cbe102bcd.1473821899.git.sironhide0null@gmail.com \
    --to=sironhide0null@gmail.com \
    --cc=charrer@alacritech.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liodot@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®