[v2] LoongArch: signal.c: add header file to fix build error

Message ID 20231222044554.25656-1-rdunlap@infradead.org
State New
Headers
Series [v2] LoongArch: signal.c: add header file to fix build error |

Commit Message

Randy Dunlap Dec. 22, 2023, 4:45 a.m. UTC
  loongarch's signal.c uses rseq_signal_deliver() so it should
pull in the appropriate header to prevent a build error:

../arch/loongarch/kernel/signal.c: In function 'handle_signal':
../arch/loongarch/kernel/signal.c:1034:9: error: implicit declaration of function 'rseq_signal_deliver' [-Werror=implicit-function-declaration]
 1034 |         rseq_signal_deliver(ksig, regs);
      |         ^~~~~~~~~~~~~~~~~~~

Fixes: b74baf4ad05b ("LoongArch: Add signal handling support")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: WANG Xuerui <kernel@xen0n.name>
Cc: loongarch@lists.linux.dev
Cc: Kent Overstreet <kent.overstreet@gmail.com>
---
v2: repair Cc: list

 arch/loongarch/kernel/signal.c |    1 +
 1 file changed, 1 insertion(+)
  

Comments

Huacai Chen Dec. 22, 2023, 4:59 a.m. UTC | #1
Hi, Randy,

I cannot reproduce it with the default config file.

Huacai

On Fri, Dec 22, 2023 at 12:46 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> loongarch's signal.c uses rseq_signal_deliver() so it should
> pull in the appropriate header to prevent a build error:
>
> ../arch/loongarch/kernel/signal.c: In function 'handle_signal':
> ../arch/loongarch/kernel/signal.c:1034:9: error: implicit declaration of function 'rseq_signal_deliver' [-Werror=implicit-function-declaration]
>  1034 |         rseq_signal_deliver(ksig, regs);
>       |         ^~~~~~~~~~~~~~~~~~~
>
> Fixes: b74baf4ad05b ("LoongArch: Add signal handling support")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Huacai Chen <chenhuacai@kernel.org>
> Cc: WANG Xuerui <kernel@xen0n.name>
> Cc: loongarch@lists.linux.dev
> Cc: Kent Overstreet <kent.overstreet@gmail.com>
> ---
> v2: repair Cc: list
>
>  arch/loongarch/kernel/signal.c |    1 +
>  1 file changed, 1 insertion(+)
>
> diff -- a/arch/loongarch/kernel/signal.c b/arch/loongarch/kernel/signal.c
> --- a/arch/loongarch/kernel/signal.c
> +++ b/arch/loongarch/kernel/signal.c
> @@ -15,6 +15,7 @@
>  #include <linux/context_tracking.h>
>  #include <linux/entry-common.h>
>  #include <linux/irqflags.h>
> +#include <linux/rseq.h>
>  #include <linux/sched.h>
>  #include <linux/mm.h>
>  #include <linux/personality.h>
  
Huacai Chen Dec. 23, 2023, 10:27 a.m. UTC | #2
On Fri, Dec 22, 2023 at 12:59 PM Huacai Chen <chenhuacai@kernel.org> wrote:
>
> Hi, Randy,
>
> I cannot reproduce it with the default config file.
Oh, I know, this error only occurs in linux-next, but I think this
patch should be squashed into "rseq: Split out rseq.h from sched.h".
Or as a fix applied to the bcachefs tree rather than the loongarch
tree.

Huacai

