All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/arch/loongarch: Use __SIZEOF_LONG__ to define __BITS_PER_LONG
@ 2023-03-07  7:39 Tiezhu Yang
  2023-03-07  7:51 ` Xi Ruoyao
  0 siblings, 1 reply; 2+ messages in thread
From: Tiezhu Yang @ 2023-03-07  7:39 UTC (permalink / raw
  To: Huacai Chen, WANG Xuerui; +Cc: loongarch, linux-kernel, loongson-kernel

Although __SIZEOF_POINTER__ is equal with _SIZEOF_LONG__ on LoongArch,
it is better to use __SIZEOF_LONG__ to define __BITS_PER_LONG to keep
consistent between arch/loongarch/include/uapi/asm/bitsperlong.h and
tools/arch/loongarch/include/uapi/asm/bitsperlong.h.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 tools/arch/loongarch/include/uapi/asm/bitsperlong.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/arch/loongarch/include/uapi/asm/bitsperlong.h b/tools/arch/loongarch/include/uapi/asm/bitsperlong.h
index d4e32b3..00b4ba1 100644
--- a/tools/arch/loongarch/include/uapi/asm/bitsperlong.h
+++ b/tools/arch/loongarch/include/uapi/asm/bitsperlong.h
@@ -2,7 +2,7 @@
 #ifndef __ASM_LOONGARCH_BITSPERLONG_H
 #define __ASM_LOONGARCH_BITSPERLONG_H
 
-#define __BITS_PER_LONG (__SIZEOF_POINTER__ * 8)
+#define __BITS_PER_LONG (__SIZEOF_LONG__ * 8)
 
 #include <asm-generic/bitsperlong.h>
 
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] tools/arch/loongarch: Use __SIZEOF_LONG__ to define __BITS_PER_LONG
  2023-03-07  7:39 [PATCH] tools/arch/loongarch: Use __SIZEOF_LONG__ to define __BITS_PER_LONG Tiezhu Yang
@ 2023-03-07  7:51 ` Xi Ruoyao
  0 siblings, 0 replies; 2+ messages in thread
From: Xi Ruoyao @ 2023-03-07  7:51 UTC (permalink / raw
  To: Tiezhu Yang, Huacai Chen, WANG Xuerui
  Cc: loongarch, linux-kernel, loongson-kernel

On Tue, 2023-03-07 at 15:39 +0800, Tiezhu Yang wrote:
> Although __SIZEOF_POINTER__ is equal with _SIZEOF_LONG__ on LoongArch,
> it is better to use __SIZEOF_LONG__ to define __BITS_PER_LONG to keep
> consistent between arch/loongarch/include/uapi/asm/bitsperlong.h and
> tools/arch/loongarch/include/uapi/asm/bitsperlong.h.

I believe we should unify bitsperlong.h for all ports to use
(__SIZEOF_LONG__ * 8).  Now we specify GCC >= 5.1 or Clang (LLVM) >=
11.0.0 in min-tool-version.sh, where __SIZEOF_LONG__ is usable [1].  The
only remaining compiler is ICC, which is deprecated and won't be
supported for building the kernel after 6.3 [2].

[1]:https://gcc.godbolt.org/z/cnvW38vj6
[2]:https://www.phoronix.com/news/Linux-6.3-Drops-Intel-ICC

> 
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> ---
>  tools/arch/loongarch/include/uapi/asm/bitsperlong.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/arch/loongarch/include/uapi/asm/bitsperlong.h
> b/tools/arch/loongarch/include/uapi/asm/bitsperlong.h
> index d4e32b3..00b4ba1 100644
> --- a/tools/arch/loongarch/include/uapi/asm/bitsperlong.h
> +++ b/tools/arch/loongarch/include/uapi/asm/bitsperlong.h
> @@ -2,7 +2,7 @@
>  #ifndef __ASM_LOONGARCH_BITSPERLONG_H
>  #define __ASM_LOONGARCH_BITSPERLONG_H
>  
> -#define __BITS_PER_LONG (__SIZEOF_POINTER__ * 8)
> +#define __BITS_PER_LONG (__SIZEOF_LONG__ * 8)
>  
>  #include <asm-generic/bitsperlong.h>
>  

-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-07  7:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-07  7:39 [PATCH] tools/arch/loongarch: Use __SIZEOF_LONG__ to define __BITS_PER_LONG Tiezhu Yang
2023-03-07  7:51 ` Xi Ruoyao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.