Skip to content

Commit

Permalink
um: include sys/types.h for size_t
Browse files Browse the repository at this point in the history
Usually size_t comes from sys/types.h, not stddef.h. This code likely
worked only because something else in its usage chain was pulling in
sys/types.h. stddef.h is still required for NULL, however, so note this.

Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
  • Loading branch information
Jason A. Donenfeld authored and Richard Weinberger committed Jul 17, 2022
1 parent 8970d5c commit af3e161
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/um/include/shared/user.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
*/
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))

/* This is to get size_t */
/* This is to get size_t and NULL */
#ifndef __UM_HOST__
#include <linux/types.h>
#else
#include <stddef.h>
#include <sys/types.h>
#endif

extern void panic(const char *fmt, ...)
Expand Down

0 comments on commit af3e161

Please sign in to comment.