Skip to content

Commit

Permalink
lib/vsprintf: Force type of flags value for gfp_t
Browse files Browse the repository at this point in the history
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 <andriy.shevchenko@linux.intel.com>
Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Link: https://lore.kernel.org/r/20200731180825.30575-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
  • Loading branch information
Andy Shevchenko authored and Sergey Senozhatsky committed Aug 1, 2020
1 parent 09ceb8d commit 30d497a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/vsprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 30d497a

Please sign in to comment.