Re: [PATCH u-boot 07/39] compiler.h: align the __ADDRESSABLE macro with Linux' version

2021-03-08 Thread Marek Behun
On Mon, 8 Mar 2021 18:29:29 +0800
Bin Meng  wrote:

> On Mon, Mar 8, 2021 at 5:23 PM Marek Behun  wrote:
> >
> > On Mon, 8 Mar 2021 15:27:41 +0800
> > Bin Meng  wrote:
> >  
> > > >  #define __ADDRESSABLE(sym) \
> > > > static void * __section(".discard.addressable") __used \
> > > > -   __PASTE(__addressable_##sym, __LINE__) = (void *)
> > > > +   __UNIQUE_ID(__PASTE(__addressable_,sym)) = (void 
> > > > *)  
> > >
> > > nits: need one space after ,  
> >
> > This is copy-paster from Linux, so it should be first fixed there.  
> 
> Do you mean this whole file is copy-paster from Linux? Is this the
> only place that U-Boot's version is different? If not, probably we
> need to do a sync with the Linux one.

Currently it is different from Linux's version, but yes, this and other
files are periodically synced with Linux' version.

I am not going to do a whole sync of all these headers in this series,
though.

Marek


Re: [PATCH u-boot 07/39] compiler.h: align the __ADDRESSABLE macro with Linux' version

2021-03-08 Thread Bin Meng
On Mon, Mar 8, 2021 at 5:23 PM Marek Behun  wrote:
>
> On Mon, 8 Mar 2021 15:27:41 +0800
> Bin Meng  wrote:
>
> > >  #define __ADDRESSABLE(sym) \
> > > static void * __section(".discard.addressable") __used \
> > > -   __PASTE(__addressable_##sym, __LINE__) = (void *)
> > > +   __UNIQUE_ID(__PASTE(__addressable_,sym)) = (void *)
> >
> > nits: need one space after ,
>
> This is copy-paster from Linux, so it should be first fixed there.

Do you mean this whole file is copy-paster from Linux? Is this the
only place that U-Boot's version is different? If not, probably we
need to do a sync with the Linux one.

Regards,
Bin


Re: [PATCH u-boot 07/39] compiler.h: align the __ADDRESSABLE macro with Linux' version

2021-03-08 Thread Marek Behun
On Mon, 8 Mar 2021 15:27:41 +0800
Bin Meng  wrote:

> >  #define __ADDRESSABLE(sym) \
> > static void * __section(".discard.addressable") __used \
> > -   __PASTE(__addressable_##sym, __LINE__) = (void *)
> > +   __UNIQUE_ID(__PASTE(__addressable_,sym)) = (void *)  
> 
> nits: need one space after ,

This is copy-paster from Linux, so it should be first fixed there.


Re: [PATCH u-boot 07/39] compiler.h: align the __ADDRESSABLE macro with Linux' version

2021-03-07 Thread Bin Meng
On Sun, Mar 7, 2021 at 12:26 PM Marek Behún  wrote:
>
> Use UNIQUE_ID in the __ADDRESSABLE macro.
>
> Signed-off-by: Marek Behún 
> ---
>  include/linux/compiler.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/compiler.h b/include/linux/compiler.h
> index 82a8a4ede9..98dd3fc4cc 100644
> --- a/include/linux/compiler.h
> +++ b/include/linux/compiler.h
> @@ -295,7 +295,7 @@ unsigned long read_word_at_a_time(const void *addr)
>   */
>  #define __ADDRESSABLE(sym) \
> static void * __section(".discard.addressable") __used \
> -   __PASTE(__addressable_##sym, __LINE__) = (void *)
> +   __UNIQUE_ID(__PASTE(__addressable_,sym)) = (void *)

nits: need one space after ,

>
>  /**
>   * offset_to_ptr - convert a relative memory offset to an absolute pointer

Reviewed-by: Bin Meng 


[PATCH u-boot 07/39] compiler.h: align the __ADDRESSABLE macro with Linux' version

2021-03-06 Thread Marek Behún
Use UNIQUE_ID in the __ADDRESSABLE macro.

Signed-off-by: Marek Behún 
---
 include/linux/compiler.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 82a8a4ede9..98dd3fc4cc 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -295,7 +295,7 @@ unsigned long read_word_at_a_time(const void *addr)
  */
 #define __ADDRESSABLE(sym) \
static void * __section(".discard.addressable") __used \
-   __PASTE(__addressable_##sym, __LINE__) = (void *)
+   __UNIQUE_ID(__PASTE(__addressable_,sym)) = (void *)
 
 /**
  * offset_to_ptr - convert a relative memory offset to an absolute pointer
-- 
2.26.2