headers: untangle kmemleak.h from mm.h
authorRandy Dunlap <rdunlap@infradead.org>
Thu, 5 Apr 2018 23:25:34 +0000 (16:25 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Apr 2018 04:36:27 +0000 (21:36 -0700)
Currently <linux/slab.h> #includes <linux/kmemleak.h> for no obvious
reason.  It looks like it's only a convenience, so remove kmemleak.h
from slab.h and add <linux/kmemleak.h> to any users of kmemleak_* that
don't already #include it.  Also remove <linux/kmemleak.h> from source
files that do not use it.

This is tested on i386 allmodconfig and x86_64 allmodconfig.  It would
be good to run it through the 0day bot for other $ARCHes.  I have
neither the horsepower nor the storage space for the other $ARCHes.

Update: This patch has been extensively build-tested by both the 0day
bot & kisskb/ozlabs build farms.  Both of them reported 2 build failures
for which patches are included here (in v2).

[ slab.h is the second most used header file after module.h; kernel.h is
  right there with slab.h. There could be some minor error in the
  counting due to some #includes having comments after them and I didn't
  combine all of those. ]

[akpm@linux-foundation.org: security/keys/big_key.c needs vmalloc.h, per sfr]
Link: http://lkml.kernel.org/r/e4309f98-3749-93e1-4bb7-d9501a39d015@infradead.org
Link: http://kisskb.ellerman.id.au/kisskb/head/13396/
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Ingo Molnar <mingo@kernel.org>
Reported-by: Michael Ellerman <mpe@ellerman.id.au> [2 build failures]
Reported-by: Fengguang Wu <fengguang.wu@intel.com> [2 build failures]
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Wei Yongjun <weiyongjun1@huawei.com>
Cc: Luis R. Rodriguez <mcgrof@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Mimi Zohar <zohar@linux.vnet.ibm.com>
Cc: John Johansen <john.johansen@canonical.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
23 files changed:
arch/powerpc/sysdev/dart_iommu.c
arch/powerpc/sysdev/msi_bitmap.c
arch/s390/kernel/nmi.c
arch/s390/kernel/smp.c
arch/sparc/kernel/irq_64.c
arch/x86/kernel/pci-dma.c
drivers/iommu/exynos-iommu.c
drivers/iommu/mtk_iommu_v1.c
drivers/net/ethernet/ti/cpsw.c
drivers/net/wireless/realtek/rtlwifi/pci.c
drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
drivers/staging/rtl8188eu/hal/fw.c
drivers/staging/rtlwifi/pci.c
drivers/virtio/virtio_ring.c
include/linux/slab.h
kernel/ucount.c
lib/test_firmware.c
mm/cma.c
mm/memblock.c
net/core/sysctl_net_core.c
net/ipv4/route.c
security/apparmor/lsm.c
security/keys/big_key.c

index a6198d4f0f032d0406b2c558f76ed365807d13bc..5ca3e22d051293b31bd3e0a2e19a668aee90f365 100644 (file)
@@ -38,6 +38,7 @@
 #include <linux/suspend.h>
 #include <linux/memblock.h>
 #include <linux/gfp.h>
+#include <linux/kmemleak.h>
 #include <asm/io.h>
 #include <asm/prom.h>
 #include <asm/iommu.h>
index c4dae27172b3e44968f4b11cb413cd4836f01972..6243a7e537d0dccde01693f7caf1ad69319a8de8 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <linux/slab.h>
 #include <linux/kernel.h>
+#include <linux/kmemleak.h>
 #include <linux/bitmap.h>
 #include <linux/bootmem.h>
 #include <asm/msi_bitmap.h>
index c7a627620e5ebc4a7050167f15201abcad3eaf6e..8c867b43c8ebc5b60469b52700ad6198daf1d874 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/hardirq.h>
 #include <linux/log2.h>
 #include <linux/kprobes.h>
-#include <linux/slab.h>
+#include <linux/kmemleak.h>
 #include <linux/time.h>
 #include <linux/module.h>
 #include <linux/sched/signal.h>
index a4a9fe1934e9f350765a68c7d517e242380023a4..2f8f7d7dd9a8387b2152999e5331f478bebabbbb 100644 (file)
@@ -27,7 +27,6 @@
 #include <linux/err.h>
 #include <linux/spinlock.h>
 #include <linux/kernel_stat.h>
-#include <linux/kmemleak.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/irqflags.h>
index d66dde833f5ef3210046922e668e0788401a090c..713670e6d13dccd18e4ff0ee17acadd910a1adae 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/seq_file.h>
 #include <linux/ftrace.h>
 #include <linux/irq.h>
-#include <linux/kmemleak.h>
 
 #include <asm/ptrace.h>
 #include <asm/processor.h>
index 14437116ffea2d03a545ba7610a55cef92e0ef38..77625b60a5104cbc06caeb6ce2b109fa8f28994e 100644 (file)
@@ -6,7 +6,6 @@
 #include <linux/bootmem.h>
 #include <linux/gfp.h>
 #include <linux/pci.h>
-#include <linux/kmemleak.h>
 
 #include <asm/proto.h>
 #include <asm/dma.h>
index 2138102ef611de074ea16291770470feeaf2d4ee..c5f4f7691b571d8ef3ba1677d5353ca9a2b31be7 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/io.h>
 #include <linux/iommu.h>
 #include <linux/interrupt.h>
+#include <linux/kmemleak.h>
 #include <linux/list.h>
 #include <linux/of.h>
 #include <linux/of_iommu.h>
index 542930cd183d07ba1af592f2a99292a6e6c572f9..5a96fd14ac22876825aa4023d153558120743d61 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/io.h>
 #include <linux/iommu.h>
 #include <linux/iopoll.h>
-#include <linux/kmemleak.h>
 #include <linux/list.h>
 #include <linux/of_address.h>
 #include <linux/of_iommu.h>
index 1b4af54a4968917d75e04865dd5a67fd40ec4823..30371274409d7e5704989302939866a3ac1c6ca7 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/of_net.h>
 #include <linux/of_device.h>
 #include <linux/if_vlan.h>
+#include <linux/kmemleak.h>
 
 #include <linux/pinctrl/consumer.h>
 
index 2437422625bf506d1d43197a311a7b9848bbfc70..57bb8f049e592b69327660f694505ad413ee4edb 100644 (file)
@@ -31,7 +31,6 @@
 #include "efuse.h"
 #include <linux/interrupt.h>
 #include <linux/export.h>
-#include <linux/kmemleak.h>
 #include <linux/module.h>
 
 MODULE_AUTHOR("lizhaoming      <chaoming_li@realsil.com.cn>");
index 015476e3f7e543dd179d5d75f634151fa7349dba..f3bff66e85d0c391bba7e19809ce776be535914c 100644 (file)
@@ -32,7 +32,6 @@
 #include "../rtl8192ce/def.h"
 #include "fw_common.h"
 #include <linux/export.h>
-#include <linux/kmemleak.h>
 
 static void _rtl92c_enable_fw_download(struct ieee80211_hw *hw, bool enable)
 {
index 03d091bad13a4c946358e549a26c640ce782ccbf..6b67b38a6a9f2e4cc58bb447f620349968679029 100644 (file)
@@ -30,7 +30,7 @@
 #include "rtl8188e_hal.h"
 
 #include <linux/firmware.h>
-#include <linux/kmemleak.h>
+#include <linux/slab.h>
 
 static void _rtl88e_enable_fw_download(struct adapter *adapt, bool enable)
 {
index 70a64a5f564a0f96065433ff25ea948ee38df7df..d56810eabde7fac41b4e0313f94e31d242182644 100644 (file)
@@ -31,7 +31,6 @@
 #include "efuse.h"
 #include <linux/interrupt.h>
 #include <linux/export.h>
-#include <linux/kmemleak.h>
 #include <linux/module.h>
 
 MODULE_AUTHOR("lizhaoming      <chaoming_li@realsil.com.cn>");
index 71458f493cf864aa260e493c0ef5ddc4d6c78274..21d464a29cf8d637db6ccff38e2c146b4296c4d4 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/hrtimer.h>
-#include <linux/kmemleak.h>
 #include <linux/dma-mapping.h>
 #include <xen/xen.h>
 
index 04402c6371714c42d30e1928e02347bcae6459f7..81ebd71f8c03cc58bf393f3dad430e63970a622d 100644 (file)
 #define ZERO_OR_NULL_PTR(x) ((unsigned long)(x) <= \
                                (unsigned long)ZERO_SIZE_PTR)
 
-#include <linux/kmemleak.h>
 #include <linux/kasan.h>
 
 struct mem_cgroup;
index b4eeee03934fe8f083b70e9907be0721759bc3be..f48d1b6376a42d5429ab738e1563c5b588d6776c 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/slab.h>
 #include <linux/cred.h>
 #include <linux/hash.h>
+#include <linux/kmemleak.h>
 #include <linux/user_namespace.h>
 
 #define UCOUNTS_HASHTABLE_BITS 10
index 078a6148057327209594c50243acb1910a1ea501..cee000ac54d8d6813e6226851fe71dcaaa2fad48 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/uaccess.h>
 #include <linux/delay.h>
 #include <linux/kthread.h>
+#include <linux/vmalloc.h>
 
 #define TEST_FIRMWARE_NAME     "test-firmware.bin"
 #define TEST_FIRMWARE_NUM_REQS 4
index 0600fc08a9f4569349db4c25adf652ceb6bca279..5809bbe360d7fb724a435309e6e693a98f9efbfb 100644 (file)
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -35,6 +35,7 @@
 #include <linux/cma.h>
 #include <linux/highmem.h>
 #include <linux/io.h>
+#include <linux/kmemleak.h>
 #include <trace/events/cma.h>
 
 #include "cma.h"
index 04406a930bfccd7b2aefee54939774f689940894..ecc6cb58cd33cf4fce84d9920ebc7e8b461f86e4 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/poison.h>
 #include <linux/pfn.h>
 #include <linux/debugfs.h>
+#include <linux/kmemleak.h>
 #include <linux/seq_file.h>
 #include <linux/memblock.h>
 
index b3b609f0eeb53129ced2bcae3cd21b21d8995e39..b1a2c5e38530a72478cab1a874cb7f78909a118b 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/vmalloc.h>
 #include <linux/init.h>
 #include <linux/slab.h>
-#include <linux/kmemleak.h>
 
 #include <net/ip.h>
 #include <net/sock.h>
index 8322e479f2997b8f0a97b7d6c87434e91471a941..594a1c605c92286cb6dfdf7fc81431906a7a598c 100644 (file)
 #include <net/rtnetlink.h>
 #ifdef CONFIG_SYSCTL
 #include <linux/sysctl.h>
-#include <linux/kmemleak.h>
 #endif
 #include <net/secure_seq.h>
 #include <net/ip_tunnels.h>
index 9a65eeaf7dfa22ab3b76d05b1445c56031195cd3..6134302c143ceb7d0dab53e330a643a8141560a8 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/sysctl.h>
 #include <linux/audit.h>
 #include <linux/user_namespace.h>
-#include <linux/kmemleak.h>
 #include <net/sock.h>
 
 #include "include/apparmor.h"
index fa728f662a6f3e094dccacca44d1ebc099e5a0c6..933623784ccdf894b0d5217196a42ce6e44fa095 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/err.h>
 #include <linux/scatterlist.h>
 #include <linux/random.h>
+#include <linux/vmalloc.h>
 #include <keys/user-type.h>
 #include <keys/big_key-type.h>
 #include <crypto/aead.h>