public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] LoongArch: Fix dl-machine.h code formatting
@ 2022-08-20  8:40 Xi Ruoyao
  2022-08-20  8:43 ` Xi Ruoyao
  0 siblings, 1 reply; 2+ messages in thread
From: Xi Ruoyao @ 2022-08-20  8:40 UTC (permalink / raw)
  To: libc-alpha; +Cc: caiyinyu, Adhemerval Zanella Netto, Joseph Myers, Wang Xuerui

The case labels with conditional operator is bad formatted (they seem
caused by a bug of clang-format).  Fix them manually.

No functional change.

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
---
 sysdeps/loongarch/dl-machine.h | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/sysdeps/loongarch/dl-machine.h b/sysdeps/loongarch/dl-
machine.h
index c69c72d0ff..c5286041c0 100644
--- a/sysdeps/loongarch/dl-machine.h
+++ b/sysdeps/loongarch/dl-machine.h
@@ -166,8 +166,7 @@ elf_machine_rela (struct link_map *map, struct
r_scope_elem *scope[],
     {
 
     case R_LARCH_JUMP_SLOT:
-    case __WORDSIZE == 64 ? R_LARCH_64:
-    R_LARCH_32:
+    case __WORDSIZE == 64 ? R_LARCH_64 : R_LARCH_32:
       *addr_field = value;
       break;
 
@@ -175,18 +174,15 @@ elf_machine_rela (struct link_map *map, struct
r_scope_elem *scope[],
       break;
 
 #ifndef RTLD_BOOTSTRAP
-    case __WORDSIZE == 64 ? R_LARCH_TLS_DTPMOD64:
-    R_LARCH_TLS_DTPMOD32:
+    case __WORDSIZE == 64 ? R_LARCH_TLS_DTPMOD64 :
R_LARCH_TLS_DTPMOD32:
       *addr_field = sym_map->l_tls_modid;
       break;
 
-    case __WORDSIZE == 64 ? R_LARCH_TLS_DTPREL64:
-    R_LARCH_TLS_DTPREL32:
+    case __WORDSIZE == 64 ? R_LARCH_TLS_DTPREL64 :
R_LARCH_TLS_DTPREL32:
       *addr_field = TLS_DTPREL_VALUE (sym) + reloc->r_addend;
       break;
 
-    case __WORDSIZE == 64 ? R_LARCH_TLS_TPREL64:
-    R_LARCH_TLS_TPREL32:
+    case __WORDSIZE == 64 ? R_LARCH_TLS_TPREL64 : R_LARCH_TLS_TPREL32:
       CHECK_STATIC_TLS (map, sym_map);
       *addr_field = TLS_TPREL_VALUE (sym_map, sym) + reloc->r_addend;
       break;
-- 
2.37.0



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

* Re: [PATCH] LoongArch: Fix dl-machine.h code formatting
  2022-08-20  8:40 [PATCH] LoongArch: Fix dl-machine.h code formatting Xi Ruoyao
@ 2022-08-20  8:43 ` Xi Ruoyao
  0 siblings, 0 replies; 2+ messages in thread
From: Xi Ruoyao @ 2022-08-20  8:43 UTC (permalink / raw)
  To: libc-alpha; +Cc: caiyinyu, Adhemerval Zanella Netto, Joseph Myers, Wang Xuerui

Discarded. My mail client was not configured properly.  Will resend.

On Sat, 2022-08-20 at 16:40 +0800, Xi Ruoyao wrote:
> The case labels with conditional operator is bad formatted (they seem
> caused by a bug of clang-format).  Fix them manually.
> 
> No functional change.
> 
> Signed-off-by: Xi Ruoyao <xry111@xry111.site>
> ---
>  sysdeps/loongarch/dl-machine.h | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/sysdeps/loongarch/dl-machine.h b/sysdeps/loongarch/dl-
> machine.h
> index c69c72d0ff..c5286041c0 100644
> --- a/sysdeps/loongarch/dl-machine.h
> +++ b/sysdeps/loongarch/dl-machine.h
> @@ -166,8 +166,7 @@ elf_machine_rela (struct link_map *map, struct
> r_scope_elem *scope[],
>      {
>  
>      case R_LARCH_JUMP_SLOT:
> -    case __WORDSIZE == 64 ? R_LARCH_64:
> -    R_LARCH_32:
> +    case __WORDSIZE == 64 ? R_LARCH_64 : R_LARCH_32:
>        *addr_field = value;
>        break;
>  
> @@ -175,18 +174,15 @@ elf_machine_rela (struct link_map *map, struct
> r_scope_elem *scope[],
>        break;
>  
>  #ifndef RTLD_BOOTSTRAP
> -    case __WORDSIZE == 64 ? R_LARCH_TLS_DTPMOD64:
> -    R_LARCH_TLS_DTPMOD32:
> +    case __WORDSIZE == 64 ? R_LARCH_TLS_DTPMOD64 :
> R_LARCH_TLS_DTPMOD32:
>        *addr_field = sym_map->l_tls_modid;
>        break;
>  
> -    case __WORDSIZE == 64 ? R_LARCH_TLS_DTPREL64:
> -    R_LARCH_TLS_DTPREL32:
> +    case __WORDSIZE == 64 ? R_LARCH_TLS_DTPREL64 :
> R_LARCH_TLS_DTPREL32:
>        *addr_field = TLS_DTPREL_VALUE (sym) + reloc->r_addend;
>        break;
>  
> -    case __WORDSIZE == 64 ? R_LARCH_TLS_TPREL64:
> -    R_LARCH_TLS_TPREL32:
> +    case __WORDSIZE == 64 ? R_LARCH_TLS_TPREL64 :
> R_LARCH_TLS_TPREL32:
>        CHECK_STATIC_TLS (map, sym_map);
>        *addr_field = TLS_TPREL_VALUE (sym_map, sym) + reloc->r_addend;
>        break;

-- 
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:[~2022-08-20  8:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-20  8:40 [PATCH] LoongArch: Fix dl-machine.h code formatting Xi Ruoyao
2022-08-20  8:43 ` Xi Ruoyao

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 read-only IMAP folder(s) and NNTP newsgroup(s).