>
> Huacai
>
> On Fri, Dec 22, 2023 at 12:46 PM Randy Dunlap <rdunlap@infradead.org> wrote:
> >
> > loongarch's signal.c uses rseq_signal_deliver() so it should
> > pull in the appropriate header to prevent a build error:
> >
> > ../arch/loongarch/kernel/signal.c: In function 'handle_signal':
> > ../arch/loongarch/kernel/signal.c:1034:9: error: implicit declaration of function 'rseq_signal_deliver' [-Werror=implicit-function-declaration]
> >  1034 |         rseq_signal_deliver(ksig, regs);
> >       |         ^~~~~~~~~~~~~~~~~~~
> >
> > Fixes: b74baf4ad05b ("LoongArch: Add signal handling support")
> > Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> > Cc: Huacai Chen <chenhuacai@kernel.org>
> > Cc: WANG Xuerui <kernel@xen0n.name>
> > Cc: loongarch@lists.linux.dev
> > Cc: Kent Overstreet <kent.overstreet@gmail.com>
> > ---
> > v2: repair Cc: list
> >
> >  arch/loongarch/kernel/signal.c |    1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff -- a/arch/loongarch/kernel/signal.c b/arch/loongarch/kernel/signal.c
> > --- a/arch/loongarch/kernel/signal.c
> > +++ b/arch/loongarch/kernel/signal.c
> > @@ -15,6 +15,7 @@
> >  #include <linux/context_tracking.h>
> >  #include <linux/entry-common.h>
> >  #include <linux/irqflags.h>
> > +#include <linux/rseq.h>
> >  #include <linux/sched.h>
> >  #include <linux/mm.h>
> >  #include <linux/personality.h>
  
Randy Dunlap Dec. 23, 2023, 5:16 p.m. UTC | #3
On 12/23/23 02:27, Huacai Chen wrote:
> On Fri, Dec 22, 2023 at 12:59 PM Huacai Chen <chenhuacai@kernel.org> wrote:
>>
>> Hi, Randy,
>>
>> I cannot reproduce it with the default config file.
> Oh, I know, this error only occurs in linux-next, but I think this
> patch should be squashed into "rseq: Split out rseq.h from sched.h".
> Or as a fix applied to the bcachefs tree rather than the loongarch
> tree.

Yes, I think Kent is taking care of it.

Yes, in linux-next.

Thanks.

> Huacai
> 
>>
>> Huacai
>>
>> On Fri, Dec 22, 2023 at 12:46 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>>>
>>> loongarch's signal.c uses rseq_signal_deliver() so it should
>>> pull in the appropriate header to prevent a build error:
>>>
>>> ../arch/loongarch/kernel/signal.c: In function 'handle_signal':
>>> ../arch/loongarch/kernel/signal.c:1034:9: error: implicit declaration of function 'rseq_signal_deliver' [-Werror=implicit-function-declaration]
>>>  1034 |         rseq_signal_deliver(ksig, regs);
>>>       |         ^~~~~~~~~~~~~~~~~~~
>>>
>>> Fixes: b74baf4ad05b ("LoongArch: Add signal handling support")
>>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>>> Cc: Huacai Chen <chenhuacai@kernel.org>
>>> Cc: WANG Xuerui <kernel@xen0n.name>
>>> Cc: loongarch@lists.linux.dev
>>> Cc: Kent Overstreet <kent.overstreet@gmail.com>
>>> ---
>>> v2: repair Cc: list
>>>
>>>  arch/loongarch/kernel/signal.c |    1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff -- a/arch/loongarch/kernel/signal.c b/arch/loongarch/kernel/signal.c
>>> --- a/arch/loongarch/kernel/signal.c
>>> +++ b/arch/loongarch/kernel/signal.c
>>> @@ -15,6 +15,7 @@
>>>  #include <linux/context_tracking.h>
>>>  #include <linux/entry-common.h>
>>>  #include <linux/irqflags.h>
>>> +#include <linux/rseq.h>
>>>  #include <linux/sched.h>
>>>  #include <linux/mm.h>
>>>  #include <linux/personality.h>
  

Patch

diff -- a/arch/loongarch/kernel/signal.c b/arch/loongarch/kernel/signal.c
--- a/arch/loongarch/kernel/signal.c
+++ b/arch/loongarch/kernel/signal.c
@@ -15,6 +15,7 @@ 
 #include <linux/context_tracking.h>
 #include <linux/entry-common.h>
 #include <linux/irqflags.h>
+#include <linux/rseq.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/personality.h>