From: 陈华才 <chenhc@lemote.com>
To: "Coly Li" <colyli@suse.de>
Cc: "Michael Lyle" <mlyle@lyle.org>,
"Kent Overstreet" <kent.overstreet@gmail.com>,
linux-bcache <linux-bcache@vger.kernel.org>,
stable <stable@vger.kernel.org>
Subject: Re: [PATCH] bcache: Fix building error on MIPS
Date: Thu, 16 Nov 2017 12:29:10 +0800 [thread overview]
Message-ID: <tencent_18C70D36191568EA3FDA967B@qq.com> (raw)
In-Reply-To: <b28f4962-f418-d6bf-ad7b-7c1a8089bbe8@suse.de>
I think #undef is not very good, because it depends on the sequence of #include.
Huacai
------------------ Original ------------------
From: "Coly Li"<colyli@suse.de>;
Date: Thu, Nov 16, 2017 12:25 PM
To: "Huacai Chen"<chenhc@lemote.com>;
Cc: "Michael Lyle"<mlyle@lyle.org>; "Kent Overstreet"<kent.overstreet@gmail.com>; "linux-bcache"<linux-bcache@vger.kernel.org>; "stable"<stable@vger.kernel.org>;
Subject: Re: [PATCH] bcache: Fix building error on MIPS
On 2017/11/16 上午11:06, Huacai Chen wrote:
> This patch try to fix the building error on MIPS. The reason is MIPS
> has already defined the PTR macro, which conflicts with the PTR macro
> in include/uapi/linux/bcache.h.
>
Hi Huacai,
Did you try to add a #undef PTR in user/include/linux/bcache.h ?
Thanks.
Coly
> Cc: stable@vger.kernel.org
> Signed-off-by: Huacai Chen <chenhc@lemote.com>
> ---
> drivers/md/bcache/alloc.c | 2 +-
> drivers/md/bcache/extents.c | 2 +-
> drivers/md/bcache/journal.c | 2 +-
> include/uapi/linux/bcache.h | 2 +-
> 4 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/md/bcache/alloc.c b/drivers/md/bcache/alloc.c
> index a27d852..a0cc1bc 100644
> --- a/drivers/md/bcache/alloc.c
> +++ b/drivers/md/bcache/alloc.c
> @@ -490,7 +490,7 @@ int __bch_bucket_alloc_set(struct cache_set *c, unsigned reserve,
> if (b == -1)
> goto err;
>
> - k->ptr[i] = PTR(ca->buckets[b].gen,
> + k->ptr[i] = MAKE_PTR(ca->buckets[b].gen,
> bucket_to_sector(c, b),
> ca->sb.nr_this_dev);
[snip]
> diff --git a/include/uapi/linux/bcache.h b/include/uapi/linux/bcache.h
> index 90fc490..5cc599c 100644
> --- a/include/uapi/linux/bcache.h
> +++ b/include/uapi/linux/bcache.h
> @@ -91,7 +91,7 @@ PTR_FIELD(PTR_GEN, 0, 8)
>
> #define PTR_CHECK_DEV ((1 << PTR_DEV_BITS) - 1)
>
> -#define PTR(gen, offset, dev) \
> +#define MAKE_PTR(gen, offset, dev) \
> ((((__u64) dev) << 51) | ((__u64) offset) << 8 | gen)
>
> /* Bkey utility code */
>
next prev parent reply other threads:[~2017-11-16 4:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-16 3:06 [PATCH] bcache: Fix building error on MIPS Huacai Chen
2017-11-16 4:25 ` Coly Li
2017-11-16 4:29 ` 陈华才 [this message]
2017-11-16 4:43 ` Michael Lyle
2017-11-16 16:58 ` Kai Krakow
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=tencent_18C70D36191568EA3FDA967B@qq.com \
--to=chenhc@lemote.com \
--cc=colyli@suse.de \
--cc=kent.overstreet@gmail.com \
--cc=linux-bcache@vger.kernel.org \
--cc=mlyle@lyle.org \
--cc=stable@vger.kernel.org \
/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