]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: checksum: drop the linux/uaccess.h include
authorJakub Kicinski <kuba@kernel.org>
Thu, 26 Jan 2023 07:14:16 +0000 (23:14 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Jan 2023 11:19:46 +0000 (11:19 +0000)
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 <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/arm/include/asm/checksum.h
arch/x86/include/asm/checksum_64.h
include/net/checksum.h

index f0f54aef3724c22e60ce9c7265c07b7895257d51..d8a13959bff0c2bdd7e182446325cd8fb61ac4e2 100644 (file)
@@ -11,6 +11,7 @@
 #define __ASM_ARM_CHECKSUM_H
 
 #include <linux/in6.h>
+#include <linux/uaccess.h>
 
 /*
  * computes the checksum of a memory block at buff, length len,
index 407beebadaf45a748f91a36b78bd1d023449b132..4d4a47a3a8ab2310d279f7e465032b1463200393 100644 (file)
@@ -9,7 +9,6 @@
  */
 
 #include <linux/compiler.h>
-#include <linux/uaccess.h>
 #include <asm/byteorder.h>
 
 /**
index 6bc783b7a06c2c702b5ab71a66bc0a03498f142b..1338cb92c8e72a8f2fc5271d9bbda2d7510dd2ef 100644 (file)
 #include <linux/errno.h>
 #include <asm/types.h>
 #include <asm/byteorder.h>
-#include <linux/uaccess.h>
 #include <asm/checksum.h>
+#if !defined(_HAVE_ARCH_COPY_AND_CSUM_FROM_USER) || !defined(HAVE_CSUM_COPY_USER)
+#include <linux/uaccess.h>
+#endif
 
 #ifndef _HAVE_ARCH_COPY_AND_CSUM_FROM_USER
 static __always_inline