Re: [PATCH v1 3/3] lib/vsprintf: Force type of flags for gfp_t

From: Steven Rostedt
Date: Fri Jul 31 2020 - 12:04:30 EST


On Fri, 31 Jul 2020 18:49:46 +0300
Andy Shevchenko <andy.shevchenko@xxxxxxxxx> wrote:

> > > +++ b/lib/vsprintf.c
> > > @@ -1937,7 +1937,7 @@ char *flags_string(char *buf, char *end, void *flags_ptr,
> > > names = vmaflag_names;
> > > break;
> > > case 'g':
> > > - flags = *(gfp_t *)flags_ptr;
> > > + flags = (__force typeof(flags))(*(gfp_t *)flags_ptr);
> >
> > Do we really need to say "typeof(flags)" ? What about simply using
> > flags' type?
>
> Whatever you prefer. I actually came with the latter and switched to the former.
> So, I'll switch back for v2.

For this instance, I prefer spelling out the type.

Thanks!

-- Steve