Re: [PATCH mm] tracing: incorrect gfp_t conversion

From: Matthew Wilcox
Date: Sun May 08 2022 - 16:37:31 EST


On Sat, May 07, 2022 at 04:00:10PM -0700, Andrew Morton wrote:
> On Sat, 7 May 2022 15:48:35 -0700 Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> > I did the below.
> >
>
> Silly me, doesn't work.
>
> >
> > --- a/include/trace/events/mmflags.h~tracing-incorrect-gfp_t-conversion-fix
> > +++ a/include/trace/events/mmflags.h
> > @@ -13,53 +13,57 @@
> > * Thus most bits set go first.
> > */
> >
> > +#define FUL __force unsigned long
> > +
> > #define __def_gfpflag_names \
> > - {(__force unsigned long)GFP_TRANSHUGE, "GFP_TRANSHUGE"}, \
>
> Can't expand FUL here within the macro definition.

Can we do something even better?

#define GFP_NAME(flag) { (__force unsigned long)flag, #flag },

... with one or more layers of indirection to satisfy the arcane
rules of C macros?