Commit 268bb0ce3e87872cb9290c322b0d35bce230d88f

Authored by Linus Torvalds
1 parent 257313b2a8

sanitize <linux/prefetch.h> usage

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>

Showing 35 changed files with 32 additions and 5 deletions Side-by-side Diff

arch/ia64/hp/common/sba_iommu.c
... ... @@ -37,6 +37,7 @@
37 37 #include <linux/crash_dump.h>
38 38 #include <linux/iommu-helper.h>
39 39 #include <linux/dma-mapping.h>
  40 +#include <linux/prefetch.h>
40 41  
41 42 #include <asm/delay.h> /* ia64_get_itc() */
42 43 #include <asm/io.h>
arch/ia64/mm/fault.c
... ... @@ -10,6 +10,7 @@
10 10 #include <linux/interrupt.h>
11 11 #include <linux/kprobes.h>
12 12 #include <linux/kdebug.h>
  13 +#include <linux/prefetch.h>
13 14  
14 15 #include <asm/pgtable.h>
15 16 #include <asm/processor.h>
arch/powerpc/lib/sstep.c
... ... @@ -11,6 +11,7 @@
11 11 #include <linux/kernel.h>
12 12 #include <linux/kprobes.h>
13 13 #include <linux/ptrace.h>
  14 +#include <linux/prefetch.h>
14 15 #include <asm/sstep.h>
15 16 #include <asm/processor.h>
16 17 #include <asm/uaccess.h>
arch/sh/kernel/cpu/sh4/sq.c
... ... @@ -20,6 +20,7 @@
20 20 #include <linux/vmalloc.h>
21 21 #include <linux/mm.h>
22 22 #include <linux/io.h>
  23 +#include <linux/prefetch.h>
23 24 #include <asm/page.h>
24 25 #include <asm/cacheflush.h>
25 26 #include <cpu/sq.h>
arch/x86/include/asm/uaccess.h
... ... @@ -6,7 +6,6 @@
6 6 #include <linux/errno.h>
7 7 #include <linux/compiler.h>
8 8 #include <linux/thread_info.h>
9   -#include <linux/prefetch.h>
10 9 #include <linux/string.h>
11 10 #include <asm/asm.h>
12 11 #include <asm/page.h>
arch/x86/include/asm/uaccess_32.h
... ... @@ -6,7 +6,6 @@
6 6 */
7 7 #include <linux/errno.h>
8 8 #include <linux/thread_info.h>
9   -#include <linux/prefetch.h>
10 9 #include <linux/string.h>
11 10 #include <asm/asm.h>
12 11 #include <asm/page.h>
arch/x86/include/asm/uaccess_64.h
... ... @@ -6,7 +6,6 @@
6 6 */
7 7 #include <linux/compiler.h>
8 8 #include <linux/errno.h>
9   -#include <linux/prefetch.h>
10 9 #include <linux/lockdep.h>
11 10 #include <asm/alternative.h>
12 11 #include <asm/cpufeature.h>
... ... @@ -12,6 +12,7 @@
12 12 #include <linux/mmiotrace.h> /* kmmio_handler, ... */
13 13 #include <linux/perf_event.h> /* perf_sw_event */
14 14 #include <linux/hugetlb.h> /* hstate_index_to_shift */
  15 +#include <linux/prefetch.h> /* prefetchw */
15 16  
16 17 #include <asm/traps.h> /* dotraplinkage, ... */
17 18 #include <asm/pgalloc.h> /* pgd_*(), ... */
drivers/misc/sgi-gru/grufault.c
... ... @@ -33,6 +33,7 @@
33 33 #include <linux/io.h>
34 34 #include <linux/uaccess.h>
35 35 #include <linux/security.h>
  36 +#include <linux/prefetch.h>
36 37 #include <asm/pgtable.h>
37 38 #include "gru.h"
38 39 #include "grutables.h"
drivers/misc/sgi-gru/grumain.c
... ... @@ -28,6 +28,7 @@
28 28 #include <linux/device.h>
29 29 #include <linux/list.h>
30 30 #include <linux/err.h>
  31 +#include <linux/prefetch.h>
