linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MIPS: Guard some macros with __ASSEMBLY__ in asm.h
@ 2024-03-26 11:41 Jiaxun Yang
  2024-04-08  6:34 ` Philippe Mathieu-Daudé
  2024-04-15  8:34 ` Thomas Bogendoerfer
  0 siblings, 2 replies; 3+ messages in thread
From: Jiaxun Yang @ 2024-03-26 11:41 UTC (permalink / raw)
  To: Thomas Bogendoerfer
  Cc: linux-mips, linux-kernel, Geert Uytterhoeven, Jiaxun Yang

There are some assembly macros with very generic naming
being defined asm.h. They are clashing with other macros
from C code.

Guard them with __ASSEMBLY__ to prevent futher clashes.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/linux-mips/8d78894-dd89-9f4d-52bb-1b873c50be9c@linux-m68k.org/
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 arch/mips/include/asm/asm.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/mips/include/asm/asm.h b/arch/mips/include/asm/asm.h
index 2e99450f4228..87ff609b53fe 100644
--- a/arch/mips/include/asm/asm.h
+++ b/arch/mips/include/asm/asm.h
@@ -37,6 +37,7 @@
 #define CFI_SECTIONS
 #endif
 
+#ifdef __ASSEMBLY__
 /*
  * LEAF - declare leaf routine
  */
@@ -122,6 +123,8 @@ symbol		=	value
 #define ASM_PRINT(string)
 #endif
 
+#endif /* __ASSEMBLY__ */
+
 /*
  * Stack alignment
  */

---
base-commit: 084c8e315db34b59d38d06e684b1a0dd07d30287
change-id: 20240326-asm-guard-dddeb2321d69

Best regards,
-- 
Jiaxun Yang <jiaxun.yang@flygoat.com>


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

* Re: [PATCH] MIPS: Guard some macros with __ASSEMBLY__ in asm.h
  2024-03-26 11:41 [PATCH] MIPS: Guard some macros with __ASSEMBLY__ in asm.h Jiaxun Yang
@ 2024-04-08  6:34 ` Philippe Mathieu-Daudé
  2024-04-15  8:34 ` Thomas Bogendoerfer
  1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-04-08  6:34 UTC (permalink / raw)
  To: Jiaxun Yang, Thomas Bogendoerfer
  Cc: linux-mips, linux-kernel, Geert Uytterhoeven

On 26/3/24 12:41, Jiaxun Yang wrote:
> There are some assembly macros with very generic naming
> being defined asm.h. They are clashing with other macros
> from C code.
> 
> Guard them with __ASSEMBLY__ to prevent futher clashes.
> 
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Link: https://lore.kernel.org/linux-mips/8d78894-dd89-9f4d-52bb-1b873c50be9c@linux-m68k.org/
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
>   arch/mips/include/asm/asm.h | 3 +++
>   1 file changed, 3 insertions(+)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>


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

* Re: [PATCH] MIPS: Guard some macros with __ASSEMBLY__ in asm.h
  2024-03-26 11:41 [PATCH] MIPS: Guard some macros with __ASSEMBLY__ in asm.h Jiaxun Yang
  2024-04-08  6:34 ` Philippe Mathieu-Daudé
@ 2024-04-15  8:34 ` Thomas Bogendoerfer
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Bogendoerfer @ 2024-04-15  8:34 UTC (permalink / raw)
  To: Jiaxun Yang; +Cc: linux-mips, linux-kernel, Geert Uytterhoeven

On Tue, Mar 26, 2024 at 11:41:45AM +0000, Jiaxun Yang wrote:
> There are some assembly macros with very generic naming
> being defined asm.h. They are clashing with other macros
> from C code.
> 
> Guard them with __ASSEMBLY__ to prevent futher clashes.
> 
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Link: https://lore.kernel.org/linux-mips/8d78894-dd89-9f4d-52bb-1b873c50be9c@linux-m68k.org/
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
>  arch/mips/include/asm/asm.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/mips/include/asm/asm.h b/arch/mips/include/asm/asm.h
> index 2e99450f4228..87ff609b53fe 100644
> --- a/arch/mips/include/asm/asm.h
> +++ b/arch/mips/include/asm/asm.h
> @@ -37,6 +37,7 @@
>  #define CFI_SECTIONS
>  #endif
>  
> +#ifdef __ASSEMBLY__
>  /*
>   * LEAF - declare leaf routine
>   */
> @@ -122,6 +123,8 @@ symbol		=	value
>  #define ASM_PRINT(string)
>  #endif
>  
> +#endif /* __ASSEMBLY__ */
> +
>  /*
>   * Stack alignment
>   */
> 
> ---
> base-commit: 084c8e315db34b59d38d06e684b1a0dd07d30287
> change-id: 20240326-asm-guard-dddeb2321d69
> 
> Best regards,
> -- 
> Jiaxun Yang <jiaxun.yang@flygoat.com>

applied to mips-next.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

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

end of thread, other threads:[~2024-04-15  8:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-26 11:41 [PATCH] MIPS: Guard some macros with __ASSEMBLY__ in asm.h Jiaxun Yang
2024-04-08  6:34 ` Philippe Mathieu-Daudé
2024-04-15  8:34 ` Thomas Bogendoerfer

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 NNTP newsgroup(s).