From: Jakub Kicinski Date: Thu, 26 Jan 2023 07:14:16 +0000 (-0800) Subject: net: checksum: drop the linux/uaccess.h include X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=68f4eae781dd25aca2eb84ca2279663689db8d19;p=linux.git net: checksum: drop the linux/uaccess.h include net/checksum.h pulls in linux/uaccess.h which is large. In the x86 header the include seems to not be needed at all. ARM on the other hand does not include uaccess.h, even tho it calls access_ok(). In the generic implementation guard the include of linux/uaccess.h with the same condition as the code that needs it. With this change pre-processed net/checksum.h shrinks on x86 from 30616 lines to just 1193. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller --- diff --git a/arch/arm/include/asm/checksum.h b/arch/arm/include/asm/checksum.h index f0f54aef3724c..d8a13959bff0c 100644 --- a/arch/arm/include/asm/checksum.h +++ b/arch/arm/include/asm/checksum.h @@ -11,6 +11,7 @@ #define __ASM_ARM_CHECKSUM_H #include +#include /* * computes the checksum of a memory block at buff, length len, diff --git a/arch/x86/include/asm/checksum_64.h b/arch/x86/include/asm/checksum_64.h index 407beebadaf45..4d4a47a3a8ab2 100644 --- a/arch/x86/include/asm/checksum_64.h +++ b/arch/x86/include/asm/checksum_64.h @@ -9,7 +9,6 @@ */ #include -#include #include /** diff --git a/include/net/checksum.h b/include/net/checksum.h index 6bc783b7a06c2..1338cb92c8e72 100644 --- a/include/net/checksum.h +++ b/include/net/checksum.h @@ -18,8 +18,10 @@ #include #include #include -#include #include +#if !defined(_HAVE_ARCH_COPY_AND_CSUM_FROM_USER) || !defined(HAVE_CSUM_COPY_USER) +#include +#endif #ifndef _HAVE_ARCH_COPY_AND_CSUM_FROM_USER static __always_inline