Re: [PATCH] bcache: Fix building error on MIPS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I think #undef is not very good, because it depends on the sequence of #include.

Huacai
 
------------------ Original ------------------
From:  "Coly Li"<colyli@xxxxxxx>;
Date:  Thu, Nov 16, 2017 12:25 PM
To:  "Huacai Chen"<chenhc@xxxxxxxxxx>; 
Cc:  "Michael Lyle"<mlyle@xxxxxxxx>; "Kent Overstreet"<kent.overstreet@xxxxxxxxx>; "linux-bcache"<linux-bcache@xxxxxxxxxxxxxxx>; "stable"<stable@xxxxxxxxxxxxxxx>; 
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@xxxxxxxxxxxxxxx
> Signed-off-by: Huacai Chen <chenhc@xxxxxxxxxx>
> ---
>  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 */
>




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]