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

From: Huacai Chen
Date: Sat Dec 23 2023 - 05:28:22 EST


On Fri, Dec 22, 2023 at 12:59 PM Huacai Chen <chenhuacai@xxxxxxxxxx> 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@xxxxxxxxxxxxx> 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@xxxxxxxxxxxxx>
> > Cc: Huacai Chen <chenhuacai@xxxxxxxxxx>
> > Cc: WANG Xuerui <kernel@xxxxxxxxxx>
> > Cc: loongarch@xxxxxxxxxxxxxxx
> > Cc: Kent Overstreet <kent.overstreet@xxxxxxxxx>
> > ---
> > 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>