sanitize <linux/prefetch.h> usage
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 20 May 2011 19:50:29 +0000 (12:50 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 20 May 2011 19:50:29 +0000 (12:50 -0700)
Commit e66eed651fd1 ("list: remove prefetching from regular list
iterators") removed the include of prefetch.h from list.h, which
uncovered several cases that had apparently relied on that rather
obscure header file dependency.

So this fixes things up a bit, using

   grep -L linux/prefetch.h $(git grep -l '[^a-z_]prefetchw*(' -- '*.[ch]')
   grep -L 'prefetchw*(' $(git grep -l 'linux/prefetch.h' -- '*.[ch]')

to guide us in finding files that either need <linux/prefetch.h>
inclusion, or have it despite not needing it.

There are more of them around (mostly network drivers), but this gets
many core ones.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
35 files changed:
arch/ia64/hp/common/sba_iommu.c
arch/ia64/mm/fault.c
arch/powerpc/lib/sstep.c
arch/sh/kernel/cpu/sh4/sq.c
arch/x86/include/asm/uaccess.h
arch/x86/include/asm/uaccess_32.h
arch/x86/include/asm/uaccess_64.h
arch/x86/mm/fault.c
drivers/misc/sgi-gru/grufault.c
drivers/misc/sgi-gru/grumain.c
drivers/net/acenic.c
drivers/net/ehea/ehea_main.c
drivers/staging/pohmelfs/inode.c
drivers/usb/gadget/goku_udc.c
drivers/usb/gadget/imx_udc.c
drivers/usb/gadget/omap_udc.c
drivers/usb/gadget/pxa25x_udc.c
drivers/usb/gadget/pxa27x_udc.c
drivers/usb/host/isp1362-hcd.c
drivers/usb/host/sl811-hcd.c
drivers/video/udlfb.c
fs/btrfs/extent_io.c
fs/dcache.c
fs/logfs/dev_bdev.c
include/asm-generic/xor.h
kernel/rcutiny.c
kernel/rcutree.c
mm/page_alloc.c
mm/prio_tree.c
mm/slab.c
mm/vmscan.c
net/core/dst.c
net/core/pktgen.c
net/core/skbuff.c
tools/perf/util/include/linux/list.h

index 4ce8d1358feecea321af29f6b0be5e8b1dde6bae..c04dd576f3331e544fb6f746abc56288fa62e300 100644 (file)
@@ -37,6 +37,7 @@
 #include <linux/crash_dump.h>
 #include <linux/iommu-helper.h>
 #include <linux/dma-mapping.h>
+#include <linux/prefetch.h>
 
 #include <asm/delay.h>         /* ia64_get_itc() */
 #include <asm/io.h>
index 0799fea4c5886643114bc767a8098b7fd246d34f..20b3593761282746777f2f27304e5ac03bdee1da 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/interrupt.h>
 #include <linux/kprobes.h>
 #include <linux/kdebug.h>
+#include <linux/prefetch.h>
 
 #include <asm/pgtable.h>
 #include <asm/processor.h>
index ae5189ab004926072e2f86e04b4b8aa33c0d0867..f73daa6f397007eb0f6e1c728c8ca1768b3c7f0b 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/kernel.h>
 #include <linux/kprobes.h>
 #include <linux/ptrace.h>
+#include <linux/prefetch.h>
 #include <asm/sstep.h>
 #include <asm/processor.h>
 #include <asm/uaccess.h>
index 14726eef1ce0cf62ecfbe1ae45cecb2aad0e278b..f0907995b4c90a7747136ffab7dee04629620838 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/vmalloc.h>
 #include <linux/mm.h>
 #include <linux/io.h>
+#include <linux/prefetch.h>
 #include <asm/page.h>
 #include <asm/cacheflush.h>
 #include <cpu/sq.h>
index 99f0ad753f32c482f9f5b222c84cee881696b628..99ddd148a760ff73561d42a1723ff4f0b158210e 100644 (file)
@@ -6,7 +6,6 @@
 #include <linux/errno.h>
 #include <linux/compiler.h>
 #include <linux/thread_info.h>
-#include <linux/prefetch.h>
 #include <linux/string.h>
 #include <asm/asm.h>
 #include <asm/page.h>
index 088d09fb1615af8081872b04e9b2b3ec15e1fbad..566e803cc6026a11a1391fd25051717cef3f5979 100644 (file)
@@ -6,7 +6,6 @@
  */
 #include <linux/errno.h>
 #include <linux/thread_info.h>
-#include <linux/prefetch.h>
 #include <linux/string.h>
 #include <asm/asm.h>
 #include <asm/page.h>
index 316708d5af92d2c5ecd2f7e22e0bc1852b003d7d..1c66d30971adedaac940770d701e141ae464e1f4 100644 (file)
@@ -6,7 +6,6 @@
  */
 #include <linux/compiler.h>
 #include <linux/errno.h>
-#include <linux/prefetch.h>
 #include <linux/lockdep.h>
 #include <asm/alternative.h>
 #include <asm/cpufeature.h>
index 20e3f8702d1e5701b130d2891e23bf39fbe81663..bcb394dfbb3587f8b4d40cc096b6ff7334ce6b12 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/mmiotrace.h>           /* kmmio_handler, ...           */
 #include <linux/perf_event.h>          /* perf_sw_event                */
 #include <linux/hugetlb.h>             /* hstate_index_to_shift        */
+#include <linux/prefetch.h>            /* prefetchw                    */
 
 #include <asm/traps.h>                 /* dotraplinkage, ...           */
 #include <asm/pgalloc.h>               /* pgd_*(), ...                 */
index 38657cdaf54d32b247c89e105611f0b96a267c75..c4acac74725c4de50ef0954a258a851c05a03930 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/io.h>
 #include <linux/uaccess.h>
 #include <linux/security.h>
+#include <linux/prefetch.h>
 #include <asm/pgtable.h>
 #include "gru.h"
 #include "grutables.h"
index f8538bbd0bfae72c11128d773f00aadc91f0c1ba..ae16c8cb4f3e94b5629be31a0f7073cbb05bb18c 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/device.h>
 #include <linux/list.h>
 #include <linux/err.h>
+#include <linux/prefetch.h>
 #include <asm/uv/uv_hub.h>
 #include "gru.h"
 #include "grutables.h"
index ee648fe5d96fc48b65c59c1a2965aea7902cbf63..01560bb67a7afabe48058cab783c979ce24a9aa6 100644 (file)
@@ -68,6 +68,7 @@
 #include <linux/sockios.h>
 #include <linux/firmware.h>
 #include <linux/slab.h>
+#include <linux/prefetch.h>
 
 #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
 #include <linux/if_vlan.h>
index cf79cf759e13608146f897e957128b927bb7479e..2c60435f2beb4a30b92acb47b16716891fd522d2 100644 (file)
@@ -41,6 +41,7 @@
 #include <linux/memory.h>
 #include <asm/kexec.h>
 #include <linux/mutex.h>
+#include <linux/prefetch.h>
 
 #include <net/ip.h>
 
index c93ef207b0b442120400621ce36dd7e873ec966f..c0f0ac7c1cdb8f8cb6dd1aae58a8318b1ae4fb87 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/slab.h>
 #include <linux/statfs.h>
 #include <linux/writeback.h>
+#include <linux/prefetch.h>
 
 #include "netfs.h"
 
index 48a760220baf992c48541f2cae822943690bae5c..bf6e11c758d5ec84b99e944a97e69c27b59a698f 100644 (file)
@@ -38,6 +38,7 @@
 #include <linux/device.h>
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
+#include <linux/prefetch.h>
 
 #include <asm/byteorder.h>
 #include <asm/io.h>
index 5408186afc35c41dee81ff8afb7bcc55163a68a4..ade40066decf59463447b1c89a600536024f6f3f 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/delay.h>
 #include <linux/timer.h>
 #include <linux/slab.h>
+#include <linux/prefetch.h>
 
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
index cb5cd422f3f513a163d606fde97f0f2f646f48a8..82fd2493533228e56f60164f64855d43468c5c9e 100644 (file)
@@ -44,6 +44,7 @@
 #include <linux/usb/otg.h>
 #include <linux/dma-mapping.h>
 #include <linux/clk.h>
+#include <linux/prefetch.h>
 
 #include <asm/byteorder.h>
 #include <asm/io.h>
index 444b60aa15e951dc489da9444b793031dd0d77de..365c02fc25fcf0f89668b79ce2a72933ada22a40 100644 (file)
@@ -46,6 +46,7 @@
 #include <linux/seq_file.h>
 #include <linux/debugfs.h>
 #include <linux/io.h>
+#include <linux/prefetch.h>
 
 #include <asm/byteorder.h>
 #include <asm/dma.h>
index 78a39a41547d0fb19c99254222c870ea51f1c3cf..57607696735cfb934ea8f2f38921bf0a44e03299 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/irq.h>
 #include <linux/gpio.h>
 #include <linux/slab.h>
+#include <linux/prefetch.h>
 
 #include <asm/byteorder.h>
 #include <mach/hardware.h>
index f97570a847ca073ff16c3eee7ae9845f5515e04c..9c37dad3e8168989eaf919cf8993fafb499d6126 100644 (file)
@@ -81,6 +81,7 @@
 #include <linux/pm.h>
 #include <linux/io.h>
 #include <linux/bitmap.h>
+#include <linux/prefetch.h>
 
 #include <asm/irq.h>
 #include <asm/system.h>
index 18b7099a8125c9e0cbcfe9858259dfe85482826d..fafccc2fd33140386e83413022a9a8c661b9e4be 100644 (file)
@@ -47,6 +47,7 @@
 #include <linux/usb/sl811.h>
 #include <linux/usb/hcd.h>
 #include <linux/platform_device.h>
+#include <linux/prefetch.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
index 68041d9dc2602e263474e7892c24b20c30e151b0..695066b5b2e6d628204695727c3afde94a0f6de7 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/fb.h>
 #include <linux/vmalloc.h>
 #include <linux/slab.h>
+#include <linux/prefetch.h>
 #include <linux/delay.h>
 #include <video/udlfb.h>
 #include "edid.h"
index ba41da59e31b1d93348622d7b47655234f5ff930..96fcfa522dab72f837d991d5afaaacd4e73d8f74 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/swap.h>
 #include <linux/writeback.h>
 #include <linux/pagevec.h>
+#include <linux/prefetch.h>
 #include "extent_io.h"
 #include "extent_map.h"
 #include "compat.h"
index 22a0ef41bad1b1cd17fc6ce84023d52f65096ba5..18b2a1f10ed89cab1562f696adebf391bf2a8763 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/hardirq.h>
 #include <linux/bit_spinlock.h>
 #include <linux/rculist_bl.h>
+#include <linux/prefetch.h>
 #include "internal.h"
 
 /*
index 1adc8d455f0ea2d66237436184766c5ed120688f..df0de27c273349c22ee6b8770b589663801c68f5 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/blkdev.h>
 #include <linux/buffer_head.h>
 #include <linux/gfp.h>
+#include <linux/prefetch.h>
 
 #define PAGE_OFS(ofs) ((ofs) & (PAGE_SIZE-1))
 
index aaab875e1a351f5596a22af645f567c2d2b5ae66..6028fb862254b8dfaeec0dd93de3a8fdf052ca5c 100644 (file)
@@ -13,7 +13,7 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <asm/processor.h>
+#include <linux/prefetch.h>
 
 static void
 xor_8regs_2(unsigned long bytes, unsigned long *p1, unsigned long *p2)
index 421abfd3641d2f011fe7b33b85a36a6b7cf8faf1..7bbac7d0f5abc1d4737c0664c6779d9db1ca5b85 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/init.h>
 #include <linux/time.h>
 #include <linux/cpu.h>
+#include <linux/prefetch.h>
 
 /* Controls for rcu_kthread() kthread, replacing RCU_SOFTIRQ used previously. */
 static struct task_struct *rcu_kthread_task;
index e486f7c3ffb8b239a31eddb37f9ed0251629bdeb..f07d2f03181a9b6c296a09e5e2869ea7c5844580 100644 (file)
@@ -49,6 +49,7 @@
 #include <linux/kernel_stat.h>
 #include <linux/wait.h>
 #include <linux/kthread.h>
+#include <linux/prefetch.h>
 
 #include "rcutree.h"
 
index 3f8bce264df66f712e9a44092f871d9f90eafe22..d49df7840541f5e4796f651afa0d6122ef08edbc 100644 (file)
@@ -54,6 +54,7 @@
 #include <trace/events/kmem.h>
 #include <linux/ftrace_event.h>
 #include <linux/memcontrol.h>
+#include <linux/prefetch.h>
 
 #include <asm/tlbflush.h>
 #include <asm/div64.h>
index 603ae98d9694dfbf88561abb266021b1bf370fb1..799dcfd7cd8c5499b78bdc1b0b6f976ce79465bc 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <linux/mm.h>
 #include <linux/prio_tree.h>
+#include <linux/prefetch.h>
 
 /*
  * See lib/prio_tree.c for details on the general radix priority search tree
index 46a9c163a92f222aeab9adc3a7ed56511e89a23b..bcfa4987c8ae2c9fc273f1baf75d4461ed743052 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
 #include       <linux/debugobjects.h>
 #include       <linux/kmemcheck.h>
 #include       <linux/memory.h>
+#include       <linux/prefetch.h>
 
 #include       <asm/cacheflush.h>
 #include       <asm/tlbflush.h>
index 8bfd45050a61494f919e90dfb1538ea8310f4f20..c9177202c8ce2ce2f9bfe9045f2a40a8105de8e8 100644 (file)
@@ -42,6 +42,7 @@
 #include <linux/delayacct.h>
 #include <linux/sysctl.h>
 #include <linux/oom.h>
+#include <linux/prefetch.h>
 
 #include <asm/tlbflush.h>
 #include <asm/div64.h>
index 91104d35de7d9d6f7d276e8ae02b833e5ddc4338..0a3920bf361372acd9934ca9ddbff57d4d3e1216 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/types.h>
 #include <net/net_namespace.h>
 #include <linux/sched.h>
+#include <linux/prefetch.h>
 
 #include <net/dst.h>
 
index aeeece72b72fa25d29dfd3162a2f9c3a8ef6fcbd..6ed9e27d8202c9d4bf2ec43537a83a444c7d8822 100644 (file)
 #include <linux/wait.h>
 #include <linux/etherdevice.h>
 #include <linux/kthread.h>
+#include <linux/prefetch.h>
 #include <net/net_namespace.h>
 #include <net/checksum.h>
 #include <net/ipv6.h>
index 7ebeed0a877cf4bb244d488346e745d45da93959..960ea899c864ecb2d8457fa5cd6e2a486fe80cf4 100644 (file)
@@ -57,6 +57,7 @@
 #include <linux/init.h>
 #include <linux/scatterlist.h>
 #include <linux/errqueue.h>
+#include <linux/prefetch.h>
 
 #include <net/protocol.h>
 #include <net/dst.h>
index 356c7e467b83fd59af5cd191a577197ee88349b8..99358d61e9a5828fcc2e276a9c37fc8cc3610321 100644 (file)
@@ -23,5 +23,5 @@ static inline void list_del_range(struct list_head *begin,
  * @head: the head for your list.
  */
 #define list_for_each_from(pos, head) \
-       for (; prefetch(pos->next), pos != (head); pos = pos->next)
+       for (; pos != (head); pos = pos->next)
 #endif