From: Andy Shevchenko Date: Fri, 31 Jul 2020 18:08:24 +0000 (+0300) Subject: lib/vsprintf: Force type of flags value for gfp_t X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=30d497a0e1aadd904867081246c310dd0284eb41;p=linux.git lib/vsprintf: Force type of flags value for gfp_t Sparse is not happy about restricted type being assigned: lib/vsprintf.c:1940:23: warning: incorrect type in assignment (different base types) lib/vsprintf.c:1940:23: expected unsigned long [assigned] flags lib/vsprintf.c:1940:23: got restricted gfp_t [usertype] Force type of flags value to make sparse happy. Signed-off-by: Andy Shevchenko Reviewed-by: Steven Rostedt (VMware) Link: https://lore.kernel.org/r/20200731180825.30575-3-andriy.shevchenko@linux.intel.com Signed-off-by: Sergey Senozhatsky --- diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 182a3e2e16293..c155769559abe 100644 --- a/lib/vsprintf.c +++ 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 unsigned long)(*(gfp_t *)flags_ptr); names = gfpflag_names; break; default: