From: zerons <sironhide0null@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: liodot@gmail.com, charrer@alacritech.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 01/10] staging: slicoss: slic.h: add a macro IOMEM_GET_FIELDADDR to fix sparse warnings
Date: Fri, 16 Sep 2016 18:41:38 +0800 [thread overview]
Message-ID: <157cd71a-bce4-03f3-bc76-635f493c0051@gmail.com> (raw)
In-Reply-To: <20160916075259.GB1858@kroah.com>
these marcos are used to get the value or address of a member of a `__iomem` structure.
GET_FIELDADDR is like &iomem_obj->field, and
GET_FIELD32 is iomem_obj->u32val, GET_FIELD64 is iomem_obj->u64val.
If patch the .c file directly, the source gets into a mess.
On 09/16/2016 03:52 PM, Greg KH wrote:
> On Tue, Sep 13, 2016 at 07:59:50PM -0700, Peng Sun wrote:
>> 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
>
> Wait, what does this patch on its own do? Why create this macro?
>
> greg k-h
>
next prev parent reply other threads:[~2016-09-16 10:41 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 sparse warnings 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 ` [PATCH 04/10] staging: slicoss: slic.h: add a macro IOMEM_GET_FIELD64 " Peng Sun
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 [this message]
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=157cd71a-bce4-03f3-bc76-635f493c0051@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;
as well as URLs for NNTP newsgroup(s).