31 32 #include <asm/uv/uv_hub.h>
32 33 #include "gru.h"
33 34 #include "grutables.h"
drivers/net/acenic.c
... ... @@ -68,6 +68,7 @@
68 68 #include <linux/sockios.h>
69 69 #include <linux/firmware.h>
70 70 #include <linux/slab.h>
  71 +#include <linux/prefetch.h>
71 72  
72 73 #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
73 74 #include <linux/if_vlan.h>
drivers/net/ehea/ehea_main.c
... ... @@ -41,6 +41,7 @@
41 41 #include <linux/memory.h>
42 42 #include <asm/kexec.h>
43 43 #include <linux/mutex.h>
  44 +#include <linux/prefetch.h>
44 45  
45 46 #include <net/ip.h>
46 47  
drivers/staging/pohmelfs/inode.c
... ... @@ -29,6 +29,7 @@
29 29 #include <linux/slab.h>
30 30 #include <linux/statfs.h>
31 31 #include <linux/writeback.h>
  32 +#include <linux/prefetch.h>
32 33  
33 34 #include "netfs.h"
34 35  
drivers/usb/gadget/goku_udc.c
... ... @@ -38,6 +38,7 @@
38 38 #include <linux/device.h>
39 39 #include <linux/usb/ch9.h>
40 40 #include <linux/usb/gadget.h>
  41 +#include <linux/prefetch.h>
41 42  
42 43 #include <asm/byteorder.h>
43 44 #include <asm/io.h>
drivers/usb/gadget/imx_udc.c
... ... @@ -30,6 +30,7 @@
30 30 #include <linux/delay.h>
31 31 #include <linux/timer.h>
32 32 #include <linux/slab.h>
  33 +#include <linux/prefetch.h>
33 34  
34 35 #include <linux/usb/ch9.h>
35 36 #include <linux/usb/gadget.h>
drivers/usb/gadget/omap_udc.c
... ... @@ -44,6 +44,7 @@
44 44 #include <linux/usb/otg.h>
45 45 #include <linux/dma-mapping.h>
46 46 #include <linux/clk.h>
  47 +#include <linux/prefetch.h>
47 48  
48 49 #include <asm/byteorder.h>
49 50 #include <asm/io.h>
drivers/usb/gadget/pxa25x_udc.c
... ... @@ -46,6 +46,7 @@
46 46 #include <linux/seq_file.h>
47 47 #include <linux/debugfs.h>
48 48 #include <linux/io.h>
  49 +#include <linux/prefetch.h>
49 50  
50 51 #include <asm/byteorder.h>
51 52 #include <asm/dma.h>
drivers/usb/gadget/pxa27x_udc.c
... ... @@ -32,6 +32,7 @@
32 32 #include <linux/irq.h>
33 33 #include <linux/gpio.h>
34 34 #include <linux/slab.h>
  35 +#include <linux/prefetch.h>
35 36  
36 37 #include <asm/byteorder.h>
37 38 #include <mach/hardware.h>
drivers/usb/host/isp1362-hcd.c
... ... @@ -81,6 +81,7 @@
81 81 #include <linux/pm.h>
82 82 #include <linux/io.h>
83 83 #include <linux/bitmap.h>
  84 +#include <linux/prefetch.h>
84 85  
85 86 #include <asm/irq.h>
86 87 #include <asm/system.h>
drivers/usb/host/sl811-hcd.c
... ... @@ -47,6 +47,7 @@
47 47 #include <linux/usb/sl811.h>
48 48 #include <linux/usb/hcd.h>
49 49 #include <linux/platform_device.h>
  50 +#include <linux/prefetch.h>
50 51  
51 52 #include <asm/io.h>
52 53 #include <asm/irq.h>
drivers/video/udlfb.c
... ... @@ -27,6 +27,7 @@
27 27 #include <linux/fb.h>
28 28 #include <linux/vmalloc.h>
29 29 #include <linux/slab.h>
  30 +#include <linux/prefetch.h>
30 31 #include <linux/delay.h>
31 32 #include <video/udlfb.h>
32 33 #include "edid.h"
fs/btrfs/extent_io.c
... ... @@ -10,6 +10,7 @@
10 10 #include <linux/swap.h>
11 11 #include <linux/writeback.h>
12 12 #include <linux/pagevec.h>
  13 +#include <linux/prefetch.h>
