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

Steven Rostedt
2020-07-31T16:04:29Z

On Fri, 31 Jul 2020 18:49:46 +0300
Andy Shevchenko <andy.shevchenko@gmail.com> 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