um: include sys/types.h instead of stddef.h for size_t
PATCH 1/1 um: include sys/types.h instead of stddef.h for size_t
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.
Cc Johannes Berg <[email protected]>
Signed-off-by Jason A. Donenfeld <[email protected]>
--- arch/um/include/shared/user.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/um/include/shared/user.h +1 -1
@@ -13,21 +13,21 @@* fancier, type-safe, definition. Using that one would require * copying too much infrastructure for my taste, so userspace files * get less checking than kernel files. */ #define ARRAY_SIZE (x) (sizeof(x) / sizeof((x)[0]))/* This is to get size_t */ #ifndef __UM_HOST__#include <linux/types.h> #else -#include <stddef.h> +#include <sys/types.h> #endif extern void panic (const char *fmt, ...) __attribute__ ((format (printf,1 ,2 )));/* Requires preincluding include/linux/kern_levels.h */ #define UM_KERN_EMERG KERN_EMERG#define UM_KERN_ALERT KERN_ALERT#define UM_KERN_CRIT KERN_CRIT#define UM_KERN_ERR KERN_ERR
Signature · 7 lines
2.35.1 _______________________________________________ linux-um mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-um
PATCH v2 1/1 um: include sys/types.h for size_t
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 <[email protected]>
Signed-off-by Jason A. Donenfeld <[email protected]>
--- arch/um/include/shared/user.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/um/include/shared/user.h +2 -1
@@ -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, ...)
Signature · 7 lines
2.35.1 _______________________________________________ linux-um mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-um