Skip to content

Commit 30d497a

Browse files
andy-shevsergey-senozhatsky
authored andcommitted
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 <[email protected]> Reviewed-by: Steven Rostedt (VMware) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sergey Senozhatsky <[email protected]>
1 parent 09ceb8d commit 30d497a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/vsprintf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1937,7 +1937,7 @@ char *flags_string(char *buf, char *end, void *flags_ptr,
19371937
names = vmaflag_names;
19381938
break;
19391939
case 'g':
1940-
flags = *(gfp_t *)flags_ptr;
1940+
flags = (__force unsigned long)(*(gfp_t *)flags_ptr);
19411941
names = gfpflag_names;
19421942
break;
19431943
default:

0 commit comments

Comments
 (0)