* [PATCH] MIPS: asm: Use __ASSEMBLY__ to guard some macros to avoid build error
@ 2020-05-07 5:54 Huacai Chen
2020-05-07 6:13 ` WANG Xuerui
2020-05-07 8:35 ` Thomas Bogendoerfer
0 siblings, 2 replies; 5+ messages in thread
From: Huacai Chen @ 2020-05-07 5:54 UTC (permalink / raw)
To: Thomas Bogendoerfer
Cc: linux-mips, Fuxin Zhang, Zhangjin Wu, Huacai Chen, Jiaxun Yang,
Huacai Chen
Use __ASSEMBLY__ to guard definitions of some macros (PANIC and PRINT)
to avoid build error:
1, PANIC conflicts with drivers/scsi/smartpqi/smartpqi_init.c
2, PRINT conflicts with net/netfilter/nf_conntrack_h323_asn1.c and net/
mac80211/debugfs_sta.c
Fixes: d339cd02b888eb8c ("MIPS: Move unaligned load/store helpers to inst.h")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Huacai Chen <chenhc@lemote.com>
---
arch/mips/include/asm/asm.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/mips/include/asm/asm.h b/arch/mips/include/asm/asm.h
index 934465d..b01762ab 100644
--- a/arch/mips/include/asm/asm.h
+++ b/arch/mips/include/asm/asm.h
@@ -74,6 +74,8 @@ symbol: .insn
.globl symbol; \
symbol = value
+#ifdef __ASSEMBLY__
+
#define PANIC(msg) \
.set push; \
.set reorder; \
@@ -98,6 +100,8 @@ symbol = value
#define PRINT(string)
#endif
+#endif
+
#define TEXT(msg) \
.pushsection .data; \
8: .asciiz msg; \
--
2.7.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] MIPS: asm: Use __ASSEMBLY__ to guard some macros to avoid build error
2020-05-07 5:54 [PATCH] MIPS: asm: Use __ASSEMBLY__ to guard some macros to avoid build error Huacai Chen
@ 2020-05-07 6:13 ` WANG Xuerui
2020-05-07 6:47 ` Huacai Chen
2020-05-07 8:35 ` Thomas Bogendoerfer
1 sibling, 1 reply; 5+ messages in thread
From: WANG Xuerui @ 2020-05-07 6:13 UTC (permalink / raw)
To: Huacai Chen, Thomas Bogendoerfer
Cc: linux-mips, Fuxin Zhang, Zhangjin Wu, Huacai Chen, Jiaxun Yang
On 2020/5/7 13:54, Huacai Chen wrote:
> Use __ASSEMBLY__ to guard definitions of some macros (PANIC and PRINT)
> to avoid build error:
>
> 1, PANIC conflicts with drivers/scsi/smartpqi/smartpqi_init.c
> 2, PRINT conflicts with net/netfilter/nf_conntrack_h323_asn1.c and net/
> mac80211/debugfs_sta.c
>
> Fixes: d339cd02b888eb8c ("MIPS: Move unaligned load/store helpers to inst.h")
> Reported-by: kbuild test robot <lkp@intel.com>
> Signed-off-by: Huacai Chen <chenhc@lemote.com>
> ---
> arch/mips/include/asm/asm.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/mips/include/asm/asm.h b/arch/mips/include/asm/asm.h
> index 934465d..b01762ab 100644
> --- a/arch/mips/include/asm/asm.h
> +++ b/arch/mips/include/asm/asm.h
> @@ -74,6 +74,8 @@ symbol: .insn
> .globl symbol; \
> symbol = value
>
> +#ifdef __ASSEMBLY__
> +
> #define PANIC(msg) \
> .set push; \
> .set reorder; \
> @@ -98,6 +100,8 @@ symbol = value
> #define PRINT(string)
> #endif
>
> +#endif
> +
> #define TEXT(msg) \
> .pushsection .data; \
> 8: .asciiz msg; \
It looks like the whole file is meant for assembly code, not just the
couple of conflicting definitions that were caught. At least the parts
containing assembler directives are nothing to be consumed by C code.
Maybe wrap the whole file and see if it correctly builds?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] MIPS: asm: Use __ASSEMBLY__ to guard some macros to avoid build error
2020-05-07 6:13 ` WANG Xuerui
@ 2020-05-07 6:47 ` Huacai Chen
0 siblings, 0 replies; 5+ messages in thread
From: Huacai Chen @ 2020-05-07 6:47 UTC (permalink / raw)
To: WANG Xuerui
Cc: Thomas Bogendoerfer, open list:MIPS, Fuxin Zhang, Zhangjin Wu,
Jiaxun Yang
Hi, Xuerui,
On Thu, May 7, 2020 at 2:13 PM WANG Xuerui <kernel@xen0n.name> wrote:
>
> On 2020/5/7 13:54, Huacai Chen wrote:
>
> > Use __ASSEMBLY__ to guard definitions of some macros (PANIC and PRINT)
> > to avoid build error:
> >
> > 1, PANIC conflicts with drivers/scsi/smartpqi/smartpqi_init.c
> > 2, PRINT conflicts with net/netfilter/nf_conntrack_h323_asn1.c and net/
> > mac80211/debugfs_sta.c
> >
> > Fixes: d339cd02b888eb8c ("MIPS: Move unaligned load/store helpers to inst.h")
> > Reported-by: kbuild test robot <lkp@intel.com>
> > Signed-off-by: Huacai Chen <chenhc@lemote.com>
> > ---
> > arch/mips/include/asm/asm.h | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/arch/mips/include/asm/asm.h b/arch/mips/include/asm/asm.h
> > index 934465d..b01762ab 100644
> > --- a/arch/mips/include/asm/asm.h
> > +++ b/arch/mips/include/asm/asm.h
> > @@ -74,6 +74,8 @@ symbol: .insn
> > .globl symbol; \
> > symbol = value
> >
> > +#ifdef __ASSEMBLY__
> > +
> > #define PANIC(msg) \
> > .set push; \
> > .set reorder; \
> > @@ -98,6 +100,8 @@ symbol = value
> > #define PRINT(string)
> > #endif
> >
> > +#endif
> > +
> > #define TEXT(msg) \
> > .pushsection .data; \
> > 8: .asciiz msg; \
>
> It looks like the whole file is meant for assembly code, not just the
> couple of conflicting definitions that were caught. At least the parts
> containing assembler directives are nothing to be consumed by C code.
>
> Maybe wrap the whole file and see if it correctly builds?
I have tried to wrap the whole file, but it causes a ton of other build errors.
Regards,
Huacai
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] MIPS: asm: Use __ASSEMBLY__ to guard some macros to avoid build error
2020-05-07 5:54 [PATCH] MIPS: asm: Use __ASSEMBLY__ to guard some macros to avoid build error Huacai Chen
2020-05-07 6:13 ` WANG Xuerui
@ 2020-05-07 8:35 ` Thomas Bogendoerfer
2020-05-07 9:55 ` Huacai Chen
1 sibling, 1 reply; 5+ messages in thread
From: Thomas Bogendoerfer @ 2020-05-07 8:35 UTC (permalink / raw)
To: Huacai Chen
Cc: linux-mips, Fuxin Zhang, Zhangjin Wu, Huacai Chen, Jiaxun Yang
On Thu, May 07, 2020 at 01:54:23PM +0800, Huacai Chen wrote:
> Use __ASSEMBLY__ to guard definitions of some macros (PANIC and PRINT)
> to avoid build error:
>
> 1, PANIC conflicts with drivers/scsi/smartpqi/smartpqi_init.c
> 2, PRINT conflicts with net/netfilter/nf_conntrack_h323_asn1.c and net/
> mac80211/debugfs_sta.c
how about prefixing them to make them more unique ? Something like
MIPS_ASM_PRINT/MIPS_ASM_PANIC ?
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] 5+ messages in thread
* Re: [PATCH] MIPS: asm: Use __ASSEMBLY__ to guard some macros to avoid build error
2020-05-07 8:35 ` Thomas Bogendoerfer
@ 2020-05-07 9:55 ` Huacai Chen
0 siblings, 0 replies; 5+ messages in thread
From: Huacai Chen @ 2020-05-07 9:55 UTC (permalink / raw)
To: Thomas Bogendoerfer; +Cc: open list:MIPS, Fuxin Zhang, Zhangjin Wu, Jiaxun Yang
Hi, Thomas,
On Thu, May 7, 2020 at 4:39 PM Thomas Bogendoerfer
<tsbogend@alpha.franken.de> wrote:
>
> On Thu, May 07, 2020 at 01:54:23PM +0800, Huacai Chen wrote:
> > Use __ASSEMBLY__ to guard definitions of some macros (PANIC and PRINT)
> > to avoid build error:
> >
> > 1, PANIC conflicts with drivers/scsi/smartpqi/smartpqi_init.c
> > 2, PRINT conflicts with net/netfilter/nf_conntrack_h323_asn1.c and net/
> > mac80211/debugfs_sta.c
>
> how about prefixing them to make them more unique ? Something like
> MIPS_ASM_PRINT/MIPS_ASM_PANIC ?
Thanks for your review, and I will send a new patch by renaming them.
Regards,
Huacai
>
> 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] 5+ messages in thread
end of thread, other threads:[~2020-05-07 9:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-07 5:54 [PATCH] MIPS: asm: Use __ASSEMBLY__ to guard some macros to avoid build error Huacai Chen
2020-05-07 6:13 ` WANG Xuerui
2020-05-07 6:47 ` Huacai Chen
2020-05-07 8:35 ` Thomas Bogendoerfer
2020-05-07 9:55 ` Huacai Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox