Re: [PATCH v2 02/18] mm/ksw: add ksw_config struct and parser

Jinchao Wang
2025-09-08T05:58:45Z

On Thu, Sep 04, 2025 at 10:47:07AM +0300, Mike Rapoport wrote:
> On Thu, Sep 04, 2025 at 08:20:59AM +0800, Jinchao Wang wrote:
> > Add struct ksw_config and ksw_parse_config() to parse user string.
> >
> > Update `Makefile` to pass compilation.
> >
> > Signed-off-by: Jinchao Wang <wangjinchao600@gmail.com>
> > ---
> > mm/kstackwatch/Makefile | 2 ++
> > mm/kstackwatch/kernel.c | 70 +++++++++++++++++++++++++++++++++++-
> > mm/kstackwatch/kstackwatch.h | 34 ++++++++++++++++++
> > 3 files changed, 105 insertions(+), 1 deletion(-)
> >
> > diff --git a/mm/kstackwatch/Makefile b/mm/kstackwatch/Makefile
> > index 84a46cb9a766..d422f0e114dd 100644
> > --- a/mm/kstackwatch/Makefile
> > +++ b/mm/kstackwatch/Makefile
> > @@ -1,2 +1,4 @@
> > obj-$(CONFIG_KSTACK_WATCH) += kstackwatch.o
> > kstackwatch-y := kernel.o stack.o watch.o
> > +
> > +CFLAGS_kernel.o := -Wno-error=unused-function
>
> Can't you just add the function along with the code that uses it?
Thanks for the feedback.

The function ksw_parse_config is called deeply in a later patch, so the
'error: ununsed function' would persist even if I added the caller now.

To keep this patch clean for review, I only include functions that form
a self-contained unit.

I will add a TODO comment to indicate that the CFLAGS addition is
temporary for this patch only and will be removed in a follow-up patch.
>
> --
> Sincerely yours,
> Mike.