13 14 #include "extent_io.h"
14 15 #include "extent_map.h"
15 16 #include "compat.h"
... ... @@ -35,6 +35,7 @@
35 35 #include <linux/hardirq.h>
36 36 #include <linux/bit_spinlock.h>
37 37 #include <linux/rculist_bl.h>
  38 +#include <linux/prefetch.h>
38 39 #include "internal.h"
39 40  
40 41 /*
... ... @@ -10,6 +10,7 @@
10 10 #include <linux/blkdev.h>
11 11 #include <linux/buffer_head.h>
12 12 #include <linux/gfp.h>
  13 +#include <linux/prefetch.h>
13 14  
14 15 #define PAGE_OFS(ofs) ((ofs) & (PAGE_SIZE-1))
15 16  
include/asm-generic/xor.h
... ... @@ -13,7 +13,7 @@
13 13 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
14 14 */
15 15  
16   -#include <asm/processor.h>
  16 +#include <linux/prefetch.h>
17 17  
18 18 static void
19 19 xor_8regs_2(unsigned long bytes, unsigned long *p1, unsigned long *p2)
... ... @@ -35,6 +35,7 @@
35 35 #include <linux/init.h>
36 36 #include <linux/time.h>
37 37 #include <linux/cpu.h>
  38 +#include <linux/prefetch.h>
38 39  
39 40 /* Controls for rcu_kthread() kthread, replacing RCU_SOFTIRQ used previously. */
40 41 static struct task_struct *rcu_kthread_task;
... ... @@ -49,6 +49,7 @@
49 49 #include <linux/kernel_stat.h>
50 50 #include <linux/wait.h>
51 51 #include <linux/kthread.h>
  52 +#include <linux/prefetch.h>
52 53  
53 54 #include "rcutree.h"
54 55  
... ... @@ -54,6 +54,7 @@
54 54 #include <trace/events/kmem.h>
55 55 #include <linux/ftrace_event.h>
56 56 #include <linux/memcontrol.h>
  57 +#include <linux/prefetch.h>
57 58  
58 59 #include <asm/tlbflush.h>
59 60 #include <asm/div64.h>
... ... @@ -13,6 +13,7 @@
13 13  
14 14 #include <linux/mm.h>
15 15 #include <linux/prio_tree.h>
  16 +#include <linux/prefetch.h>
16 17  
17 18 /*
18 19 * See lib/prio_tree.c for details on the general radix priority search tree
... ... @@ -115,6 +115,7 @@
115 115 #include <linux/debugobjects.h>
116 116 #include <linux/kmemcheck.h>
117 117 #include <linux/memory.h>
  118 +#include <linux/prefetch.h>
118 119  
119 120 #include <asm/cacheflush.h>
120 121 #include <asm/tlbflush.h>
... ... @@ -42,6 +42,7 @@
42 42 #include <linux/delayacct.h>
43 43 #include <linux/sysctl.h>
44 44 #include <linux/oom.h>
  45 +#include <linux/prefetch.h>
45 46  
46 47 #include <asm/tlbflush.h>
47 48 #include <asm/div64.h>
... ... @@ -19,6 +19,7 @@
19 19 #include <linux/types.h>
20 20 #include <net/net_namespace.h>
21 21 #include <linux/sched.h>
  22 +#include <linux/prefetch.h>
22 23  
23 24 #include <net/dst.h>
24 25  
... ... @@ -156,6 +156,7 @@
156 156 #include <linux/wait.h>
157 157 #include <linux/etherdevice.h>
158 158 #include <linux/kthread.h>
  159 +#include <linux/prefetch.h>
159 160 #include <net/net_namespace.h>
160 161 #include <net/checksum.h>
161 162 #include <net/ipv6.h>
... ... @@ -57,6 +57,7 @@
57 57 #include <linux/init.h>
58 58 #include <linux/scatterlist.h>
59 59 #include <linux/errqueue.h>
  60 +#include <linux/prefetch.h>
60 61  
61 62 #include <net/protocol.h>
62 63 #include <net/dst.h>
tools/perf/util/include/linux/list.h
... ... @@ -23,6 +23,6 @@
23 23 * @head: the head for your list.
24 24 */
25 25 #define list_for_each_from(pos, head) \
26   - for (; prefetch(pos->next), pos != (head); pos = pos->next)
  26 + for (; pos != (head); pos = pos->next)
27 27 #endif