gitwatch http://kernel.org/~vegard/gitwatch.rss linux-2.6.git patch filter en coccinelle: performance counters: x86 support <pre>commit 241771ef016b5c0c83cd7a4372a74321c973c1e6 Author: Ingo Molnar &lt;mingo@elte.hu&gt; Date: Wed Dec 3 10:39:53 2008 +0100 performance counters: x86 support Implement performance counters for x86 Intel CPUs. It&#39;s simplified right now: the PERFMON CPU feature is assumed, which is available in Core2 and later Intel CPUs. The design is flexible to be extended to more CPU types as well. Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/bugon.cocci: // using BUG_ON implies that the if disappears when checking is not desired // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/bugon.html // Options: -no_includes -include_headers diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 4461011..da01b9e 100644 --- a/tmp/WRBbYMZWid.c +++ b/tmp/dWnjyUTN4e.c @@ -1033,8 +1033,7 @@ void __cpuinit cpu_init(void) atomic_inc(&amp;init_mm.mm_count); me-&gt;active_mm = &amp;init_mm; - if (me-&gt;mm) - BUG(); + BUG_ON(me-&gt;mm); enter_lazy_tlb(&amp;init_mm, me); load_sp0(t, &amp;current-&gt;thread); @@ -1103,8 +1102,7 @@ void __cpuinit cpu_init(void) */ atomic_inc(&amp;init_mm.mm_count); curr-&gt;active_mm = &amp;init_mm; - if (curr-&gt;mm) - BUG(); + BUG_ON(curr-&gt;mm); enter_lazy_tlb(&amp;init_mm, curr); load_sp0(t, thread); </pre> checkpatch: perf counters: restructure the API <pre>commit 9f66a3810fe0d4100972db84290f3ae4a4d77025 Author: Ingo Molnar &lt;mingo@elte.hu&gt; Date: Wed Dec 10 12:33:23 2008 +0100 perf counters: restructure the API Impact: clean up new API Thorough cleanup of the new perf counters API, we now get clean separation of the various concepts: - introduce perf_counter_hw_event to separate out the event source details - move special type flags into separate attributes: PERF_COUNT_NMI, PERF_COUNT_RAW - extend the type to u64 and reserve it fully to the architecture in the raw type case. And make use of all these changes in the core and x86 perfcounters code. Also change the syscall signature to: asmlinkage int sys_perf_counter_open( struct perf_counter_hw_event *hw_event_uptr __user, pid_t pid, int cpu, int group_fd); ( Note that group_fd is unused for now - it&#39;s reserved for the counter groups abstraction. ) Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #206: FILE: include/linux/perf_counter.h:75: + u32 disabled : 1, /* off by default */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #207: FILE: include/linux/perf_counter.h:76: + nmi : 1, /* NMI sampling */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #208: FILE: include/linux/perf_counter.h:77: + raw : 1, /* raw event type */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #209: FILE: include/linux/perf_counter.h:78: + __reserved_1 : 29; ^ total: 4 errors, 0 warnings, 323 lines checked </pre> checkpatch: perf counters: add support for group counters <pre>commit 04289bb9891882202d7e961c4c04d2376930e9f9 Author: Ingo Molnar &lt;mingo@elte.hu&gt; Date: Thu Dec 11 08:38:42 2008 +0100 perf counters: add support for group counters Impact: add group counters This patch adds the &quot;counter groups&quot; abstraction. Groups of counters behave much like normal &#39;single&#39; counters, with a few semantic and behavioral extensions on top of that. A counter group is created by creating a new counter with the open() syscall&#39;s group-leader group_fd file descriptor parameter pointing to another, already existing counter. Groups of counters are scheduled in and out in one atomic group, and they are also roundrobin-scheduled atomically. Counters that are member of a group can also record events with an (atomic) extended timestamp that extends to all members of the group, if the record type is set to PERF_RECORD_GROUP. Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>WARNING: line over 80 characters #156: FILE: kernel/perf_counter.c:100: + list_add_tail(&amp;counter-&gt;list_entry, &amp;group_leader-&gt;sibling_list); total: 0 errors, 1 warnings, 592 lines checked </pre> checkpatch: x86: implement atomic64_t on 32-bit <pre>commit 9b194e831fb2c322ed81a373e49620f34edc2778 Author: Ingo Molnar &lt;mingo@elte.hu&gt; Date: Sun Dec 14 20:22:35 2008 +0100 x86: implement atomic64_t on 32-bit Impact: new API Implement the atomic64_t APIs on 32-bit as well. Will be used by the performance counters code. Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>WARNING: do not add new typedefs #23: FILE: arch/x86/include/asm/atomic_32.h:260: +typedef struct { WARNING: line over 80 characters #39: FILE: arch/x86/include/asm/atomic_32.h:276: +cmpxchg8b(unsigned long long *ptr, unsigned long long old, unsigned long long new) ERROR: space prohibited before open square bracket &#39;[&#39; #47: FILE: arch/x86/include/asm/atomic_32.h:284: + : [ptr] &quot;D&quot; (ptr), WARNING: line over 80 characters #118: FILE: arch/x86/include/asm/atomic_32.h:355: +static inline long atomic64_sub_return(unsigned long long delta, atomic64_t *ptr) total: 1 errors, 3 warnings, 223 lines checked </pre> checkpatch: perfcounters: implement "counter inheritance" <pre>commit 9b51f66dcb09ac5eb6bc68fc111d5c7a1e0131d6 Author: Ingo Molnar &lt;mingo@elte.hu&gt; Date: Fri Dec 12 13:49:45 2008 +0100 perfcounters: implement &quot;counter inheritance&quot; Impact: implement new performance feature Counter inheritance can be used to run performance counters in a workload, transparently - and pipe back the counter results to the parent counter. Inheritance for performance counters works the following way: when creating a counter it can be marked with the .inherit=1 flag. Such counters are then &#39;inherited&#39; by all child tasks (be they fork()-ed or clone()-ed). These counters get inherited through exec() boundaries as well (except through setuid boundaries). The counter values get added back to the parent counter(s) when the child task(s) exit - much like stime/utime statistics are gathered. So inherited counters are ideal to gather summary statistics about an application&#39;s behavior via shell commands, without having to modify that application. The timec.c command utilizes counter inheritance: http://redhat.com/~mingo/perfcounters/timec.c Sample output: $ ./timec -e 1 -e 3 -e 5 ls -lR /usr/include/ &gt;/dev/null Performance counter stats for &#39;ls&#39;: 163516953 instructions 2295 cache-misses 2855182 branch-misses Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #50: FILE: include/linux/perf_counter.h:78: + u32 disabled : 1, /* off by default */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #51: FILE: include/linux/perf_counter.h:79: + nmi : 1, /* NMI sampling */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #52: FILE: include/linux/perf_counter.h:80: + raw : 1, /* raw event type */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #53: FILE: include/linux/perf_counter.h:81: + inherit : 1, /* children inherit it */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #54: FILE: include/linux/perf_counter.h:82: + __reserved_1 : 28; ^ WARNING: line over 80 characters #485: FILE: kernel/perf_counter.c:1190: + if (!counter-&gt;hw_event.inherit || counter-&gt;group_leader != counter) total: 5 errors, 1 warnings, 438 lines checked </pre> coccinelle: x86, perfcounters: rename intel_arch_perfmon.h => perf_counter.h <pre>commit 5c167b8585c8d91206b395d57011ead7711e322f Author: Ingo Molnar &lt;mingo@elte.hu&gt; Date: Wed Dec 17 09:02:19 2008 +0100 x86, perfcounters: rename intel_arch_perfmon.h =&gt; perf_counter.h Impact: rename include file We&#39;ll be providing an asm/perf_counter.h to the generic perfcounter code, so use the already existing x86 file for this purpose and rename it. Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/bugon.cocci: // using BUG_ON implies that the if disappears when checking is not desired // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/bugon.html // Options: -no_includes -include_headers diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index ad331b4..dcd020a 100644 --- a/tmp/OlIyR3baRV.c +++ b/tmp/KKS8jodobo.c @@ -1033,8 +1033,7 @@ void __cpuinit cpu_init(void) atomic_inc(&amp;init_mm.mm_count); me-&gt;active_mm = &amp;init_mm; - if (me-&gt;mm) - BUG(); + BUG_ON(me-&gt;mm); enter_lazy_tlb(&amp;init_mm, me); load_sp0(t, &amp;current-&gt;thread); @@ -1103,8 +1102,7 @@ void __cpuinit cpu_init(void) */ atomic_inc(&amp;init_mm.mm_count); curr-&gt;active_mm = &amp;init_mm; - if (curr-&gt;mm) - BUG(); + BUG_ON(curr-&gt;mm); enter_lazy_tlb(&amp;init_mm, curr); load_sp0(t, thread); </pre> checkpatch: perfcounters: add fixed-mode PMC enumeration <pre>commit 703e937c83bbad79075a7846e062e447c2fee6a4 Author: Ingo Molnar &lt;mingo@elte.hu&gt; Date: Wed Dec 17 10:51:15 2008 +0100 perfcounters: add fixed-mode PMC enumeration Enumerate fixed-mode PMCs based on CPUID, and feed that into the perfcounter code. Does not use fixed-mode PMCs yet. Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>WARNING: line over 80 characters #101: FILE: arch/x86/kernel/cpu/perf_counter.c:558: + WARN(1, KERN_ERR &quot;hw perf counters fixed %d &gt; max(%d), clipping!&quot;, total: 0 errors, 1 warnings, 82 lines checked </pre> checkpatch: x86, perfcounters: refactor code for fixed-function PMCs <pre>commit 862a1a5f346fe7e9181ea51eaae48cf2cd70f746 Author: Ingo Molnar &lt;mingo@elte.hu&gt; Date: Wed Dec 17 13:09:20 2008 +0100 x86, perfcounters: refactor code for fixed-function PMCs Impact: clean up Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>WARNING: line over 80 characters #244: FILE: arch/x86/kernel/cpu/perf_counter.c:565: + perf_counter_mask |= ((1LL &lt;&lt; nr_counters_fixed)-1) &lt;&lt; X86_PMC_IDX_FIXED; total: 0 errors, 1 warnings, 213 lines checked </pre> checkpatch: perfcounters: fix task clock counter <pre>commit aa9c4c0f967fdb482ea95e8473ec3d201e6e0781 Author: Ingo Molnar &lt;mingo@elte.hu&gt; Date: Wed Dec 17 14:10:57 2008 +0100 perfcounters: fix task clock counter Impact: fix per task clock counter precision Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>WARNING: line over 80 characters #24: FILE: include/linux/kernel_stat.h:75: +extern unsigned long long __task_delta_exec(struct task_struct *tsk, int update); WARNING: line over 80 characters #225: FILE: kernel/perf_counter.c:895: +static void task_clock_perf_counter_update(struct perf_counter *counter, u64 now) total: 0 errors, 2 warnings, 337 lines checked </pre> checkpatch: x86, perfcounters: print out the ->used bitmask <pre>commit 0dff86aa7b9ec65a6d07167b7afb050b5fc98ddc Author: Ingo Molnar &lt;mingo@elte.hu&gt; Date: Tue Dec 23 12:28:12 2008 +0100 x86, perfcounters: print out the -&gt;used bitmask Impact: extend debug printouts Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>WARNING: line over 80 characters #42: FILE: arch/x86/kernel/cpu/perf_counter.c:297: + printk(KERN_INFO &quot;CPU#%d: used: %016llx\n&quot;, cpu, *(u64 *)cpuc-&gt;used); total: 0 errors, 1 warnings, 28 lines checked </pre> checkpatch: x86, perfcounters: add support for fixed-function pmcs <pre>commit 2f18d1e8d07ae67dd0afce875287756d4bd31a46 Author: Ingo Molnar &lt;mingo@elte.hu&gt; Date: Mon Dec 22 11:10:42 2008 +0100 x86, perfcounters: add support for fixed-function pmcs Impact: extend performance counter support on x86 Intel CPUs Modern Intel CPUs have 3 &quot;fixed-function&quot; performance counters, which count these hardware events: Instr_Retired.Any CPU_CLK_Unhalted.Core CPU_CLK_Unhalted.Ref Add support for them to the performance counters subsystem. Their use is transparent to user-space: the counter scheduler is extended to automatically recognize the cases where a fixed-function PMC can be utilized instead of a generic PMC. In such cases the generic PMC is kept available for more counters. The above fixed-function events map to these generic counter hw events: PERF_COUNT_INSTRUCTIONS PERF_COUNT_CPU_CYCLES PERF_COUNT_BUS_CYCLES (The &#39;bus&#39; cycles are in reality often CPU-ish cycles, just with a fixed frequency.) Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>WARNING: line over 80 characters #236: FILE: arch/x86/kernel/cpu/perf_counter.c:336: + idx = find_first_zero_bit(cpuc-&gt;used, nr_counters_generic); total: 0 errors, 1 warnings, 302 lines checked </pre> checkpatch: powerpc: Provide a way to defer perf counter work until interrupts are enabled <pre>commit 93a6d3ce6962044fe9badf528fed46b455d58292 Author: Paul Mackerras &lt;paulus@samba.org&gt; Date: Fri Jan 9 16:52:19 2009 +1100 powerpc: Provide a way to defer perf counter work until interrupts are enabled Because 64-bit powerpc uses lazy (soft) interrupt disabling, it is possible for a performance monitor exception to come in when the kernel thinks interrupts are disabled (i.e. when they are soft-disabled but hard-enabled). In such a situation the performance monitor exception handler might have some processing to do (such as process wakeups) which can&#39;t be done in what is effectively an NMI handler. This provides a way to defer that work until interrupts get enabled, either in raw_local_irq_restore() or by returning from an interrupt handler to code that had interrupts enabled. We have a per-processor flag that indicates that there is work pending to do when interrupts subsequently get re-enabled. This flag is checked in the interrupt return path and in raw_local_irq_restore(), and if it is set, perf_counter_do_pending() is called to do the pending work. Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt; </pre>---<pre>WARNING: line over 80 characters #85: FILE: arch/powerpc/kernel/asm-offsets.c:130: + DEFINE(PACAPERFPEND, offsetof(struct paca_struct, perf_counter_pending)); total: 0 errors, 1 warnings, 87 lines checked </pre> checkpatch: powerpc/perf_counter: Add support for PPC970 family <pre>commit 16b067993dee3dfde61b20027e0b168dc06201ee Author: Paul Mackerras &lt;paulus@samba.org&gt; Date: Sat Jan 10 16:34:07 2009 +1100 powerpc/perf_counter: Add support for PPC970 family This adds the back-end for the PMU on the PPC970 family. The PPC970 allows events from the ISU to be selected in two different ways. Rather than use alternative event codes to express this, we instead use a single encoding for ISU events and express the resulting constraint (that you can&#39;t select events from all three of FPU/IFU/VPU, ISU and IDU/STS at the same time, since they all come in through only 2 multiplexers) using a NAND constraint field, and work out which multiplexer is used for ISU events at compute_mmcr time. Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt; </pre>---<pre>WARNING: externs should be avoided in .c files #40: FILE: arch/powerpc/kernel/perf_counter.c:744: +extern struct power_pmu ppc970_pmu; ERROR: trailing whitespace #262: FILE: arch/powerpc/kernel/ppc970-pmu.c:194: +^I^I$ total: 1 errors, 1 warnings, 409 lines checked </pre> checkpatch: powerpc/perf_counter: Add support for POWER6 <pre>commit f78628374a13bc150db77c6e02d4f2c0a7f932ef Author: Paul Mackerras &lt;paulus@samba.org&gt; Date: Fri Jan 9 21:05:35 2009 +1100 powerpc/perf_counter: Add support for POWER6 This adds the back-end for the PMU on the POWER6 processor. Fortunately, the event selection hardware is somewhat simpler on POWER6 than on other POWER family processors, so the constraints fit into only 32 bits. Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt; </pre>---<pre>WARNING: externs should be avoided in .c files #34: FILE: arch/powerpc/kernel/perf_counter.c:745: +extern struct power_pmu power6_pmu; ERROR: spaces required around that &#39;?&#39; (ctx:VxW) #304: FILE: arch/powerpc/kernel/power6-pmu.c:251: + ((pmc &gt; 2? pmc - 2: pmc + 2) &lt;&lt; PM_PMC_SH); ^ ERROR: spaces required around that &#39;:&#39; (ctx:VxW) #304: FILE: arch/powerpc/kernel/power6-pmu.c:251: + ((pmc &gt; 2? pmc - 2: pmc + 2) &lt;&lt; PM_PMC_SH); ^ ERROR: trailing whitespace #321: FILE: arch/powerpc/kernel/power6-pmu.c:268: +^I[PERF_COUNT_BRANCH_INSTRUCTIONS] = 0x410a0,^I/* BR_PRED */ $ total: 3 errors, 1 warnings, 307 lines checked </pre> badincludes: powerpc/perf_counter: Make sure PMU gets enabled properly <pre>commit 01d0287f068de2934109ba9b989d8807526cccc2 Author: Paul Mackerras &lt;paulus@samba.org&gt; Date: Wed Jan 14 13:44:19 2009 +1100 powerpc/perf_counter: Make sure PMU gets enabled properly This makes sure that we call the platform-specific ppc_md.enable_pmcs function on each CPU before we try to use the PMU on that CPU. If the CPU goes off-line and then on-line, we need to do the enable_pmcs call again, so we use the hw_perf_counter_setup hook to ensure that. It gets called as each CPU comes online, but it isn&#39;t called on the CPU that is coming up, so this adds the CPU number as an argument to it (there were no non-empty instances of hw_perf_counter_setup before). This also arranges to set the pmcregs_in_use field of the lppaca (data structure shared with the hypervisor) on each CPU when we are using the PMU and clear it when we are not. This allows the hypervisor to optimize partition switches by not saving/restoring the PMU registers when we aren&#39;t using the PMU. Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt; </pre>---<pre>diff --git a/arch/powerpc/kernel/perf_counter.c b/arch/powerpc/kernel/perf_counter.c index df3fe05..85ad259 100644 --- a/arch/powerpc/kernel/perf_counter.c +++ b/arch/powerpc/kernel/perf_counter.c @@ -15,6 +15,7 @@ #include &lt;linux/hardirq.h&gt; #include &lt;asm/reg.h&gt; #include &lt;asm/pmc.h&gt; +#include &lt;asm/machdep.h&gt; struct cpu_hw_counters { int n_counters; include asm/machdep.h inserted after asm/pmc.h </pre> checkpatch: perf_counter: Add support for pinned and exclusive counter groups <pre>commit 3b6f9e5cb21964b7ce12bf81076f830885563ec8 Author: Paul Mackerras &lt;paulus@samba.org&gt; Date: Wed Jan 14 21:00:30 2009 +1100 perf_counter: Add support for pinned and exclusive counter groups Impact: New perf_counter features A pinned counter group is one that the user wants to have on the CPU whenever possible, i.e. whenever the associated task is running, for a per-task group, or always for a per-cpu group. If the system cannot satisfy that, it puts the group into an error state where it is not scheduled any more and reads from it return EOF (i.e. 0 bytes read). The group can be released from error state and made readable again using prctl(PR_TASK_PERF_COUNTERS_ENABLE). When we have finer-grained enable/disable controls on counters we&#39;ll be able to reset the error state on individual groups. An exclusive group is one that the user wants to be the only group using the CPU performance monitor hardware whenever it is on. The counter group scheduler will not schedule an exclusive group if there are already other groups on the CPU and will not schedule other groups onto the CPU if there is an exclusive group scheduled (that statement does not apply to groups containing only software counters, which can always go on and which do not prevent an exclusive group from going on). With an exclusive group, we will be able to let users program PMU registers at a low level without the concern that those settings will perturb other measurements. Along the way this reorganizes things a little: - is_software_counter() is moved to perf_counter.h. - cpuctx-&gt;active_oncpu now records the number of hardware counters on the CPU, i.e. it now excludes software counters. Nothing was reading cpuctx-&gt;active_oncpu before, so this change is harmless. - A new cpuctx-&gt;exclusive field records whether we currently have an exclusive group on the CPU. - counter_sched_out moves higher up in perf_counter.c and gets called from __perf_counter_remove_from_context and __perf_counter_exit_task, where we used to have essentially the same code. - __perf_counter_sched_in now goes through the counter list twice, doing the pinned counters in the first loop and the non-pinned counters in the second loop, in order to give the pinned counters the best chance to be scheduled in. Note that only a group leader can be exclusive or pinned, and that attribute applies to the whole group. This avoids some awkwardness in some corner cases (e.g. where a group leader is closed and the other group members get added to the context list). If we want to relax that restriction later, we can, and it is easier to relax a restriction than to apply a new one. This doesn&#39;t yet handle the case where a pinned counter is inherited and goes into error state in the child - the error state is not propagated up to the parent when the child exits, and arguably it should. Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt; </pre>---<pre>ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #102: FILE: include/linux/perf_counter.h:89: + pinned : 1, /* must always be on PMU */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #103: FILE: include/linux/perf_counter.h:90: + exclusive : 1, /* only counter on PMU */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #105: FILE: include/linux/perf_counter.h:92: + __reserved_1 : 26; ^ total: 3 errors, 0 warnings, 427 lines checked </pre> checkpatch: perfcounters: ratelimit performance counter interrupts <pre>commit 4b39fd96855254a244f71245b41a91cdecb87d63 Author: Mike Galbraith &lt;efault@gmx.de&gt; Date: Fri Jan 23 14:36:16 2009 +0100 perfcounters: ratelimit performance counter interrupts Ratelimit performance counter interrupts to 100KHz per CPU. This replaces the irq-delta-time based method. Signed-off-by: Mike Galbraith &lt;efault@gmx.de&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: Macros with complex values should be enclosed in parenthesis #34: FILE: arch/x86/kernel/cpu/perf_counter.c:475: +#define PERFMON_MAX_INTERRUPTS 100000/HZ total: 1 errors, 0 warnings, 81 lines checked </pre> checkpatch: perfcounters: fix refcounting bug <pre>commit 65d370862f64973611a271ced61864b5f9bb6fc0 Author: Mike Galbraith &lt;efault@gmx.de&gt; Date: Thu Jan 29 14:06:52 2009 +0100 perfcounters: fix refcounting bug don&#39;t kfree in use counters. Running... while true; do perfstat -e 1 -c true; done ...on all cores for a while doesn&#39;t seem to be eating ram, and my oops is gone. Signed-off-by: Mike Galbraith &lt;efault@gmx.de&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>WARNING: line over 80 characters #27: FILE: kernel/perf_counter.c:1937: + if (!child_counter-&gt;filp || !atomic_long_read(&amp;child_counter-&gt;filp-&gt;f_count)) total: 0 errors, 1 warnings, 9 lines checked </pre> badincludes: perf_counters: make software counters work as per-cpu counters <pre>commit 23a185ca8abbeef64b6ffc33059b1d630e43ec10 Author: Paul Mackerras &lt;paulus@samba.org&gt; Date: Mon Feb 9 22:42:47 2009 +1100 perf_counters: make software counters work as per-cpu counters Impact: kernel crash fix Yanmin Zhang reported that using a PERF_COUNT_TASK_CLOCK software counter as a per-cpu counter would reliably crash the system, because it calls __task_delta_exec with a null pointer. The page fault, context switch and cpu migration counters also won&#39;t function correctly as per-cpu counters since they reference the current task. This fixes the problem by redirecting the task_clock counter to the cpu_clock counter when used as a per-cpu counter, and by implementing per-cpu page fault, context switch and cpu migration counters. Along the way, this: - Initializes counter-&gt;ctx earlier, in perf_counter_alloc, so that sw_perf_counter_init can use it - Adds code to kernel/sched.c to count task migrations into each cpu, in rq-&gt;nr_migrations_in - Exports the per-cpu context switch and task migration counts via new functions added to kernel/sched.c - Makes sure that if sw_perf_counter_init fails, we don&#39;t try to initialize the counter as a hardware counter. Since the user has passed a negative, non-raw event type, they clearly don&#39;t intend for it to be interpreted as a hardware event. Reported-by: &quot;Zhang Yanmin&quot; &lt;yanmin_zhang@linux.intel.com&gt; Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c index f27a7e9..544193c 100644 --- a/kernel/perf_counter.c +++ b/kernel/perf_counter.c @@ -20,6 +20,8 @@ #include &lt;linux/anon_inodes.h&gt; #include &lt;linux/kernel_stat.h&gt; #include &lt;linux/perf_counter.h&gt; +#include &lt;linux/mm.h&gt; +#include &lt;linux/vmstat.h&gt; /* * Each CPU has a list of per CPU counters: include linux/mm.h inserted after linux/perf_counter.h </pre> checkpatch: perf_counters: allow users to count user, kernel and/or hypervisor events <pre>commit 0475f9ea8e2cc030298908949e0d5da9f2fc2cfe Author: Paul Mackerras &lt;paulus@samba.org&gt; Date: Wed Feb 11 14:35:35 2009 +1100 perf_counters: allow users to count user, kernel and/or hypervisor events Impact: new perf_counter feature This extends the perf_counter_hw_event struct with bits that specify that events in user, kernel and/or hypervisor mode should not be counted (i.e. should be excluded), and adds code to program the PMU mode selection bits accordingly on x86 and powerpc. For software counters, we don&#39;t currently have the infrastructure to distinguish which mode an event occurs in, so we currently fail the counter initialization if the setting of the hw_event.exclude_* bits would require us to distinguish. Context switches and CPU migrations are currently considered to occur in kernel mode. On x86, this changes the previous policy that only root can count kernel events. Now non-root users can count kernel events or exclude them. Non-root users still can&#39;t use NMI events, though. On x86 we don&#39;t appear to have any way to control whether hypervisor events are counted or not, so hw_event.exclude_hv is ignored. On powerpc, the selection of whether to count events in user, kernel and/or hypervisor mode is PMU-wide, not per-counter, so this adds a check that the hw_event.exclude_* settings are the same as other events on the PMU. Counters being added to a group have to have the same settings as the other hardware counters in the group. Counters and groups can only be enabled in hw_perf_group_sched_in or power_perf_enable if they have the same settings as any other counters already on the PMU. If we are not running on a hypervisor, the exclude_hv setting is ignored (by forcing it to 0) since we can&#39;t ever get any hypervisor events. Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt; </pre>---<pre>ERROR: trailing whitespace #139: FILE: arch/powerpc/kernel/perf_counter.c:616: +^I$ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #233: FILE: include/linux/perf_counter.h:86: + u32 disabled : 1, /* off by default */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #234: FILE: include/linux/perf_counter.h:87: + nmi : 1, /* NMI sampling */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #235: FILE: include/linux/perf_counter.h:88: + raw : 1, /* raw event type */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #236: FILE: include/linux/perf_counter.h:89: + inherit : 1, /* children inherit it */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #237: FILE: include/linux/perf_counter.h:90: + pinned : 1, /* must always be on PMU */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #238: FILE: include/linux/perf_counter.h:91: + exclusive : 1, /* only group on PMU */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #239: FILE: include/linux/perf_counter.h:92: + exclude_user : 1, /* don&#39;t count user */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #240: FILE: include/linux/perf_counter.h:93: + exclude_kernel : 1, /* ditto kernel */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #241: FILE: include/linux/perf_counter.h:94: + exclude_hv : 1, /* ditto hypervisor */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #243: FILE: include/linux/perf_counter.h:96: + __reserved_1 : 23; ^ total: 11 errors, 0 warnings, 233 lines checked </pre> badincludes: perf_counters: allow users to count user, kernel and/or hypervisor events <pre>commit 0475f9ea8e2cc030298908949e0d5da9f2fc2cfe Author: Paul Mackerras &lt;paulus@samba.org&gt; Date: Wed Feb 11 14:35:35 2009 +1100 perf_counters: allow users to count user, kernel and/or hypervisor events Impact: new perf_counter feature This extends the perf_counter_hw_event struct with bits that specify that events in user, kernel and/or hypervisor mode should not be counted (i.e. should be excluded), and adds code to program the PMU mode selection bits accordingly on x86 and powerpc. For software counters, we don&#39;t currently have the infrastructure to distinguish which mode an event occurs in, so we currently fail the counter initialization if the setting of the hw_event.exclude_* bits would require us to distinguish. Context switches and CPU migrations are currently considered to occur in kernel mode. On x86, this changes the previous policy that only root can count kernel events. Now non-root users can count kernel events or exclude them. Non-root users still can&#39;t use NMI events, though. On x86 we don&#39;t appear to have any way to control whether hypervisor events are counted or not, so hw_event.exclude_hv is ignored. On powerpc, the selection of whether to count events in user, kernel and/or hypervisor mode is PMU-wide, not per-counter, so this adds a check that the hw_event.exclude_* settings are the same as other events on the PMU. Counters being added to a group have to have the same settings as the other hardware counters in the group. Counters and groups can only be enabled in hw_perf_group_sched_in or power_perf_enable if they have the same settings as any other counters already on the PMU. If we are not running on a hypervisor, the exclude_hv setting is ignored (by forcing it to 0) since we can&#39;t ever get any hypervisor events. Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt; </pre>---<pre>diff --git a/arch/powerpc/kernel/perf_counter.c b/arch/powerpc/kernel/perf_counter.c index 5b02113..bd6ba85 100644 --- a/arch/powerpc/kernel/perf_counter.c +++ b/arch/powerpc/kernel/perf_counter.c @@ -16,6 +16,7 @@ #include &lt;asm/reg.h&gt; #include &lt;asm/pmc.h&gt; #include &lt;asm/machdep.h&gt; +#include &lt;asm/firmware.h&gt; struct cpu_hw_counters { int n_counters; include asm/firmware.h inserted after asm/machdep.h </pre> checkpatch: perfcounters/powerpc: Add support for POWER5 processors <pre>commit 742bd95ba96e19b3f7196c3a0834ebc17c8ba006 Author: Paul Mackerras &lt;paulus@samba.org&gt; Date: Tue Feb 24 11:33:56 2009 +1100 perfcounters/powerpc: Add support for POWER5 processors This adds the back-end for the PMU on the POWER5 processor. This knows how to use the fixed-function PMC5 and PMC6 (instructions completed and run cycles). Unlike POWER6, PMC5/6 obey the freeze conditions and can generate interrupts, so their use doesn&#39;t impose any extra restrictions. POWER5+ is different and is not supported by this patch. Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt; </pre>---<pre>WARNING: externs should be avoided in .c files #37: FILE: arch/powerpc/kernel/perf_counter.c:827: +extern struct power_pmu power5_pmu; ERROR: spaces required around that &#39;?&#39; (ctx:VxW) #235: FILE: arch/powerpc/kernel/power5-pmu.c:179: + fmask = (bit == 6)? 7: 3; ^ ERROR: spaces required around that &#39;:&#39; (ctx:VxW) #235: FILE: arch/powerpc/kernel/power5-pmu.c:179: + fmask = (bit == 6)? 7: 3; ^ WARNING: line over 80 characters #479: FILE: arch/powerpc/kernel/power5-pmu.c:423: + mmcr1 |= 1ull &lt;&lt; (MMCR1_PMC1_ADDER_SEL_SH - pmc); ERROR: trailing whitespace #516: FILE: arch/powerpc/kernel/power5-pmu.c:460: +^I[PERF_COUNT_BRANCH_INSTRUCTIONS] = 0x230e4,^I/* BR_ISSUED */ $ total: 3 errors, 2 warnings, 500 lines checked </pre> checkpatch: perfcounters: fix a few minor cleanliness issues <pre>commit f3dfd2656deb81a0addee4f4ceff66b50a387388 Author: Paul Mackerras &lt;paulus@samba.org&gt; Date: Thu Feb 26 22:43:46 2009 +1100 perfcounters: fix a few minor cleanliness issues This fixes three issues noticed by Arnd Bergmann: - Add #ifdef __KERNEL__ and move some things around in perf_counter.h to make sure only the bits that userspace needs are exported to userspace. - Use __u64, __s64, __u32 types in the structs exported to userspace rather than u64, s64, u32. - Make the sys_perf_counter_open syscall available to the SPUs on Cell platforms. And one issue that I noticed in looking at the code again: - Wrap the perf_counter_open syscall with SYSCALL_DEFINE4 so we get the proper handling of int arguments on ppc64 (and some other 64-bit architectures). Reported-by: Arnd Bergmann &lt;arnd@arndb.de&gt; Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt; </pre>---<pre>ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #77: FILE: include/linux/perf_counter.h:74: + __u32 disabled : 1, /* off by default */ ^ total: 1 errors, 0 warnings, 106 lines checked </pre> checkpatch: x86: AMD Support for perf_counter <pre>commit f87ad35d37fa543925210550f7db20a54c83ed70 Author: Jaswinder Singh Rajput &lt;jaswinderrajput@gmail.com&gt; Date: Fri Feb 27 20:15:14 2009 +0530 x86: AMD Support for perf_counter Supported basic performance counter for AMD K7 and later: $ perfstat -e 0,1,2,3,4,5,-1,-2,-3,-4,-5 ls &gt; /dev/null Performance counter stats for &#39;ls&#39;: 12.298610 task clock ticks (msecs) 3298477 CPU cycles (events) 1406354 instructions (events) 749035 cache references (events) 16939 cache misses (events) 100589 branches (events) 11159 branch misses (events) 7.627540 cpu clock ticks (msecs) 12.298610 task clock ticks (msecs) 500 pagefaults (events) 6 context switches (events) 3 CPU migrations (events) Wall-clock time elapsed: 8.672290 msecs Signed-off-by: Jaswinder Singh Rajput &lt;jaswinderrajput@gmail.com&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>WARNING: suspect code indent for conditional statements (8, 8) #145: FILE: arch/x86/kernel/cpu/perf_counter.c:456: + if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) { rdmsrl(MSR_CORE_PERF_GLOBAL_CTRL, ctrl); total: 0 errors, 1 warnings, 159 lines checked </pre> checkpatch: perfcounters: provide expansion room in the ABI <pre>commit 2743a5b0fa6f309da904f2190a9cc25deee34dbd Author: Paul Mackerras &lt;paulus@samba.org&gt; Date: Wed Mar 4 20:36:51 2009 +1100 perfcounters: provide expansion room in the ABI Impact: ABI change This expands several fields in the perf_counter_hw_event struct and adds a &quot;flags&quot; argument to the perf_counter_open system call, in order that features can be added in future without ABI changes. In particular the record_type field is expanded to 64 bits, and the space for flag bits has been expanded from 32 to 64 bits. This also adds some new fields: * read_format (64 bits) is intended to provide a way to specify what userspace wants to get back when it does a read() on a simple (non-interrupting) counter; * exclude_idle (1 bit) provides a way for userspace to ask that events that occur when the cpu is idle be excluded; * extra_config_len will provide a way for userspace to supply an arbitrary amount of extra machine-specific PMU configuration data immediately following the perf_counter_hw_event struct, to allow sophisticated users to program things such as instruction matching CAMs and address range registers; * __reserved_3 and __reserved_4 provide space for future expansion. Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt; </pre>---<pre>ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #47: FILE: include/linux/perf_counter.h:75: + __u64 disabled : 1, /* off by default */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #55: FILE: include/linux/perf_counter.h:84: + exclude_idle : 1, /* don&#39;t count when idle */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #58: FILE: include/linux/perf_counter.h:86: + __reserved_1 : 55; ^ total: 3 errors, 0 warnings, 63 lines checked </pre> checkpatch: perfcounters: fix reserved bits sizing <pre>commit 2485e5184452ccbda34ff83883883d9107800dff Author: Ingo Molnar &lt;mingo@elte.hu&gt; Date: Thu Mar 5 12:33:16 2009 +0100 perfcounters: fix reserved bits sizing The sum of bits is 65 currently not 64 - so reduce the # of reserved bits from 55 to 54. Cc: Paul Mackerras &lt;paulus@samba.org&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #21: FILE: include/linux/perf_counter.h:86: + __reserved_1 : 54; ^ total: 1 errors, 0 warnings, 8 lines checked </pre> checkpatch: perfcounters/powerpc: add support for POWER5+ processors <pre>commit aabbaa6036fd847c583f585c6bae82b5a033e6c7 Author: Paul Mackerras &lt;paulus@samba.org&gt; Date: Fri Mar 6 16:27:10 2009 +1100 perfcounters/powerpc: add support for POWER5+ processors Impact: more hardware support This adds the back-end for the PMU on the POWER5+ processors (i.e. GS, including GS DD3 aka POWER5++). This doesn&#39;t use the fixed-function PMC5 and PMC6 since they don&#39;t respect the freeze conditions and don&#39;t generate interrupts, as on POWER6. Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt; </pre>---<pre>WARNING: externs should be avoided in .c files #38: FILE: arch/powerpc/kernel/perf_counter.c:829: +extern struct power_pmu power5p_pmu; ERROR: spaces required around that &#39;?&#39; (ctx:VxW) #227: FILE: arch/powerpc/kernel/power5+-pmu.c:170: + fmask = (bit == 6)? 7: 3; ^ ERROR: spaces required around that &#39;:&#39; (ctx:VxW) #227: FILE: arch/powerpc/kernel/power5+-pmu.c:170: + fmask = (bit == 6)? 7: 3; ^ WARNING: line over 80 characters #457: FILE: arch/powerpc/kernel/power5+-pmu.c:400: + mmcr1 |= 1ull &lt;&lt; (MMCR1_PMC1_ADDER_SEL_SH - pmc); ERROR: trailing whitespace #494: FILE: arch/powerpc/kernel/power5+-pmu.c:437: +^I[PERF_COUNT_BRANCH_INSTRUCTIONS] = 0x230e4,^I/* BR_ISSUED */ $ total: 3 errors, 2 warnings, 478 lines checked </pre> checkpatch: perfcounters/powerpc: add support for POWER4 processors <pre>commit 880860e392d92c457e8116cdee39ec4d109174ee Author: Paul Mackerras &lt;paulus@samba.org&gt; Date: Fri Mar 6 16:30:52 2009 +1100 perfcounters/powerpc: add support for POWER4 processors Impact: more hardware support This adds the back-end for the PMU on the POWER4 and POWER4+ processors (GP and GQ). This is quite similar to the PPC970, with 8 PMCs, but has fewer events than the PPC970. Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt; </pre>---<pre>WARNING: externs should be avoided in .c files #35: FILE: arch/powerpc/kernel/perf_counter.c:827: +extern struct power_pmu power4_pmu; ERROR: spaces required around that &#39;?&#39; (ctx:VxW) #282: FILE: arch/powerpc/kernel/power4-pmu.c:227: + bit = (pmc &lt;= 4)? pmc - 1: 8 - pmc; ^ ERROR: spaces required around that &#39;:&#39; (ctx:VxW) #282: FILE: arch/powerpc/kernel/power4-pmu.c:227: + bit = (pmc &lt;= 4)? pmc - 1: 8 - pmc; ^ total: 2 errors, 1 warnings, 582 lines checked </pre> checkpatch: x86, bts: cleanups <pre>commit e9a22d1fb94050b7d600019c32e6b672d539054b Author: Ingo Molnar &lt;mingo@elte.hu&gt; Date: Fri Mar 13 11:54:40 2009 +0100 x86, bts: cleanups Impact: cleanup, no code changed Cc: Markus Metzger &lt;markus.t.metzger@intel.com&gt; LKML-Reference: &lt;20090313104218.A30096@sedona.ch.intel.com&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: space prohibited after that open parenthesis &#39;(&#39; #83: FILE: arch/x86/kernel/ds.c:64: + ( ds_cfg.ctl[dsf_bts] | \ ERROR: space prohibited before that close parenthesis &#39;)&#39; #86: FILE: arch/x86/kernel/ds.c:67: + ds_cfg.ctl[dsf_bts_overflow] ) total: 2 errors, 0 warnings, 279 lines checked </pre> badincludes: x86, bts: cleanups <pre>commit e9a22d1fb94050b7d600019c32e6b672d539054b Author: Ingo Molnar &lt;mingo@elte.hu&gt; Date: Fri Mar 13 11:54:40 2009 +0100 x86, bts: cleanups Impact: cleanup, no code changed Cc: Markus Metzger &lt;markus.t.metzger@intel.com&gt; LKML-Reference: &lt;20090313104218.A30096@sedona.ch.intel.com&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>diff --git a/arch/x86/kernel/ds.c b/arch/x86/kernel/ds.c index d9cab71..7363e01 100644 --- a/arch/x86/kernel/ds.c +++ b/arch/x86/kernel/ds.c @@ -19,43 +19,52 @@ * Markus Metzger &lt;markus.t.metzger@intel.com&gt;, 2007-2009 */ - -#include &lt;asm/ds.h&gt; - -#include &lt;linux/errno.h&gt; +#include &lt;linux/kernel.h&gt; #include &lt;linux/string.h&gt; -#include &lt;linux/slab.h&gt; +#include &lt;linux/errno.h&gt; #include &lt;linux/sched.h&gt; +#include &lt;linux/slab.h&gt; #include &lt;linux/mm.h&gt; -#include &lt;linux/kernel.h&gt; + +#include &lt;asm/ds.h&gt; #include &quot;ds_selftest.h&quot; /* - * The configuration for a particular DS hardware implementation. + * The configuration for a particular DS hardware implementation: */ struct ds_configuration { - /* The name of the configuration. */ - const char *name; - /* The size of pointer-typed fields in DS, BTS, and PEBS. */ - unsigned char sizeof_ptr_field; - /* The size of a BTS/PEBS record in bytes. */ - unsigned char sizeof_rec[2]; - /* Control bit-masks indexed by enum ds_feature. */ - unsigned long ctl[dsf_ctl_max]; + /* The name of the configuration: */ + const char *name; + + /* The size of pointer-typed fields in DS, BTS, and PEBS: */ + unsigned char sizeof_ptr_field; + + /* The size of a BTS/PEBS record in bytes: */ + unsigned char sizeof_rec[2]; + + /* Control bit-masks indexed by enum ds_feature: */ + unsigned long ctl[dsf_ctl_max]; }; static DEFINE_PER_CPU(struct ds_configuration, ds_cfg_array); #define ds_cfg per_cpu(ds_cfg_array, smp_processor_id()) -#define MAX_SIZEOF_DS (12 * 8) /* Maximal size of a DS configuration. */ -#define MAX_SIZEOF_BTS (3 * 8) /* Maximal size of a BTS record. */ -#define DS_ALIGNMENT (1 &lt;&lt; 3) /* BTS and PEBS buffer alignment. */ +/* Maximal size of a DS configuration: */ +#define MAX_SIZEOF_DS (12 * 8) -#define BTS_CONTROL \ - (ds_cfg.ctl[dsf_bts] | ds_cfg.ctl[dsf_bts_kernel] | ds_cfg.ctl[dsf_bts_user] |\ - ds_cfg.ctl[dsf_bts_overflow]) +/* Maximal size of a BTS record: */ +#define MAX_SIZEOF_BTS (3 * 8) +/* BTS and PEBS buffer alignment: */ +#define DS_ALIGNMENT (1 &lt;&lt; 3) + +/* Mask of control bits in the DS MSR register: */ +#define BTS_CONTROL \ + ( ds_cfg.ctl[dsf_bts] | \ + ds_cfg.ctl[dsf_bts_kernel] | \ + ds_cfg.ctl[dsf_bts_user] | \ + ds_cfg.ctl[dsf_bts_overflow] ) /* * A BTS or PEBS tracer. include asm/ds.h inserted after linux/mm.h </pre> coccinelle: tracing: add function profiler <pre>commit bac429f037f1a51a74d62bad6d1518c3be065df3 Author: Steven Rostedt &lt;srostedt@redhat.com&gt; Date: Fri Mar 20 12:50:56 2009 -0400 tracing: add function profiler Impact: new profiling feature This patch adds a function profiler. In debugfs/tracing/ two new files are created. function_profile_enabled - to enable or disable profiling trace_stat/functions - the profiled functions. For example: echo 1 &gt; /debugfs/tracing/function_profile_enabled ./hackbench 50 echo 0 &gt; /debugfs/tracing/function_profile_enabled yields: cat /debugfs/tracing/trace_stat/functions Function Hit -------- --- _spin_lock 10106442 _spin_unlock 10097492 kfree 6013704 _spin_unlock_irqrestore 4423941 _spin_lock_irqsave 4406825 __phys_addr 4181686 __slab_free 4038222 dput 4030130 path_put 4023387 unroll_tree_refs 4019532 [...] The most hit functions are listed first. Functions that are not hit are not listed. This feature depends on and uses dynamic function tracing. When the function profiling is disabled, no overhead occurs. But it still takes up around 300KB to hold the data, thus it is not recomended to keep it enabled for systems low on memory. When a &#39;1&#39; is echoed into the function_profile_enabled file, the counters for is function is reset back to zero. Thus you can see what functions are hit most by different programs. Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt; </pre>---<pre>rules/mut.cocci: // A mutex_lock is not matched by a mutex_unlock before an error return. // // Confidence: Moderate // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/mut.html // Options: -no_includes -include_headers diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 11f364c..53a3c8d 100644 --- a/tmp/6umA8AlPLf.c +++ b/tmp/48KWyxEtv4.c @@ -1248,9 +1248,11 @@ static void *t_start(struct seq_file *m, loff_t *pos) */ if (iter-&gt;flags &amp; FTRACE_ITER_FILTER &amp;&amp; !ftrace_filtered) { if (*pos &gt; 0) + mutex_unlock(&amp;ftrace_lock); return t_hash_start(m, pos); iter-&gt;flags |= FTRACE_ITER_PRINTALL; (*pos)++; + mutex_unlock(&amp;ftrace_lock); return iter; } </pre> coccinelle: tracing: move function profiler data out of function struct <pre>commit 493762fc534c71d11d489f872c4b4a2c61173668 Author: Steven Rostedt &lt;srostedt@redhat.com&gt; Date: Mon Mar 23 17:12:36 2009 -0400 tracing: move function profiler data out of function struct Impact: reduce size of memory in function profiler The function profiler originally introduces its counters into the function records itself. There is 20 thousand different functions on a normal system, and that is adding 20 thousand counters for profiling event when not needed. A normal run of the profiler yields only a couple of thousand functions executed, depending on what is being profiled. This means we have around 18 thousand useless counters. This patch rectifies this by moving the data out of the function records used by dynamic ftrace. Data is preallocated to hold the functions when the profiling begins. Checks are made during profiling to see if more recorcds should be allocated, and they are allocated if it is safe to do so. This also removes the dependency from using dynamic ftrace, and also removes the overhead by having it enabled. Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 24dac44..c5c208d 100644 --- a/tmp/XKOU2NYbyE.c +++ b/tmp/SwZKbRph7O.c @@ -407,7 +407,7 @@ static int ftrace_profile_init(void) size = FTRACE_PROFILE_HASH_SIZE; ftrace_profile_hash = - kzalloc(sizeof(struct hlist_head) * size, GFP_KERNEL); + kcalloc(size, sizeof(struct hlist_head), GFP_KERNEL); if (!ftrace_profile_hash) return -ENOMEM; rules/mut.cocci: // A mutex_lock is not matched by a mutex_unlock before an error return. // // Confidence: Moderate // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/mut.html // Options: -no_includes -include_headers diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 24dac44..9c7d814 100644 --- a/tmp/XKOU2NYbyE.c +++ b/tmp/XtA1YmpeTF.c @@ -1329,9 +1329,11 @@ static void *t_start(struct seq_file *m, loff_t *pos) */ if (iter-&gt;flags &amp; FTRACE_ITER_FILTER &amp;&amp; !ftrace_filtered) { if (*pos &gt; 0) + mutex_unlock(&amp;ftrace_lock); return t_hash_start(m, pos); iter-&gt;flags |= FTRACE_ITER_PRINTALL; (*pos)++; + mutex_unlock(&amp;ftrace_lock); return iter; } </pre> coccinelle: tracing: adding function timings to function profiler <pre>commit 0706f1c48ca8a7ab478090b4e38f2e578ae2bfe0 Author: Steven Rostedt &lt;srostedt@redhat.com&gt; Date: Mon Mar 23 23:12:58 2009 -0400 tracing: adding function timings to function profiler If the function graph trace is enabled, the function profiler will use it to take the timing of the functions. cat /debug/tracing/trace_stat/functions Function Hit Time -------- --- ---- mwait_idle 127 183028.4 us schedule 26 151997.7 us __schedule 31 151975.1 us sys_wait4 2 74080.53 us do_wait 2 74077.80 us sys_newlstat 138 39929.16 us do_path_lookup 179 39845.79 us vfs_lstat_fd 138 39761.97 us user_path_at 153 39469.58 us path_walk 179 39435.76 us __link_path_walk 189 39143.73 us [...] Note the times are skewed due to the function graph tracer not taking into account schedules. Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index a9ccd71..0496238 100644 --- a/tmp/54GKgHBXT2.c +++ b/tmp/LpJiVUU03s.c @@ -447,7 +447,7 @@ static int ftrace_profile_init(void) size = FTRACE_PROFILE_HASH_SIZE; ftrace_profile_hash = - kzalloc(sizeof(struct hlist_head) * size, GFP_KERNEL); + kcalloc(size, sizeof(struct hlist_head), GFP_KERNEL); if (!ftrace_profile_hash) return -ENOMEM; rules/mut.cocci: // A mutex_lock is not matched by a mutex_unlock before an error return. // // Confidence: Moderate // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/mut.html // Options: -no_includes -include_headers diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index a9ccd71..cdc4c99 100644 --- a/tmp/54GKgHBXT2.c +++ b/tmp/DqHwitgivJ.c @@ -1414,9 +1414,11 @@ static void *t_start(struct seq_file *m, loff_t *pos) */ if (iter-&gt;flags &amp; FTRACE_ITER_FILTER &amp;&amp; !ftrace_filtered) { if (*pos &gt; 0) + mutex_unlock(&amp;ftrace_lock); return t_hash_start(m, pos); iter-&gt;flags |= FTRACE_ITER_PRINTALL; (*pos)++; + mutex_unlock(&amp;ftrace_lock); return iter; } </pre> coccinelle: tracing: make the function profiler per cpu <pre>commit cafb168a1c92e4c9e1731fe3d666c39611762c49 Author: Steven Rostedt &lt;srostedt@redhat.com&gt; Date: Tue Mar 24 20:50:39 2009 -0400 tracing: make the function profiler per cpu Impact: speed enhancement By making the function profiler record in per cpu data we not only get better readings, avoid races, we also do not have to take any locks. Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index ed1fc50..db6c239 100644 --- a/tmp/L71togllVP.c +++ b/tmp/LVSrFLxibm.c @@ -446,7 +446,7 @@ static int ftrace_profile_init_cpu(int cpu) */ size = FTRACE_PROFILE_HASH_SIZE; - stat-&gt;hash = kzalloc(sizeof(struct hlist_head) * size, GFP_KERNEL); + stat-&gt;hash = kcalloc(size, sizeof(struct hlist_head), GFP_KERNEL); if (!stat-&gt;hash) return -ENOMEM; rules/mut.cocci: // A mutex_lock is not matched by a mutex_unlock before an error return. // // Confidence: Moderate // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/mut.html // Options: -no_includes -include_headers diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index ed1fc50..407c6fc 100644 --- a/tmp/L71togllVP.c +++ b/tmp/L7QOXGYKUl.c @@ -1475,9 +1475,11 @@ static void *t_start(struct seq_file *m, loff_t *pos) */ if (iter-&gt;flags &amp; FTRACE_ITER_FILTER &amp;&amp; !ftrace_filtered) { if (*pos &gt; 0) + mutex_unlock(&amp;ftrace_lock); return t_hash_start(m, pos); iter-&gt;flags |= FTRACE_ITER_PRINTALL; (*pos)++; + mutex_unlock(&amp;ftrace_lock); return iter; } </pre> coccinelle: function-graph: add option to calculate graph time or not <pre>commit a2a16d6a3156ef7309ca7328a20c35df9418e670 Author: Steven Rostedt &lt;srostedt@redhat.com&gt; Date: Tue Mar 24 23:17:58 2009 -0400 function-graph: add option to calculate graph time or not graph time is the time that a function is executing another function. Thus if function A calls B, if graph-time is set, then the time for A includes B. This is the default behavior. But if graph-time is off, then the time spent executing B is subtracted from A. Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 71e5fae..4e1dcb0 100644 --- a/tmp/L9KaiiWCh2.c +++ b/tmp/1tP7qFP3Gk.c @@ -446,7 +446,7 @@ static int ftrace_profile_init_cpu(int cpu) */ size = FTRACE_PROFILE_HASH_SIZE; - stat-&gt;hash = kzalloc(sizeof(struct hlist_head) * size, GFP_KERNEL); + stat-&gt;hash = kcalloc(size, sizeof(struct hlist_head), GFP_KERNEL); if (!stat-&gt;hash) return -ENOMEM; rules/mut.cocci: // A mutex_lock is not matched by a mutex_unlock before an error return. // // Confidence: Moderate // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/mut.html // Options: -no_includes -include_headers diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 71e5fae..53643cb 100644 --- a/tmp/L9KaiiWCh2.c +++ b/tmp/ooSYv0n2FS.c @@ -1494,9 +1494,11 @@ static void *t_start(struct seq_file *m, loff_t *pos) */ if (iter-&gt;flags &amp; FTRACE_ITER_FILTER &amp;&amp; !ftrace_filtered) { if (*pos &gt; 0) + mutex_unlock(&amp;ftrace_lock); return t_hash_start(m, pos); iter-&gt;flags |= FTRACE_ITER_PRINTALL; (*pos)++; + mutex_unlock(&amp;ftrace_lock); return iter; } </pre> coccinelle: tracing: clean up tracing profiler <pre>commit fb9fb015e92123fa3a8e0c2e2fff491d4a56b470 Author: Steven Rostedt &lt;srostedt@redhat.com&gt; Date: Wed Mar 25 13:26:41 2009 -0400 tracing: clean up tracing profiler Ingo Molnar suggested clean ups for the profiling code. This patch makes those updates. Reported-by: Ingo Molnar &lt;mingo@elte.hu&gt; Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index a141d84..a4b68a7 100644 --- a/tmp/usufWiddRI.c +++ b/tmp/ddC40qj6Do.c @@ -448,7 +448,7 @@ static int ftrace_profile_init_cpu(int cpu) */ size = FTRACE_PROFILE_HASH_SIZE; - stat-&gt;hash = kzalloc(sizeof(struct hlist_head) * size, GFP_KERNEL); + stat-&gt;hash = kcalloc(size, sizeof(struct hlist_head), GFP_KERNEL); if (!stat-&gt;hash) return -ENOMEM; rules/mut.cocci: // A mutex_lock is not matched by a mutex_unlock before an error return. // // Confidence: Moderate // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/mut.html // Options: -no_includes -include_headers diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index a141d84..1f5837c 100644 --- a/tmp/usufWiddRI.c +++ b/tmp/SgAZbwmrfw.c @@ -1496,9 +1496,11 @@ static void *t_start(struct seq_file *m, loff_t *pos) */ if (iter-&gt;flags &amp; FTRACE_ITER_FILTER &amp;&amp; !ftrace_filtered) { if (*pos &gt; 0) + mutex_unlock(&amp;ftrace_lock); return t_hash_start(m, pos); iter-&gt;flags |= FTRACE_ITER_PRINTALL; (*pos)++; + mutex_unlock(&amp;ftrace_lock); return iter; } </pre> coccinelle: tracing: remove on the fly allocator from function profiler <pre>commit 318e0a73c9e41b9a17241829bcd0605a39b87cb9 Author: Steven Rostedt &lt;srostedt@redhat.com&gt; Date: Wed Mar 25 20:06:34 2009 -0400 tracing: remove on the fly allocator from function profiler Impact: safer code The on the fly allocator for the function profiler was to save memory. But at the expense of stability. Although it survived several tests, allocating from the function tracer is just too risky, just to save space. This patch removes the allocator and simply allocates enough entries at start up. Each function gets a profiling structure of 40 bytes. With an average of 20K functions, and this is for each CPU, we have 800K per online CPU. This is not too bad, at least for non-embedded. Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 4d90c91..ae7f356 100644 --- a/tmp/UswnHAKMmD.c +++ b/tmp/TXrcncocMp.c @@ -474,7 +474,7 @@ static int ftrace_profile_init_cpu(int cpu) */ size = FTRACE_PROFILE_HASH_SIZE; - stat-&gt;hash = kzalloc(sizeof(struct hlist_head) * size, GFP_KERNEL); + stat-&gt;hash = kcalloc(size, sizeof(struct hlist_head), GFP_KERNEL); if (!stat-&gt;hash) return -ENOMEM; rules/mut.cocci: // A mutex_lock is not matched by a mutex_unlock before an error return. // // Confidence: Moderate // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/mut.html // Options: -no_includes -include_headers diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 4d90c91..49f0035 100644 --- a/tmp/UswnHAKMmD.c +++ b/tmp/1szsFyyCXW.c @@ -1506,9 +1506,11 @@ static void *t_start(struct seq_file *m, loff_t *pos) */ if (iter-&gt;flags &amp; FTRACE_ITER_FILTER &amp;&amp; !ftrace_filtered) { if (*pos &gt; 0) + mutex_unlock(&amp;ftrace_lock); return t_hash_start(m, pos); iter-&gt;flags |= FTRACE_ITER_PRINTALL; (*pos)++; + mutex_unlock(&amp;ftrace_lock); return iter; } </pre> coccinelle: tracing: add average time in function to function profiler <pre>commit 34886c8bc590f078d4c0b88f50d061326639198d Author: Steven Rostedt &lt;srostedt@redhat.com&gt; Date: Wed Mar 25 21:00:47 2009 -0400 tracing: add average time in function to function profiler Show the average time in the function (Time / Hit) Function Hit Time Avg -------- --- ---- --- mwait_idle 51 140326.6 us 2751.503 us smp_apic_timer_interrupt 47 3517.735 us 74.845 us schedule 10 2738.754 us 273.875 us __schedule 10 2732.857 us 273.285 us hrtimer_interrupt 47 1896.104 us 40.342 us irq_exit 56 1711.833 us 30.568 us __run_hrtimer 47 1315.589 us 27.991 us tick_sched_timer 47 1138.690 us 24.227 us do_softirq 56 1116.829 us 19.943 us __do_softirq 56 1066.932 us 19.052 us do_IRQ 9 926.153 us 102.905 us Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index c7f4a4b..2a13b8a 100644 --- a/tmp/sW87sLSVQI.c +++ b/tmp/VapcrQ9nYb.c @@ -481,7 +481,7 @@ static int ftrace_profile_init_cpu(int cpu) */ size = FTRACE_PROFILE_HASH_SIZE; - stat-&gt;hash = kzalloc(sizeof(struct hlist_head) * size, GFP_KERNEL); + stat-&gt;hash = kcalloc(size, sizeof(struct hlist_head), GFP_KERNEL); if (!stat-&gt;hash) return -ENOMEM; rules/mut.cocci: // A mutex_lock is not matched by a mutex_unlock before an error return. // // Confidence: Moderate // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/mut.html // Options: -no_includes -include_headers diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index c7f4a4b..7ea7ff9 100644 --- a/tmp/sW87sLSVQI.c +++ b/tmp/y3ZxeTpN9G.c @@ -1513,9 +1513,11 @@ static void *t_start(struct seq_file *m, loff_t *pos) */ if (iter-&gt;flags &amp; FTRACE_ITER_FILTER &amp;&amp; !ftrace_filtered) { if (*pos &gt; 0) + mutex_unlock(&amp;ftrace_lock); return t_hash_start(m, pos); iter-&gt;flags |= FTRACE_ITER_PRINTALL; (*pos)++; + mutex_unlock(&amp;ftrace_lock); return iter; } </pre> coccinelle: x86/paravirt: flush pending mmu updates on context switch <pre>commit b407fc57b815b2016186220baabc76cc8264206e Author: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt; Date: Tue Feb 17 23:46:21 2009 -0800 x86/paravirt: flush pending mmu updates on context switch Impact: allow preemption during lazy mmu updates If we&#39;re in lazy mmu mode when context switching, leave lazy mmu mode, but remember the task&#39;s state in TIF_LAZY_MMU_UPDATES. When we resume the task, check this flag and re-enter lazy mmu mode if its set. This sets things up for allowing lazy mmu mode while preemptible, though that won&#39;t actually be active until the next change. Signed-off-by: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt; Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; </pre>---<pre>rules/round.cocci: // roundup and DIV_ROUND_UP are more readable than the expanded calculations // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/round.html // Options: -no_includes -include_headers diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index f586e63..b2ae09f 100644 --- a/tmp/jb2wVm34U6.c +++ b/tmp/khsA5XMIrV.c @@ -287,7 +287,7 @@ static void xen_load_gdt(const struct desc_ptr *dtr) unsigned long *frames; unsigned long va = dtr-&gt;address; unsigned int size = dtr-&gt;size + 1; - unsigned pages = (size + PAGE_SIZE - 1) / PAGE_SIZE; + unsigned pages = DIV_ROUND_UP(size, PAGE_SIZE); int f; struct multicall_space mcs; </pre> checkpatch: x86/paravirt: finish change from lazy cpu to context switch start/end <pre>commit 224101ed69d3fbb486868e0f6e0f9fa37302efb4 Author: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt; Date: Wed Feb 18 11:18:57 2009 -0800 x86/paravirt: finish change from lazy cpu to context switch start/end Impact: fix lazy context switch API Pass the previous and next tasks into the context switch start end calls, so that the called functions can properly access the task state (esp in end_context_switch, in which the next task is not yet completely current). Signed-off-by: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt; Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; </pre>---<pre>ERROR: space required before the open parenthesis &#39;(&#39; #74: FILE: arch/x86/include/asm/pgtable.h:86: +#define arch_end_context_switch(prev) do {} while(0) WARNING: line over 80 characters #93: FILE: arch/x86/kernel/paravirt.c:277: + set_ti_thread_flag(task_thread_info(prev), TIF_LAZY_MMU_UPDATES); WARNING: line over 80 characters #104: FILE: arch/x86/kernel/paravirt.c:286: + if (test_and_clear_ti_thread_flag(task_thread_info(next), TIF_LAZY_MMU_UPDATES)) total: 1 errors, 2 warnings, 204 lines checked </pre> coccinelle: x86/paravirt: finish change from lazy cpu to context switch start/end <pre>commit 224101ed69d3fbb486868e0f6e0f9fa37302efb4 Author: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt; Date: Wed Feb 18 11:18:57 2009 -0800 x86/paravirt: finish change from lazy cpu to context switch start/end Impact: fix lazy context switch API Pass the previous and next tasks into the context switch start end calls, so that the called functions can properly access the task state (esp in end_context_switch, in which the next task is not yet completely current). Signed-off-by: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt; Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; </pre>---<pre>rules/round.cocci: // roundup and DIV_ROUND_UP are more readable than the expanded calculations // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/round.html // Options: -no_includes -include_headers diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 70b355d..4d64124 100644 --- a/tmp/OMD3lzoHU5.c +++ b/tmp/LBgnlqcvem.c @@ -287,7 +287,7 @@ static void xen_load_gdt(const struct desc_ptr *dtr) unsigned long *frames; unsigned long va = dtr-&gt;address; unsigned int size = dtr-&gt;size + 1; - unsigned pages = (size + PAGE_SIZE - 1) / PAGE_SIZE; + unsigned pages = DIV_ROUND_UP(size, PAGE_SIZE); int f; struct multicall_space mcs; </pre> coccinelle: xen: clean up xen_load_gdt <pre>commit 6ed6bf428aff64fe37cdc54b239d598fee6016f1 Author: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt; Date: Wed Mar 4 13:02:18 2009 -0800 xen: clean up xen_load_gdt Makes the logic a bit clearer. Signed-off-by: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt; </pre>---<pre>rules/round.cocci: // roundup and DIV_ROUND_UP are more readable than the expanded calculations // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/round.html // Options: -no_includes -include_headers diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 5776dc2..d539f26 100644 --- a/tmp/uoGfmgwJq4.c +++ b/tmp/9eDldWlMXb.c @@ -287,7 +287,7 @@ static void xen_load_gdt(const struct desc_ptr *dtr) unsigned long *frames; unsigned long va = dtr-&gt;address; unsigned int size = dtr-&gt;size + 1; - unsigned pages = (size + PAGE_SIZE - 1) / PAGE_SIZE; + unsigned pages = DIV_ROUND_UP(size, PAGE_SIZE); int f; struct multicall_space mcs; </pre> checkpatch: xen: make xen_load_gdt simpler <pre>commit 3ce5fa7ebff74b6a4dc5fdcdc22e6979f5a4ff85 Author: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt; Date: Wed Mar 4 15:26:00 2009 -0800 xen: make xen_load_gdt simpler Remove use of multicall machinery which is unused (gdt loading is never performance critical). This removes the implicit use of percpu variables, which simplifies understanding how the percpu code&#39;s use of load_gdt interacts with this code. Signed-off-by: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt; </pre>---<pre>WARNING: printk() should include KERN_ facility level #45: FILE: arch/x86/xen/enlighten.c:313: + printk(&quot;xen_load_gdt: %d va=%p mfn=%lx pfn=%lx va&#39;=%p\n&quot;, total: 0 errors, 1 warnings, 40 lines checked </pre> coccinelle: xen: make xen_load_gdt simpler <pre>commit 3ce5fa7ebff74b6a4dc5fdcdc22e6979f5a4ff85 Author: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt; Date: Wed Mar 4 15:26:00 2009 -0800 xen: make xen_load_gdt simpler Remove use of multicall machinery which is unused (gdt loading is never performance critical). This removes the implicit use of percpu variables, which simplifies understanding how the percpu code&#39;s use of load_gdt interacts with this code. Signed-off-by: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt; </pre>---<pre>rules/round.cocci: // roundup and DIV_ROUND_UP are more readable than the expanded calculations // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/round.html // Options: -no_includes -include_headers diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 48b399b..126f4ed 100644 --- a/tmp/GvatenjRxp.c +++ b/tmp/NfEuixMG7j.c @@ -286,7 +286,7 @@ static void xen_load_gdt(const struct desc_ptr *dtr) { unsigned long va = dtr-&gt;address; unsigned int size = dtr-&gt;size + 1; - unsigned pages = (size + PAGE_SIZE - 1) / PAGE_SIZE; + unsigned pages = DIV_ROUND_UP(size, PAGE_SIZE); unsigned long frames[pages]; int f; </pre> coccinelle: xen: remove xen_load_gdt debug <pre>commit b4b7e58590d0e94ed78bd6be1aa163caba7b6c74 Author: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt; Date: Wed Mar 4 16:34:27 2009 -0800 xen: remove xen_load_gdt debug Don&#39;t need the noise. Signed-off-by: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt; </pre>---<pre>rules/round.cocci: // roundup and DIV_ROUND_UP are more readable than the expanded calculations // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/round.html // Options: -no_includes -include_headers diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 75b7a0f..45cd69c 100644 --- a/tmp/CbdmDvxPvw.c +++ b/tmp/RN7d1bwjWZ.c @@ -286,7 +286,7 @@ static void xen_load_gdt(const struct desc_ptr *dtr) { unsigned long va = dtr-&gt;address; unsigned int size = dtr-&gt;size + 1; - unsigned pages = (size + PAGE_SIZE - 1) / PAGE_SIZE; + unsigned pages = DIV_ROUND_UP(size, PAGE_SIZE); unsigned long frames[pages]; int f; </pre> checkpatch: xen: mask XSAVE from cpuid <pre>commit e826fe1ba1563a9272345da8e3279a930ac160a7 Author: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt; Date: Sat Mar 7 17:09:27 2009 -0800 xen: mask XSAVE from cpuid Xen leaves XSAVE set in cpuid, but doesn&#39;t allow cr4.OSXSAVE to be set. This confuses the kernel and it ends up crashing on an xsetbv instruction. At boot time, try to set cr4.OSXSAVE, and mask XSAVE out of cpuid it we can&#39;t. This will produce a spurious error from Xen, but allows us to support XSAVE if/when Xen does. This also factors out the cpuid mask decisions to boot time. Signed-off-by: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt; </pre>---<pre>ERROR: trailing whitespace #83: FILE: arch/x86/xen/enlighten.c:222: +^I^I$ WARNING: line over 80 characters #87: FILE: arch/x86/xen/enlighten.c:226: + cpuid_leaf1_ecx_mask &amp;= ~(1 &lt;&lt; (X86_FEATURE_XSAVE % 32)); total: 1 errors, 1 warnings, 80 lines checked </pre> coccinelle: xen: mask XSAVE from cpuid <pre>commit e826fe1ba1563a9272345da8e3279a930ac160a7 Author: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt; Date: Sat Mar 7 17:09:27 2009 -0800 xen: mask XSAVE from cpuid Xen leaves XSAVE set in cpuid, but doesn&#39;t allow cr4.OSXSAVE to be set. This confuses the kernel and it ends up crashing on an xsetbv instruction. At boot time, try to set cr4.OSXSAVE, and mask XSAVE out of cpuid it we can&#39;t. This will produce a spurious error from Xen, but allows us to support XSAVE if/when Xen does. This also factors out the cpuid mask decisions to boot time. Signed-off-by: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt; </pre>---<pre>rules/round.cocci: // roundup and DIV_ROUND_UP are more readable than the expanded calculations // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/round.html // Options: -no_includes -include_headers diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index da33e0c..87ed2a6 100644 --- a/tmp/P4tvrIMjDZ.c +++ b/tmp/zlA3IUORo3.c @@ -322,7 +322,7 @@ static void xen_load_gdt(const struct desc_ptr *dtr) { unsigned long va = dtr-&gt;address; unsigned int size = dtr-&gt;size + 1; - unsigned pages = (size + PAGE_SIZE - 1) / PAGE_SIZE; + unsigned pages = DIV_ROUND_UP(size, PAGE_SIZE); unsigned long frames[pages]; int f; </pre> coccinelle: xen: set _PAGE_NX in __supported_pte_mask before pagetable construction <pre>commit 707ebbc81c61eb480d8a51ca61e355e240df1d32 Author: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt; Date: Fri Mar 27 11:29:02 2009 -0700 xen: set _PAGE_NX in __supported_pte_mask before pagetable construction Some 64-bit machines don&#39;t support the NX flag in ptes. Check for NX before constructing the kernel pagetables. Signed-off-by: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt; </pre>---<pre>rules/round.cocci: // roundup and DIV_ROUND_UP are more readable than the expanded calculations // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/round.html // Options: -no_includes -include_headers diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 80f4c53..2ecd0d2 100644 --- a/tmp/DhP5OTVsVE.c +++ b/tmp/n1cuW6VcqX.c @@ -323,7 +323,7 @@ static void xen_load_gdt(const struct desc_ptr *dtr) { unsigned long va = dtr-&gt;address; unsigned int size = dtr-&gt;size + 1; - unsigned pages = (size + PAGE_SIZE - 1) / PAGE_SIZE; + unsigned pages = DIV_ROUND_UP(size, PAGE_SIZE); unsigned long frames[pages]; int f; </pre> coccinelle: xen: clean up gate trap/interrupt constants <pre>commit 6d02c42698f99eccb290ac53d4f10ca883b9f90c Author: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt; Date: Sun Mar 29 22:57:15 2009 -0700 xen: clean up gate trap/interrupt constants Use GATE_INTERRUPT/TRAP rather than 0xe/f. Signed-off-by: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt; </pre>---<pre>rules/round.cocci: // roundup and DIV_ROUND_UP are more readable than the expanded calculations // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/round.html // Options: -no_includes -include_headers diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 12a3159..da804f2 100644 --- a/tmp/ZMezwso4GI.c +++ b/tmp/Lap9sn1Qql.c @@ -323,7 +323,7 @@ static void xen_load_gdt(const struct desc_ptr *dtr) { unsigned long va = dtr-&gt;address; unsigned int size = dtr-&gt;size + 1; - unsigned pages = (size + PAGE_SIZE - 1) / PAGE_SIZE; + unsigned pages = DIV_ROUND_UP(size, PAGE_SIZE); unsigned long frames[pages]; int f; </pre> coccinelle: xen: add irq_from_evtchn <pre>commit d4c045364d3107603187f21a56ec231e74d26441 Author: Ian Campbell &lt;ian.campbell@citrix.com&gt; Date: Fri Feb 6 19:20:31 2009 -0800 xen: add irq_from_evtchn Given an evtchn, return the corresponding irq. Signed-off-by: Ian Campbell &lt;ian.campbell@citrix.com&gt; Signed-off-by: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt; </pre>---<pre>rules/bootmem.cocci: // alloc_bootmem and variants never return NULL and always zero the allocated // data // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/bootmem.html // Options: -no_includes -include_headers diff --git a/drivers/xen/events.c b/drivers/xen/events.c index 1cd2a0e..b361564 100644 --- a/tmp/BiM0AvSMgQ.c +++ b/tmp/5BisMFLB9m.c @@ -928,7 +928,6 @@ void __init xen_init_IRQ(void) size_t size = nr_cpu_ids * sizeof(struct cpu_evtchn_s); cpu_evtchn_mask_p = alloc_bootmem(size); - BUG_ON(cpu_evtchn_mask_p == NULL); init_evtchn_cpu_bindings(); </pre> checkpatch: xen: add /sys/hypervisor support <pre>commit cff7e81b3dd7c25cd2248cd7a04c5764552d5d55 Author: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt; Date: Tue Mar 10 14:39:59 2009 -0700 xen: add /sys/hypervisor support Adds support for Xen info under /sys/hypervisor. Taken from Novell 2.6.27 backport tree. Signed-off-by: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt; </pre>---<pre>WARNING: externs should be avoided in .c files #166: FILE: drivers/xen/sys-hypervisor.c:119: + extern int xenstored_ready; WARNING: externs should be avoided in .c files #394: FILE: drivers/xen/sys-hypervisor.c:347: +extern size_t vmcoreinfo_size_xen; WARNING: externs should be avoided in .c files #395: FILE: drivers/xen/sys-hypervisor.c:348: +extern unsigned long paddr_vmcoreinfo_xen; total: 0 errors, 3 warnings, 502 lines checked </pre> checkpatch: Permissive domain in userspace object manager <pre>commit 8a6f83afd0c5355db6d11394a798e94950306239 Author: KaiGai Kohei &lt;kaigai@ak.jp.nec.com&gt; Date: Wed Apr 1 10:07:57 2009 +0900 Permissive domain in userspace object manager This patch enables applications to handle permissive domain correctly. Since the v2.6.26 kernel, SELinux has supported an idea of permissive domain which allows certain processes to work as if permissive mode, even if the global setting is enforcing mode. However, we don&#39;t have an application program interface to inform what domains are permissive one, and what domains are not. It means applications focuses on SELinux (XACE/SELinux, SE-PostgreSQL and so on) cannot handle permissive domain correctly. This patch add the sixth field (flags) on the reply of the /selinux/access interface which is used to make an access control decision from userspace. If the first bit of the flags field is positive, it means the required access control decision is on permissive domain, so application should allow any required actions, as the kernel doing. This patch also has a side benefit. The av_decision.flags is set at context_struct_compute_av(). It enables to check required permissions without read_lock(&amp;policy_rwlock). Signed-off-by: KaiGai Kohei &lt;kaigai@ak.jp.nec.com&gt; Acked-by: Stephen Smalley &lt;sds@tycho.nsa.gov&gt; Acked-by: Eric Paris &lt;eparis@redhat.com&gt; -- security/selinux/avc.c | 2 +- security/selinux/include/security.h | 4 +++- security/selinux/selinuxfs.c | 4 ++-- security/selinux/ss/services.c | 30 +++++------------------------- 4 files changed, 11 insertions(+), 29 deletions(-) Signed-off-by: James Morris &lt;jmorris@namei.org&gt; </pre>---<pre>WARNING: line over 80 characters #46: FILE: security/selinux/avc.c:930: + else if (!selinux_enforcing || (avd-&gt;flags &amp; AVD_FLAGS_PERMISSIVE)) WARNING: suspect code indent for conditional statements (8, 12) #134: FILE: security/selinux/ss/services.c:748: + if (ebitmap_get_bit(&amp;policydb.permissive_map, scontext-&gt;type)) + avd-&gt;flags |= AVD_FLAGS_PERMISSIVE; total: 0 errors, 2 warnings, 80 lines checked </pre> checkpatch: modules: sysctl to block module loading <pre>commit 3d43321b7015387cfebbe26436d0e9d299162ea1 Author: Kees Cook &lt;kees@ubuntu.com&gt; Date: Thu Apr 2 15:49:29 2009 -0700 modules: sysctl to block module loading Implement a sysctl file that disables module-loading system-wide since there is no longer a viable way to remove CAP_SYS_MODULE after the system bounding capability set was removed in 2.6.25. Value can only be set to &quot;1&quot;, and is tested only if standard capability checks allow CAP_SYS_MODULE. Given existing /dev/mem protections, this should allow administrators a one-way method to block module loading after initial boot-time module loading has finished. Signed-off-by: Kees Cook &lt;kees.cook@canonical.com&gt; Acked-by: Serge Hallyn &lt;serue@us.ibm.com&gt; Signed-off-by: James Morris &lt;jmorris@namei.org&gt; </pre>---<pre>ERROR: do not initialise externals to 0 or NULL #57: FILE: kernel/module.c:782: +int modules_disabled = 0; WARNING: externs should be avoided in .c files #88: FILE: kernel/sysctl.c:116: +extern int modules_disabled; total: 1 errors, 1 warnings, 72 lines checked </pre> coccinelle: modules: sysctl to block module loading <pre>commit 3d43321b7015387cfebbe26436d0e9d299162ea1 Author: Kees Cook &lt;kees@ubuntu.com&gt; Date: Thu Apr 2 15:49:29 2009 -0700 modules: sysctl to block module loading Implement a sysctl file that disables module-loading system-wide since there is no longer a viable way to remove CAP_SYS_MODULE after the system bounding capability set was removed in 2.6.25. Value can only be set to &quot;1&quot;, and is tested only if standard capability checks allow CAP_SYS_MODULE. Given existing /dev/mem protections, this should allow administrators a one-way method to block module loading after initial boot-time module loading has finished. Signed-off-by: Kees Cook &lt;kees.cook@canonical.com&gt; Acked-by: Serge Hallyn &lt;serue@us.ibm.com&gt; Signed-off-by: James Morris &lt;jmorris@namei.org&gt; </pre>---<pre>rules/bugon.cocci: // using BUG_ON implies that the if disappears when checking is not desired // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/bugon.html // Options: -no_includes -include_headers diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 2fb4246..a917a54 100644 --- a/tmp/PYupAxQQoz.c +++ b/tmp/VkS3Kpz1Jm.c @@ -1525,8 +1525,7 @@ void sysctl_head_put(struct ctl_table_header *head) struct ctl_table_header *sysctl_head_grab(struct ctl_table_header *head) { - if (!head) - BUG(); + BUG_ON(!head); spin_lock(&amp;sysctl_lock); if (!use_table(head)) head = ERR_PTR(-ENOENT); </pre> checkpatch: perf_counter: software counter event infrastructure <pre>commit 15dbf27cc18559a14e99609f78678aa86b9c6ff1 Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Date: Fri Mar 13 12:21:32 2009 +0100 perf_counter: software counter event infrastructure Provide generic software counter infrastructure that supports software events. This will be used to allow sample based profiling based on software events such as pagefaults. The current infrastructure can only provide a count of such events, no place information. Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>WARNING: line over 80 characters #32: FILE: include/linux/perf_counter.h:287: +extern void perf_swcounter_event(enum hw_event_types, u64, int, struct pt_regs *); WARNING: line over 80 characters #129: FILE: kernel/perf_counter.c:1400: + perf_swcounter_store_irq(sibling, atomic64_read(&amp;counter-&gt;count)); WARNING: line over 80 characters #214: FILE: kernel/perf_counter.c:1485: + perf_swcounter_ctx_event(cpuctx-&gt;task_ctx, event, nr, nmi, regs); total: 0 errors, 3 warnings, 273 lines checked </pre> badincludes: perf_counter: add an event_list <pre>commit 592903cdcbf606a838056bae6d03fc557806c914 Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Date: Fri Mar 13 12:21:36 2009 +0100 perf_counter: add an event_list I noticed that the counter_list only includes top-level counters, thus perf_swcounter_event() will miss sw-counters in groups. Since perf_swcounter_event() also wants an RCU safe list, create a new event_list that includes all counters and uses RCU list ops and use call_rcu to free the counter structure. Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c index f9330d5..8d6ecfa 100644 --- a/kernel/perf_counter.c +++ b/kernel/perf_counter.c @@ -22,6 +22,7 @@ #include &lt;linux/perf_counter.h&gt; #include &lt;linux/mm.h&gt; #include &lt;linux/vmstat.h&gt; +#include &lt;linux/rculist.h&gt; /* * Each CPU has a list of per CPU counters: include linux/rculist.h inserted after linux/vmstat.h </pre> badincludes: perf_counter: include missing header <pre>commit 4e193bd4dfdc983d12969b51439b4a1fbaf2daad Author: Tim Blechmann &lt;tim@klingt.org&gt; Date: Sat Mar 14 14:29:25 2009 +0100 perf_counter: include missing header Impact: build fix In order to compile a kernel with performance counter patches, &lt;asm/irq_regs.h&gt; has to be included to provide the declaration of struct pt_regs *get_irq_regs(void); [ This bug was masked by unrelated x86 header file changes in the x86 tree, but occurs in the tip:perfcounters/core standalone tree. ] Signed-off-by: Tim Blechmann &lt;tim@klingt.org&gt; Orig-LKML-Reference: &lt;20090314142925.49c29c17@thinkpad&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c index d6cc222..0018c5e 100644 --- a/kernel/perf_counter.c +++ b/kernel/perf_counter.c @@ -24,6 +24,8 @@ #include &lt;linux/vmstat.h&gt; #include &lt;linux/rculist.h&gt; +#include &lt;asm/irq_regs.h&gt; + /* * Each CPU has a list of per CPU counters: */ include asm/irq_regs.h inserted after linux/rculist.h </pre> checkpatch: perf_counter: hook up the tracepoint events <pre>commit e077df4f439681e43f0db8255b2d215b342ebdc6 Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Date: Thu Mar 19 20:26:17 2009 +0100 perf_counter: hook up the tracepoint events Impact: new perfcounters feature Enable usage of tracepoints as perf counter events. tracepoint event ids can be found in /debug/tracing/event/*/*/id and (for now) are represented as -65536+id in the type field. Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Cc: Paul Mackerras &lt;paulus@samba.org&gt; Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt; Orig-LKML-Reference: &lt;20090319194233.744044174@chello.nl&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>WARNING: externs should be avoided in .c files #81: FILE: kernel/perf_counter.c:1740: +extern int ftrace_profile_enable(int); WARNING: externs should be avoided in .c files #82: FILE: kernel/perf_counter.c:1741: +extern void ftrace_profile_disable(int); total: 0 errors, 2 warnings, 87 lines checked </pre> checkpatch: perf_counter: revamp syscall input ABI <pre>commit b8e83514b64577b48bfb794fe85fcde40a9343ca Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Date: Thu Mar 19 20:26:18 2009 +0100 perf_counter: revamp syscall input ABI Impact: modify ABI The hardware/software classification in hw_event-&gt;type became a little strained due to the addition of tracepoint tracing. Instead split up the field and provide a type field to explicitly specify the counter type, while using the event_id field to specify which event to use. Raw counters still work as before, only the raw config now goes into raw_event. Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Cc: Paul Mackerras &lt;paulus@samba.org&gt; Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt; Orig-LKML-Reference: &lt;20090319194233.836807573@chello.nl&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #183: FILE: include/linux/perf_counter.h:90: + __u64 event_id : 56, ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #184: FILE: include/linux/perf_counter.h:91: + type : 8; ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #187: FILE: include/linux/perf_counter.h:94: + __u64 raw_event_id : 63, ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #188: FILE: include/linux/perf_counter.h:95: + raw_type : 1; ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #208: FILE: include/linux/perf_counter.h:114: + __reserved_1 : 55; ^ WARNING: line over 80 characters #257: FILE: kernel/perf_counter.c:1418: + perf_swcounter_store_irq(sibling, counter-&gt;hw_event.event_config); ERROR: trailing statements should be on next line #411: FILE: kernel/perf_counter.c:1881: + else switch (hw_event-&gt;type) { total: 6 errors, 1 warnings, 367 lines checked </pre> checkpatch: perf_counter: fix type/event_id layout on big-endian systems <pre>commit 9aaa131a279834dff75c290c91f0058f62d72d46 Author: Paul Mackerras &lt;paulus@samba.org&gt; Date: Sat Mar 21 15:31:47 2009 +1100 perf_counter: fix type/event_id layout on big-endian systems Impact: build fix for powerpc Commit db3a944aca35ae61 (&quot;perf_counter: revamp syscall input ABI&quot;) expanded the hw_event.type field into a union of structs containing bitfields. In particular it introduced a type field and a raw_type field, with the intention that the 1-bit raw_type field should overlay the most-significant bit of the 8-bit type field, and in fact perf_counter_alloc() now assumes that (or at least, assumes that raw_type doesn&#39;t overlay any of the bits that are 1 in the values of PERF_TYPE_{HARDWARE,SOFTWARE,TRACEPOINT}). Unfortunately this is not true on big-endian systems such as PowerPC, where bitfields are laid out from left to right, i.e. from most significant bit to least significant. This means that setting hw_event.type = PERF_TYPE_SOFTWARE will set hw_event.raw_type to 1. This fixes it by making the layout depend on whether or not __BIG_ENDIAN_BITFIELD is defined. It&#39;s a bit ugly, but that&#39;s what we get for using bitfields in a user/kernel ABI. Also, that commit didn&#39;t fix up some places in arch/powerpc/kernel/ perf_counter.c where hw_event.raw and hw_event.event_id were used. This fixes them too. Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt; </pre>---<pre>ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #80: FILE: include/linux/perf_counter.h:101: + __u64 type : 8, ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #81: FILE: include/linux/perf_counter.h:102: + event_id : 56; ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #84: FILE: include/linux/perf_counter.h:105: + __u64 raw_type : 1, ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #85: FILE: include/linux/perf_counter.h:106: + raw_event_id : 63; ^ total: 4 errors, 0 warnings, 47 lines checked </pre> badincludes: perf_counter: fix type/event_id layout on big-endian systems <pre>commit 9aaa131a279834dff75c290c91f0058f62d72d46 Author: Paul Mackerras &lt;paulus@samba.org&gt; Date: Sat Mar 21 15:31:47 2009 +1100 perf_counter: fix type/event_id layout on big-endian systems Impact: build fix for powerpc Commit db3a944aca35ae61 (&quot;perf_counter: revamp syscall input ABI&quot;) expanded the hw_event.type field into a union of structs containing bitfields. In particular it introduced a type field and a raw_type field, with the intention that the 1-bit raw_type field should overlay the most-significant bit of the 8-bit type field, and in fact perf_counter_alloc() now assumes that (or at least, assumes that raw_type doesn&#39;t overlay any of the bits that are 1 in the values of PERF_TYPE_{HARDWARE,SOFTWARE,TRACEPOINT}). Unfortunately this is not true on big-endian systems such as PowerPC, where bitfields are laid out from left to right, i.e. from most significant bit to least significant. This means that setting hw_event.type = PERF_TYPE_SOFTWARE will set hw_event.raw_type to 1. This fixes it by making the layout depend on whether or not __BIG_ENDIAN_BITFIELD is defined. It&#39;s a bit ugly, but that&#39;s what we get for using bitfields in a user/kernel ABI. Also, that commit didn&#39;t fix up some places in arch/powerpc/kernel/ perf_counter.c where hw_event.raw and hw_event.event_id were used. This fixes them too. Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt; </pre>---<pre>diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h index a4b76c0..98f5990 100644 --- a/include/linux/perf_counter.h +++ b/include/linux/perf_counter.h @@ -15,6 +15,7 @@ #include &lt;linux/types.h&gt; #include &lt;linux/ioctl.h&gt; +#include &lt;asm/byteorder.h&gt; /* * User-space ABI bits: include asm/byteorder.h inserted after linux/ioctl.h </pre> checkpatch: perf_counter: add sample user-space to Documentation/perf_counter/ <pre>commit e0143bad9dbf2a8fad4c5430562bceba196b66ea Author: Ingo Molnar &lt;mingo@elte.hu&gt; Date: Mon Mar 23 21:29:59 2009 +0100 perf_counter: add sample user-space to Documentation/perf_counter/ Initial version of kerneltop.c and perfstat.c. Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Cc: Paul Mackerras &lt;paulus@samba.org&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: code indent should use tabs where possible #49: FILE: Documentation/perf_counter/kerneltop.c:14: + weight RIP kernel function$ ERROR: code indent should use tabs where possible #50: FILE: Documentation/perf_counter/kerneltop.c:15: + ______ ________________ _______________$ ERROR: code indent should use tabs where possible #52: FILE: Documentation/perf_counter/kerneltop.c:17: + 35.20 - ffffffff804ce74b : skb_copy_and_csum_dev$ ERROR: code indent should use tabs where possible #53: FILE: Documentation/perf_counter/kerneltop.c:18: + 33.00 - ffffffff804cb740 : sock_alloc_send_skb$ ERROR: code indent should use tabs where possible #54: FILE: Documentation/perf_counter/kerneltop.c:19: + 31.26 - ffffffff804ce808 : skb_push$ ERROR: code indent should use tabs where possible #55: FILE: Documentation/perf_counter/kerneltop.c:20: + 22.43 - ffffffff80510004 : tcp_established_options$ ERROR: code indent should use tabs where possible #56: FILE: Documentation/perf_counter/kerneltop.c:21: + 19.00 - ffffffff8027d250 : find_get_page$ ERROR: code indent should use tabs where possible #57: FILE: Documentation/perf_counter/kerneltop.c:22: + 15.76 - ffffffff804e4fc9 : eth_type_trans$ ERROR: code indent should use tabs where possible #58: FILE: Documentation/perf_counter/kerneltop.c:23: + 15.20 - ffffffff804d8baa : dst_release$ ERROR: code indent should use tabs where possible #59: FILE: Documentation/perf_counter/kerneltop.c:24: + 14.86 - ffffffff804cf5d8 : skb_release_head_state$ ERROR: code indent should use tabs where possible #60: FILE: Documentation/perf_counter/kerneltop.c:25: + 14.00 - ffffffff802217d5 : read_hpet$ ERROR: code indent should use tabs where possible #61: FILE: Documentation/perf_counter/kerneltop.c:26: + 12.00 - ffffffff804ffb7f : __ip_local_out$ ERROR: code indent should use tabs where possible #62: FILE: Documentation/perf_counter/kerneltop.c:27: + 11.97 - ffffffff804fc0c8 : ip_local_deliver_finish$ ERROR: code indent should use tabs where possible #63: FILE: Documentation/perf_counter/kerneltop.c:28: + 8.54 - ffffffff805001a3 : ip_queue_xmit$ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #177: FILE: Documentation/perf_counter/kerneltop.c:142: + __u64 disabled : 1, /* off by default */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #178: FILE: Documentation/perf_counter/kerneltop.c:143: + nmi : 1, /* NMI sampling */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #179: FILE: Documentation/perf_counter/kerneltop.c:144: + raw : 1, /* raw event type */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #180: FILE: Documentation/perf_counter/kerneltop.c:145: + inherit : 1, /* children inherit it */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #181: FILE: Documentation/perf_counter/kerneltop.c:146: + pinned : 1, /* must always be on PMU */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #182: FILE: Documentation/perf_counter/kerneltop.c:147: + exclusive : 1, /* only group on PMU */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #183: FILE: Documentation/perf_counter/kerneltop.c:148: + exclude_user : 1, /* don&#39;t count user */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #184: FILE: Documentation/perf_counter/kerneltop.c:149: + exclude_kernel : 1, /* ditto kernel */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #185: FILE: Documentation/perf_counter/kerneltop.c:150: + exclude_hv : 1, /* ditto hypervisor */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #186: FILE: Documentation/perf_counter/kerneltop.c:151: + exclude_idle : 1, /* don&#39;t count when idle */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #188: FILE: Documentation/perf_counter/kerneltop.c:153: + __reserved_1 : 54; ^ WARNING: line over 80 characters #214: FILE: Documentation/perf_counter/kerneltop.c:179: + __NR_perf_counter_open, hw_event_uptr, pid, cpu, group_fd, flags); ERROR: space prohibited before open square bracket &#39;[&#39; #224: FILE: Documentation/perf_counter/kerneltop.c:189: +const char *event_types [] = { ERROR: do not initialise statics to 0 or NULL #264: FILE: Documentation/perf_counter/kerneltop.c:229: +static int nr_cpus = 0; ERROR: do not initialise statics to 0 or NULL #266: FILE: Documentation/perf_counter/kerneltop.c:231: +static int group = 0; WARNING: line over 80 characters #290: FILE: Documentation/perf_counter/kerneltop.c:255: + &quot;KernelTop Options (up to %d event types can be specified at once):\n\n&quot;, WARNING: line over 80 characters #293: FILE: Documentation/perf_counter/kerneltop.c:258: + &quot; -e EID --event_id=EID # event type ID [default: 0]\n&quot; WARNING: line over 80 characters #301: FILE: Documentation/perf_counter/kerneltop.c:266: + &quot; rNNN: raw PMU events (eventsel+umask)\n\n&quot; WARNING: line over 80 characters #303: FILE: Documentation/perf_counter/kerneltop.c:268: + &quot; -C CPU --cpu=CPU # CPU (-1 for all) [default: -1]\n&quot; WARNING: line over 80 characters #304: FILE: Documentation/perf_counter/kerneltop.c:269: + &quot; -p PID --pid=PID # PID of sampled task (-1 for all) [default: -1]\n\n&quot; WARNING: line over 80 characters #305: FILE: Documentation/perf_counter/kerneltop.c:270: + &quot; -d delay --delay=&lt;seconds&gt; # sampling/display delay [default: 2]\n&quot; WARNING: line over 80 characters #306: FILE: Documentation/perf_counter/kerneltop.c:271: + &quot; -f CNT --filter=CNT # min-event-count filter [default: 100]\n\n&quot; WARNING: line over 80 characters #307: FILE: Documentation/perf_counter/kerneltop.c:272: + &quot; -s symbol --symbol=&lt;symbol&gt; # function to be showed annotated one-shot\n&quot; WARNING: line over 80 characters #308: FILE: Documentation/perf_counter/kerneltop.c:273: + &quot; -x path --vmlinux=&lt;path&gt; # the vmlinux binary, required for -s use:\n&quot; WARNING: line over 80 characters #310: FILE: Documentation/perf_counter/kerneltop.c:275: + &quot; -D --dump_symtab # dump symbol table to stderr on startup\n&quot; ERROR: trailing statements should be on next line #357: FILE: Documentation/perf_counter/kerneltop.c:322: + case &#39;d&#39;: delay_secs = atoi(optarg); break; ERROR: trailing statements should be on next line #358: FILE: Documentation/perf_counter/kerneltop.c:323: + case &#39;D&#39;: dump_symtab = 1; break; ERROR: trailing statements should be on next line #373: FILE: Documentation/perf_counter/kerneltop.c:338: + case &#39;f&#39;: count_filter = atoi(optarg); break; ERROR: trailing statements should be on next line #374: FILE: Documentation/perf_counter/kerneltop.c:339: + case &#39;g&#39;: group = atoi(optarg); break; ERROR: trailing statements should be on next line #375: FILE: Documentation/perf_counter/kerneltop.c:340: + case &#39;h&#39;: display_help(); break; ERROR: trailing statements should be on next line #376: FILE: Documentation/perf_counter/kerneltop.c:341: + case &#39;n&#39;: nmi = atoi(optarg); break; ERROR: trailing statements should be on next line #385: FILE: Documentation/perf_counter/kerneltop.c:350: + case &#39;s&#39;: sym_filter = strdup(optarg); break; ERROR: trailing statements should be on next line #386: FILE: Documentation/perf_counter/kerneltop.c:351: + case &#39;x&#39;: vmlinux = strdup(optarg); break; ERROR: trailing statements should be on next line #387: FILE: Documentation/perf_counter/kerneltop.c:352: + case &#39;z&#39;: zero = 1; break; ERROR: trailing statements should be on next line #388: FILE: Documentation/perf_counter/kerneltop.c:353: + default: error = 1; break; ERROR: Invalid UTF-8, patch and commit message should be encoded in UTF-8 #458: FILE: Documentation/perf_counter/kerneltop.c:423: +static const char CONSOLE_CLEAR[] = &quot;&#27;[H&#27;[2J&quot;; ^ WARNING: line over 80 characters #475: FILE: Documentation/perf_counter/kerneltop.c:440: +&quot;------------------------------------------------------------------------------\n&quot;); ERROR: space prohibited after that open parenthesis &#39;(&#39; #476: FILE: Documentation/perf_counter/kerneltop.c:441: + printf( &quot; KernelTop:%8.0f irqs/sec kernel:%3.1f%% [%s, &quot;, WARNING: line over 80 characters #478: FILE: Documentation/perf_counter/kerneltop.c:443: + 100.0 - (100.0*((events_per_sec-kevents_per_sec)/events_per_sec)), ERROR: space prohibited after that open parenthesis &#39;(&#39; #489: FILE: Documentation/perf_counter/kerneltop.c:454: + printf( &quot;%s&quot;, event_types[event_id[counter]]); ERROR: space prohibited after that open parenthesis &#39;(&#39; #491: FILE: Documentation/perf_counter/kerneltop.c:456: + printf( &quot;raw:%04lx&quot;, event_id[counter]); ERROR: space prohibited after that open parenthesis &#39;(&#39; #494: FILE: Documentation/perf_counter/kerneltop.c:459: + printf( &quot;], &quot;); WARNING: line over 80 characters #510: FILE: Documentation/perf_counter/kerneltop.c:475: + printf(&quot;------------------------------------------------------------------------------\n\n&quot;); WARNING: line over 80 characters #518: FILE: Documentation/perf_counter/kerneltop.c:483: + &quot; ______ ______ ________________ _______________\n\n&quot; ERROR: code indent should use tabs where possible #518: FILE: Documentation/perf_counter/kerneltop.c:483: +^I ^I &quot; ______ ______ ________________ _______________\n\n&quot;$ WARNING: line over 80 characters #546: FILE: Documentation/perf_counter/kerneltop.c:511: + sym_table[i].count[count] = zero ? 0 : sym_table[i].count[count] * 7 / 8; ERROR: do not initialise statics to 0 or NULL #566: FILE: Documentation/perf_counter/kerneltop.c:531: + static int filter_match = 0; WARNING: line over 80 characters #599: FILE: Documentation/perf_counter/kerneltop.c:564: + if (!strncmp(&quot;init_module&quot;, sym, 11) || !strncmp(&quot;cleanup_module&quot;, sym, 14)) WARNING: line over 80 characters #649: FILE: Documentation/perf_counter/kerneltop.c:614: + qsort(sym_table, sym_table_count, sizeof(sym_table[0]), compare_addr); ERROR: space required before the open parenthesis &#39;(&#39; #657: FILE: Documentation/perf_counter/kerneltop.c:622: + } while(dups); WARNING: line over 80 characters #667: FILE: Documentation/perf_counter/kerneltop.c:632: + printf(&quot;Could not open /proc/kallsyms - no CONFIG_KALLSYMS_ALL=y?\n&quot;); ERROR: spaces required around that &#39;=&#39; (ctx:VxV) #688: FILE: Documentation/perf_counter/kerneltop.c:653: + for (count=0; count &lt; sym_table_count; count ++) { ^ ERROR: space prohibited before that &#39;++&#39; (ctx:WxB) #688: FILE: Documentation/perf_counter/kerneltop.c:653: + for (count=0; count &lt; sym_table_count; count ++) { ^ WARNING: line over 80 characters #712: FILE: Documentation/perf_counter/kerneltop.c:677: + sprintf(command, &quot;objdump --start-address=0x%016lx --stop-address=0x%016lx -dS %s&quot;, filter_start, filter_end, filename); ERROR: trailing whitespace #724: FILE: Documentation/perf_counter/kerneltop.c:689: +^I^Iassert(src != NULL);^I$ ERROR: spaces required around that &#39;&gt;&#39; (ctx:VxV) #738: FILE: Documentation/perf_counter/kerneltop.c:703: + if (strlen(src-&gt;line)&gt;8 &amp;&amp; src-&gt;line[8] == &#39;:&#39;) ^ ERROR: spaces required around that &#39;&gt;&#39; (ctx:VxV) #740: FILE: Documentation/perf_counter/kerneltop.c:705: + if (strlen(src-&gt;line)&gt;8 &amp;&amp; src-&gt;line[16] == &#39;:&#39;) ^ ERROR: space prohibited before that &#39;++&#39; (ctx:WxO) #818: FILE: Documentation/perf_counter/kerneltop.c:783: + item_queue_count ++; ^ ERROR: space prohibited before that &#39;--&#39; (ctx:WxO) #826: FILE: Documentation/perf_counter/kerneltop.c:791: + item_queue_count --; ^ ERROR: space prohibited after that open square bracket &#39;[&#39; #854: FILE: Documentation/perf_counter/kerneltop.c:819: + left = sym_table[ left_idx].addr; ERROR: space prohibited after that open square bracket &#39;[&#39; #856: FILE: Documentation/perf_counter/kerneltop.c:821: + right = sym_table[ right_idx].addr; WARNING: line over 80 characters #859: FILE: Documentation/perf_counter/kerneltop.c:824: + printf(&quot;%016lx...\n%016lx...\n%016lx\n&quot;, left, middle, right); ERROR: trailing statements should be on next line #888: FILE: Documentation/perf_counter/kerneltop.c:853: + else events--; WARNING: line over 80 characters #937: FILE: Documentation/perf_counter/kerneltop.c:902: + fd[i][counter] = sys_perf_counter_open(&amp;hw_event, tid, cpu, group_fd, 0); WARNING: line over 80 characters #940: FILE: Documentation/perf_counter/kerneltop.c:905: + printf(&quot;kerneltop error: syscall returned with %d (%s)\n&quot;, WARNING: line over 80 characters #941: FILE: Documentation/perf_counter/kerneltop.c:906: + fd[i][counter], strerror(-fd[i][counter])); WARNING: line over 80 characters #971: FILE: Documentation/perf_counter/kerneltop.c:936: + res = read(fd[i][counter], (char *) &amp;ip, sizeof(ip)); ERROR: code indent should use tabs where possible #1015: FILE: Documentation/perf_counter/perfstat.c:18: + 163516953 instructions$ ERROR: code indent should use tabs where possible #1016: FILE: Documentation/perf_counter/perfstat.c:19: + 2295 cache-misses$ ERROR: code indent should use tabs where possible #1017: FILE: Documentation/perf_counter/perfstat.c:20: + 2855182 branch-misses$ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #1132: FILE: Documentation/perf_counter/perfstat.c:135: + __u64 disabled : 1, /* off by default */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #1133: FILE: Documentation/perf_counter/perfstat.c:136: + nmi : 1, /* NMI sampling */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #1134: FILE: Documentation/perf_counter/perfstat.c:137: + raw : 1, /* raw event type */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #1135: FILE: Documentation/perf_counter/perfstat.c:138: + inherit : 1, /* children inherit it */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #1136: FILE: Documentation/perf_counter/perfstat.c:139: + pinned : 1, /* must always be on PMU */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #1137: FILE: Documentation/perf_counter/perfstat.c:140: + exclusive : 1, /* only group on PMU */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #1138: FILE: Documentation/perf_counter/perfstat.c:141: + exclude_user : 1, /* don&#39;t count user */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #1139: FILE: Documentation/perf_counter/perfstat.c:142: + exclude_kernel : 1, /* ditto kernel */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #1140: FILE: Documentation/perf_counter/perfstat.c:143: + exclude_hv : 1, /* ditto hypervisor */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #1141: FILE: Documentation/perf_counter/perfstat.c:144: + exclude_idle : 1, /* don&#39;t count when idle */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #1143: FILE: Documentation/perf_counter/perfstat.c:146: + __reserved_1 : 54; ^ WARNING: line over 80 characters #1169: FILE: Documentation/perf_counter/perfstat.c:172: + __NR_perf_counter_open, hw_event_uptr, pid, cpu, group_fd, flags); ERROR: space prohibited before open square bracket &#39;[&#39; #1180: FILE: Documentation/perf_counter/perfstat.c:183: +static char *hw_event_names [] = { ERROR: space prohibited before open square bracket &#39;[&#39; #1190: FILE: Documentation/perf_counter/perfstat.c:193: +static char *sw_event_names [] = { ERROR: space prohibited before open square bracket &#39;[&#39; #1203: FILE: Documentation/perf_counter/perfstat.c:206: +static struct event_symbol event_symbols [] = { ERROR: do not initialise statics to 0 or NULL #1227: FILE: Documentation/perf_counter/perfstat.c:230: +static int nr_counters = 0; ERROR: do not initialise statics to 0 or NULL #1228: FILE: Documentation/perf_counter/perfstat.c:231: +static int nr_cpus = 0; ERROR: do not initialise statics to 0 or NULL #1235: FILE: Documentation/perf_counter/perfstat.c:238: +static int system_wide = 0; WARNING: line over 80 characters #1247: FILE: Documentation/perf_counter/perfstat.c:250: + &quot; -e EVENT --event=EVENT # symbolic-name abbreviations&quot;); WARNING: line over 80 characters #1249: FILE: Documentation/perf_counter/perfstat.c:252: + for (i = 0, e = PERF_HW_EVENTS_MAX; i &lt; ARRAY_SIZE(event_symbols); i++) { WARNING: line over 80 characters #1253: FILE: Documentation/perf_counter/perfstat.c:256: + &quot;\n %2d: %-20s&quot;, e, event_symbols[i].symbol); ERROR: space prohibited before that &#39;++&#39; (ctx:WxB) #1405: FILE: Documentation/perf_counter/perfstat.c:408: + for (cpu = 0; cpu &lt; nr_cpus; cpu ++) { ^ WARNING: line over 80 characters #1406: FILE: Documentation/perf_counter/perfstat.c:409: + fd[cpu][counter] = sys_perf_counter_open(&amp;hw_event, -1, cpu, -1, 0); WARNING: line over 80 characters #1408: FILE: Documentation/perf_counter/perfstat.c:411: + printf(&quot;perfstat error: syscall returned with %d (%s)\n&quot;, WARNING: line over 80 characters #1409: FILE: Documentation/perf_counter/perfstat.c:412: + fd[cpu][counter], strerror(errno)); ERROR: trailing whitespace #1412: FILE: Documentation/perf_counter/perfstat.c:415: +^I^I^I$ WARNING: line over 80 characters #1420: FILE: Documentation/perf_counter/perfstat.c:423: + printf(&quot;perfstat error: syscall returned with %d (%s)\n&quot;, ERROR: do not use assignment in if condition #1465: FILE: Documentation/perf_counter/perfstat.c:468: + if ((pid = fork()) &lt; 0) ERROR: space prohibited before that &#39;++&#39; (ctx:WxB) #1490: FILE: Documentation/perf_counter/perfstat.c:493: + for (cpu = 0; cpu &lt; nr_cpus; cpu ++) { ^ WARNING: line over 80 characters #1492: FILE: Documentation/perf_counter/perfstat.c:495: + (char *) &amp;single_count, sizeof(single_count)); total: 80 errors, 34 warnings, 1489 lines checked </pre> checkpatch: perf_counter tools: Merge common code into perfcounters.h <pre>commit cea92ce5b07078cd62c4712d51390b09a43dba2e Author: Wu Fengguang &lt;fengguang.wu@intel.com&gt; Date: Fri Mar 20 10:08:02 2009 +0800 perf_counter tools: Merge common code into perfcounters.h kerneltop&#39;s MAX_COUNTERS is increased from 8 to 64(the value used by perfstat). Signed-off-by: Wu Fengguang &lt;fengguang.wu@intel.com&gt; Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Cc: Paul Mackerras &lt;paulus@samba.org&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #257: FILE: Documentation/perf_counter/perfcounters.h:85: + __u64 disabled : 1, /* off by default */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #258: FILE: Documentation/perf_counter/perfcounters.h:86: + nmi : 1, /* NMI sampling */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #259: FILE: Documentation/perf_counter/perfcounters.h:87: + raw : 1, /* raw event type */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #260: FILE: Documentation/perf_counter/perfcounters.h:88: + inherit : 1, /* children inherit it */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #261: FILE: Documentation/perf_counter/perfcounters.h:89: + pinned : 1, /* must always be on PMU */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #262: FILE: Documentation/perf_counter/perfcounters.h:90: + exclusive : 1, /* only group on PMU */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #263: FILE: Documentation/perf_counter/perfcounters.h:91: + exclude_user : 1, /* don&#39;t count user */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #264: FILE: Documentation/perf_counter/perfcounters.h:92: + exclude_kernel : 1, /* ditto kernel */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #265: FILE: Documentation/perf_counter/perfcounters.h:93: + exclude_hv : 1, /* ditto hypervisor */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #266: FILE: Documentation/perf_counter/perfcounters.h:94: + exclude_idle : 1, /* don&#39;t count when idle */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #268: FILE: Documentation/perf_counter/perfcounters.h:96: + __reserved_1 : 54; ^ WARNING: line over 80 characters #300: FILE: Documentation/perf_counter/perfcounters.h:128: + __NR_perf_counter_open, hw_event_uptr, pid, cpu, group_fd, flags); total: 11 errors, 1 warnings, 437 lines checked </pre> checkpatch: perf_counter tools: Move perfstat supporting code into perfcounters.h <pre>commit f49012fad4ed2231c7380c0b1901122242b3eab0 Author: Wu Fengguang &lt;fengguang.wu@intel.com&gt; Date: Fri Mar 20 10:08:03 2009 +0800 perf_counter tools: Move perfstat supporting code into perfcounters.h Signed-off-by: Wu Fengguang &lt;fengguang.wu@intel.com&gt; Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Cc: Paul Mackerras &lt;paulus@samba.org&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: space prohibited before open square bracket &#39;[&#39; #34: FILE: Documentation/perf_counter/perfcounters.h:146: +static char *hw_event_names [] = { ERROR: space prohibited before open square bracket &#39;[&#39; #44: FILE: Documentation/perf_counter/perfcounters.h:156: +static char *sw_event_names [] = { ERROR: space prohibited before open square bracket &#39;[&#39; #57: FILE: Documentation/perf_counter/perfcounters.h:169: +static struct event_symbol event_symbols [] = { total: 3 errors, 0 warnings, 287 lines checked </pre> checkpatch: perf_counter tools: support symbolic event names in kerneltop <pre>commit 95bb3be1b3ca4a71cc168787b675d5b7852fc6be Author: Wu Fengguang &lt;fengguang.wu@intel.com&gt; Date: Fri Mar 20 10:08:04 2009 +0800 perf_counter tools: support symbolic event names in kerneltop - kerneltop: --event_id =&gt; --event - kerneltop: can accept SW event types now - perfstat: it used to implicitly add event -2(task-clock), the new code no longer does this. Shall we? Signed-off-by: Wu Fengguang &lt;fengguang.wu@intel.com&gt; Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Cc: Paul Mackerras &lt;paulus@samba.org&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>WARNING: line over 80 characters #39: FILE: Documentation/perf_counter/kerneltop.c:124: + &quot; -e EID --event=EID # event type ID [default: 0]\n&quot; WARNING: line over 80 characters #77: FILE: Documentation/perf_counter/kerneltop.c:189: + case &#39;e&#39;: error = parse_events(optarg); break; ERROR: trailing statements should be on next line #77: FILE: Documentation/perf_counter/kerneltop.c:189: + case &#39;e&#39;: error = parse_events(optarg); break; ERROR: do not initialise statics to 0 or NULL #102: FILE: Documentation/perf_counter/perfcounters.h:146: +static int nr_counters = 0; WARNING: line over 80 characters #103: FILE: Documentation/perf_counter/perfcounters.h:147: +static long event_id[MAX_COUNTERS] = { -2, -5, -4, -3, 0, 1, 2, 3}; total: 2 errors, 3 warnings, 136 lines checked </pre> checkpatch: perf_counter tools: move remaining code into kerneltop.c <pre>commit f7524bda8be8be98db356d6a83ac1da451ecdb2e Author: Wu Fengguang &lt;fengguang.wu@intel.com&gt; Date: Fri Mar 20 10:08:06 2009 +0800 perf_counter tools: move remaining code into kerneltop.c - perfstat.c can be safely removed now - perfstat: -s =&gt; -a for system wide accounting - kerneltop: add -S/--stat for perfstat mode - minor adjustments to kerneltop --help, perfstat --help Signed-off-by: Wu Fengguang &lt;fengguang.wu@intel.com&gt; Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Cc: Paul Mackerras &lt;paulus@samba.org&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>WARNING: line over 80 characters #25: FILE: Documentation/perf_counter/kerneltop.c:6: + cc -O6 -Wall -lrt `pkg-config --cflags --libs glib-2.0` -o kerneltop kerneltop.c ERROR: need consistent spacing around &#39;-&#39; (ctx:WxV) #25: FILE: Documentation/perf_counter/kerneltop.c:6: + cc -O6 -Wall -lrt `pkg-config --cflags --libs glib-2.0` -o kerneltop kerneltop.c ^ ERROR: need consistent spacing around &#39;-&#39; (ctx:WxV) #25: FILE: Documentation/perf_counter/kerneltop.c:6: + cc -O6 -Wall -lrt `pkg-config --cflags --libs glib-2.0` -o kerneltop kerneltop.c ^ ERROR: need consistent spacing around &#39;-&#39; (ctx:WxV) #25: FILE: Documentation/perf_counter/kerneltop.c:6: + cc -O6 -Wall -lrt `pkg-config --cflags --libs glib-2.0` -o kerneltop kerneltop.c ^ ERROR: need consistent spacing around &#39;-&#39; (ctx:WxV) #25: FILE: Documentation/perf_counter/kerneltop.c:6: + cc -O6 -Wall -lrt `pkg-config --cflags --libs glib-2.0` -o kerneltop kerneltop.c ^ ERROR: code indent should use tabs where possible #40: FILE: Documentation/perf_counter/kerneltop.c:34: + It summarizes the counter events of all tasks (and child tasks),$ ERROR: code indent should use tabs where possible #41: FILE: Documentation/perf_counter/kerneltop.c:35: + covering all CPUs that the command (or workload) executes on.$ ERROR: code indent should use tabs where possible #42: FILE: Documentation/perf_counter/kerneltop.c:36: + It only counts the per-task events of the workload started,$ ERROR: code indent should use tabs where possible #43: FILE: Documentation/perf_counter/kerneltop.c:37: + independent of how many other tasks run on those CPUs.$ ERROR: code indent should use tabs where possible #55: FILE: Documentation/perf_counter/kerneltop.c:45: + 163516953 instructions$ ERROR: code indent should use tabs where possible #56: FILE: Documentation/perf_counter/kerneltop.c:46: + 2295 cache-misses$ ERROR: code indent should use tabs where possible #57: FILE: Documentation/perf_counter/kerneltop.c:47: + 2855182 branch-misses$ ERROR: do not initialise statics to 0 or NULL #95: FILE: Documentation/perf_counter/kerneltop.c:98: +static int run_perfstat = 0; ERROR: do not initialise statics to 0 or NULL #96: FILE: Documentation/perf_counter/kerneltop.c:99: +static int system_wide = 0; ERROR: do not initialise statics to 0 or NULL #98: FILE: Documentation/perf_counter/kerneltop.c:101: +static int nr_counters = 0; WARNING: line over 80 characters #99: FILE: Documentation/perf_counter/kerneltop.c:102: +static long event_id[MAX_COUNTERS] = DEF_PERFSTAT_EVENTS; WARNING: line over 80 characters #183: FILE: Documentation/perf_counter/kerneltop.c:195: + for (i = 0, e = PERF_HW_EVENTS_MAX; i &lt; ARRAY_SIZE(event_symbols); i++) { WARNING: line over 80 characters #187: FILE: Documentation/perf_counter/kerneltop.c:199: + &quot;\n %2d: %-20s&quot;, e, event_symbols[i].symbol); WARNING: line over 80 characters #235: FILE: Documentation/perf_counter/kerneltop.c:237: + &quot; -a # system-wide collection (for perfstat)\n\n&quot; WARNING: line over 80 characters #241: FILE: Documentation/perf_counter/kerneltop.c:242: + &quot; -f CNT --filter=CNT # min-event-count filter [default: 100]\n\n&quot; WARNING: line over 80 characters #244: FILE: Documentation/perf_counter/kerneltop.c:244: + &quot; -x path --vmlinux=&lt;path&gt; # the vmlinux binary, required for -s use\n&quot; ERROR: space prohibited before that &#39;++&#39; (ctx:WxB) #401: FILE: Documentation/perf_counter/kerneltop.c:351: + for (cpu = 0; cpu &lt; nr_cpus; cpu ++) { ^ WARNING: line over 80 characters #402: FILE: Documentation/perf_counter/kerneltop.c:352: + fd[cpu][counter] = sys_perf_counter_open(&amp;hw_event, -1, cpu, -1, 0); WARNING: line over 80 characters #404: FILE: Documentation/perf_counter/kerneltop.c:354: + printf(&quot;perfstat error: syscall returned with %d (%s)\n&quot;, WARNING: line over 80 characters #405: FILE: Documentation/perf_counter/kerneltop.c:355: + fd[cpu][counter], strerror(errno)); WARNING: line over 80 characters #420: FILE: Documentation/perf_counter/kerneltop.c:365: + printf(&quot;perfstat error: syscall returned with %d (%s)\n&quot;, ERROR: do not use assignment in if condition #455: FILE: Documentation/perf_counter/kerneltop.c:395: + if ((pid = fork()) &lt; 0) ERROR: space prohibited before that &#39;++&#39; (ctx:WxB) #482: FILE: Documentation/perf_counter/kerneltop.c:420: + for (cpu = 0; cpu &lt; nr_cpus; cpu ++) { ^ WARNING: line over 80 characters #484: FILE: Documentation/perf_counter/kerneltop.c:422: + (char *) &amp;single_count, sizeof(single_count)); ERROR: trailing statements should be on next line #579: FILE: Documentation/perf_counter/kerneltop.c:981: + case &#39;a&#39;: system_wide = 1; break; ERROR: trailing statements should be on next line #580: FILE: Documentation/perf_counter/kerneltop.c:982: + case &#39;c&#39;: event_count[nr_counters] = atoi(optarg); break; ERROR: trailing statements should be on next line #589: FILE: Documentation/perf_counter/kerneltop.c:991: + case &#39;d&#39;: delay_secs = atoi(optarg); break; ERROR: trailing statements should be on next line #590: FILE: Documentation/perf_counter/kerneltop.c:992: + case &#39;D&#39;: dump_symtab = 1; break; WARNING: line over 80 characters #592: FILE: Documentation/perf_counter/kerneltop.c:994: + case &#39;e&#39;: error = parse_events(optarg); break; ERROR: trailing statements should be on next line #592: FILE: Documentation/perf_counter/kerneltop.c:994: + case &#39;e&#39;: error = parse_events(optarg); break; ERROR: trailing statements should be on next line #594: FILE: Documentation/perf_counter/kerneltop.c:996: + case &#39;f&#39;: count_filter = atoi(optarg); break; ERROR: trailing statements should be on next line #595: FILE: Documentation/perf_counter/kerneltop.c:997: + case &#39;g&#39;: group = atoi(optarg); break; ERROR: trailing statements should be on next line #596: FILE: Documentation/perf_counter/kerneltop.c:998: + case &#39;h&#39;: display_help(); break; ERROR: trailing statements should be on next line #597: FILE: Documentation/perf_counter/kerneltop.c:999: + case &#39;n&#39;: nmi = atoi(optarg); break; ERROR: trailing statements should be on next line #606: FILE: Documentation/perf_counter/kerneltop.c:1008: + case &#39;s&#39;: sym_filter = strdup(optarg); break; ERROR: trailing statements should be on next line #607: FILE: Documentation/perf_counter/kerneltop.c:1009: + case &#39;S&#39;: run_perfstat = 1; break; ERROR: trailing statements should be on next line #608: FILE: Documentation/perf_counter/kerneltop.c:1010: + case &#39;x&#39;: vmlinux = strdup(optarg); break; ERROR: trailing statements should be on next line #609: FILE: Documentation/perf_counter/kerneltop.c:1011: + case &#39;z&#39;: zero = 1; break; ERROR: trailing statements should be on next line #610: FILE: Documentation/perf_counter/kerneltop.c:1012: + default: error = 1; break; total: 31 errors, 13 warnings, 653 lines checked </pre> checkpatch: perf_counter tools: fix event_id type <pre>commit 3ab8d792b1348eaabfe550ba60902d781d160dd4 Author: Wu Fengguang &lt;fengguang.wu@intel.com&gt; Date: Fri Mar 20 10:08:08 2009 +0800 perf_counter tools: fix event_id type Signed-off-by: Wu Fengguang &lt;fengguang.wu@intel.com&gt; Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Cc: Paul Mackerras &lt;paulus@samba.org&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>WARNING: line over 80 characters #20: FILE: Documentation/perf_counter/kerneltop.c:102: +static __s64 event_id[MAX_COUNTERS] = DEF_PERFSTAT_EVENTS; total: 0 errors, 1 warnings, 30 lines checked </pre> checkpatch: perf_counter tools: update to new syscall ABI <pre>commit 803d4f3980f6e220b27311a283aab0a4d68b6709 Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Date: Mon Mar 23 18:22:11 2009 +0100 perf_counter tools: update to new syscall ABI update the kerneltop userspace to work with the latest syscall ABI Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Cc: Wu Fengguang &lt;fengguang.wu@intel.com&gt; Cc: Paul Mackerras &lt;paulus@samba.org&gt; Orig-LKML-Reference: &lt;20090323172417.559643732@chello.nl&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: code indent should use tabs where possible #37: FILE: Documentation/perf_counter/kerneltop.c:104: + struct timespec ts; \$ ERROR: code indent should use tabs where possible #38: FILE: Documentation/perf_counter/kerneltop.c:105: + \$ ERROR: code indent should use tabs where possible #39: FILE: Documentation/perf_counter/kerneltop.c:106: + clock_gettime(CLOCK_MONOTONIC, &amp;ts); \$ ERROR: code indent should use tabs where possible #40: FILE: Documentation/perf_counter/kerneltop.c:107: + ts.tv_sec * 1000000000ULL + ts.tv_nsec; \$ ERROR: code indent should use tabs where possible #67: FILE: Documentation/perf_counter/kerneltop.c:134: + struct perf_counter_hw_event *hw_event_uptr __user,$ ERROR: code indent should use tabs where possible #68: FILE: Documentation/perf_counter/kerneltop.c:135: + pid_t pid,$ ERROR: code indent should use tabs where possible #69: FILE: Documentation/perf_counter/kerneltop.c:136: + int cpu,$ ERROR: code indent should use tabs where possible #70: FILE: Documentation/perf_counter/kerneltop.c:137: + int group_fd,$ ERROR: code indent should use tabs where possible #71: FILE: Documentation/perf_counter/kerneltop.c:138: + unsigned long flags)$ ERROR: code indent should use tabs where possible #73: FILE: Documentation/perf_counter/kerneltop.c:140: + int ret;$ ERROR: code indent should use tabs where possible #75: FILE: Documentation/perf_counter/kerneltop.c:142: + ret = syscall($ WARNING: line over 80 characters #76: FILE: Documentation/perf_counter/kerneltop.c:143: + __NR_perf_counter_open, hw_event_uptr, pid, cpu, group_fd, flags); ERROR: code indent should use tabs where possible #76: FILE: Documentation/perf_counter/kerneltop.c:143: + __NR_perf_counter_open, hw_event_uptr, pid, cpu, group_fd, flags);$ ERROR: code indent should use tabs where possible #78: FILE: Documentation/perf_counter/kerneltop.c:145: + if (ret &lt; 0 &amp;&amp; ret &gt; -4096) {$ ERROR: code indent should use tabs where possible #79: FILE: Documentation/perf_counter/kerneltop.c:146: + errno = -ret;$ ERROR: code indent should use tabs where possible #80: FILE: Documentation/perf_counter/kerneltop.c:147: + ret = -1;$ ERROR: code indent should use tabs where possible #81: FILE: Documentation/perf_counter/kerneltop.c:148: + }$ ERROR: code indent should use tabs where possible #83: FILE: Documentation/perf_counter/kerneltop.c:150: + return ret;$ WARNING: line over 80 characters #146: FILE: Documentation/perf_counter/kerneltop.c:239: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_CPU_CYCLES), &quot;cpu-cycles&quot;, }, WARNING: line over 80 characters #147: FILE: Documentation/perf_counter/kerneltop.c:240: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_CPU_CYCLES), &quot;cycles&quot;, }, WARNING: line over 80 characters #148: FILE: Documentation/perf_counter/kerneltop.c:241: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_INSTRUCTIONS), &quot;instructions&quot;, }, WARNING: line over 80 characters #149: FILE: Documentation/perf_counter/kerneltop.c:242: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_CACHE_REFERENCES), &quot;cache-references&quot;, }, WARNING: line over 80 characters #150: FILE: Documentation/perf_counter/kerneltop.c:243: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_CACHE_MISSES), &quot;cache-misses&quot;, }, WARNING: line over 80 characters #151: FILE: Documentation/perf_counter/kerneltop.c:244: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_BRANCH_INSTRUCTIONS), &quot;branch-instructions&quot;, }, WARNING: line over 80 characters #152: FILE: Documentation/perf_counter/kerneltop.c:245: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_BRANCH_INSTRUCTIONS), &quot;branches&quot;, }, WARNING: line over 80 characters #153: FILE: Documentation/perf_counter/kerneltop.c:246: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_BRANCH_MISSES), &quot;branch-misses&quot;, }, WARNING: line over 80 characters #154: FILE: Documentation/perf_counter/kerneltop.c:247: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_BUS_CYCLES), &quot;bus-cycles&quot;, }, WARNING: line over 80 characters #156: FILE: Documentation/perf_counter/kerneltop.c:249: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_CPU_CLOCK), &quot;cpu-clock&quot;, }, WARNING: line over 80 characters #157: FILE: Documentation/perf_counter/kerneltop.c:250: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_TASK_CLOCK), &quot;task-clock&quot;, }, WARNING: line over 80 characters #158: FILE: Documentation/perf_counter/kerneltop.c:251: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_PAGE_FAULTS), &quot;page-faults&quot;, }, WARNING: line over 80 characters #159: FILE: Documentation/perf_counter/kerneltop.c:252: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_PAGE_FAULTS), &quot;faults&quot;, }, WARNING: line over 80 characters #160: FILE: Documentation/perf_counter/kerneltop.c:253: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_PAGE_FAULTS_MIN), &quot;minor-faults&quot;, }, WARNING: line over 80 characters #161: FILE: Documentation/perf_counter/kerneltop.c:254: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_PAGE_FAULTS_MAJ), &quot;major-faults&quot;, }, WARNING: line over 80 characters #162: FILE: Documentation/perf_counter/kerneltop.c:255: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_CONTEXT_SWITCHES), &quot;context-switches&quot;, }, WARNING: line over 80 characters #163: FILE: Documentation/perf_counter/kerneltop.c:256: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_CONTEXT_SWITCHES), &quot;cs&quot;, }, WARNING: line over 80 characters #164: FILE: Documentation/perf_counter/kerneltop.c:257: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_CPU_MIGRATIONS), &quot;cpu-migrations&quot;, }, WARNING: line over 80 characters #165: FILE: Documentation/perf_counter/kerneltop.c:258: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_CPU_MIGRATIONS), &quot;migrations&quot;, }, ERROR: trailing statements should be on next line #348: FILE: Documentation/perf_counter/kerneltop.c:1067: + case &#39;c&#39;: default_interval = atoi(optarg); break; WARNING: line over 80 characters #375: FILE: Documentation/perf_counter/kerneltop.c:1156: + printf(&quot;FOO: %d %llx %llx\n&quot;, counter, event_id[counter], event_count[counter]); total: 18 errors, 21 warnings, 352 lines checked </pre> checkpatch: perf_counter tools: use mmap() output <pre>commit bcbcb37cdb67d8100acfa66df40c4d636c28c4d1 Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Date: Mon Mar 23 18:22:12 2009 +0100 perf_counter tools: use mmap() output update kerneltop to use the mmap() output to gather overflow information Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Cc: Wu Fengguang &lt;fengguang.wu@intel.com&gt; Cc: Paul Mackerras &lt;paulus@samba.org&gt; Orig-LKML-Reference: &lt;20090323172417.677932499@chello.nl&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: spaces required around that &#39;:&#39; (ctx:WxO) #32: FILE: Documentation/perf_counter/kerneltop.c:124: +#define rmb() asm volatile(&quot;lfence&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxO) #32: FILE: Documentation/perf_counter/kerneltop.c:124: +#define rmb() asm volatile(&quot;lfence&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxW) #32: FILE: Documentation/perf_counter/kerneltop.c:124: +#define rmb() asm volatile(&quot;lfence&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:WxO) #33: FILE: Documentation/perf_counter/kerneltop.c:125: +#define cpu_relax() asm volatile(&quot;rep; nop&quot; ::: &quot;memory&quot;); ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxO) #33: FILE: Documentation/perf_counter/kerneltop.c:125: +#define cpu_relax() asm volatile(&quot;rep; nop&quot; ::: &quot;memory&quot;); ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxW) #33: FILE: Documentation/perf_counter/kerneltop.c:125: +#define cpu_relax() asm volatile(&quot;rep; nop&quot; ::: &quot;memory&quot;); ^ ERROR: spaces required around that &#39;:&#39; (ctx:WxO) #39: FILE: Documentation/perf_counter/kerneltop.c:130: +#define rmb() asm volatile(&quot;lfence&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxO) #39: FILE: Documentation/perf_counter/kerneltop.c:130: +#define rmb() asm volatile(&quot;lfence&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxW) #39: FILE: Documentation/perf_counter/kerneltop.c:130: +#define rmb() asm volatile(&quot;lfence&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:WxO) #40: FILE: Documentation/perf_counter/kerneltop.c:131: +#define cpu_relax() asm volatile(&quot;rep; nop&quot; ::: &quot;memory&quot;); ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxO) #40: FILE: Documentation/perf_counter/kerneltop.c:131: +#define cpu_relax() asm volatile(&quot;rep; nop&quot; ::: &quot;memory&quot;); ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxW) #40: FILE: Documentation/perf_counter/kerneltop.c:131: +#define cpu_relax() asm volatile(&quot;rep; nop&quot; ::: &quot;memory&quot;); ^ ERROR: spaces required around that &#39;:&#39; (ctx:WxO) #45: FILE: Documentation/perf_counter/kerneltop.c:136: +#define rmb() asm volatile (&quot;sync&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxO) #45: FILE: Documentation/perf_counter/kerneltop.c:136: +#define rmb() asm volatile (&quot;sync&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxW) #45: FILE: Documentation/perf_counter/kerneltop.c:136: +#define rmb() asm volatile (&quot;sync&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:WxO) #46: FILE: Documentation/perf_counter/kerneltop.c:137: +#define cpu_relax() asm volatile (&quot;&quot; ::: &quot;memory&quot;); ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxO) #46: FILE: Documentation/perf_counter/kerneltop.c:137: +#define cpu_relax() asm volatile (&quot;&quot; ::: &quot;memory&quot;); ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxW) #46: FILE: Documentation/perf_counter/kerneltop.c:137: +#define cpu_relax() asm volatile (&quot;&quot; ::: &quot;memory&quot;); ^ WARNING: line over 80 characters #151: FILE: Documentation/perf_counter/kerneltop.c:1242: + PROT_READ, MAP_SHARED, fd[i][counter], 0); WARNING: line over 80 characters #153: FILE: Documentation/perf_counter/kerneltop.c:1244: + printf(&quot;kerneltop error: failed to mmap with %d (%s)\n&quot;, total: 18 errors, 2 warnings, 152 lines checked </pre> checkpatch: perf_counter tools: remove glib dependency and fix bugs in kerneltop.c <pre>commit cbe46555dc4de6403cd757139d42289b5f21abb9 Author: Paul Mackerras &lt;paulus@samba.org&gt; Date: Tue Mar 24 16:52:34 2009 +1100 perf_counter tools: remove glib dependency and fix bugs in kerneltop.c The glib dependency in kerneltop.c is only for a little bit of list manipulation, and I find it inconvenient. This adds a &#39;next&#39; field to struct source_line, which lets us link them together into a list. The code to do the linking ourselves turns out to be no longer or more difficult than using glib. This also fixes a few other problems: - We need to #include &lt;limits.h&gt; to get PATH_MAX on powerpc. - We need to #include &lt;linux/types.h&gt; rather than have our own definitions of __u64 and __s64; on powerpc the installed headers define them to be unsigned long and long respectively, and if we have our own, different definition here that causes a compile error. - This takes out the x86 setting of errno from -ret in sys_perf_counter_open. My experiments on x86 indicate that the glibc syscall() does this for us already. - We had two CPU migration counters in the default set, which seems unnecessary; I changed one of them to a context switch counter. - In perfstat mode we were printing CPU cycles and instructions as milliseconds, and the cpu clock and task clock counters as events. This fixes that. - In perfstat mode we were still printing a blank line after the first counter, which was a holdover from when a task clock counter was automatically included as the first counter. This removes the blank line. - On a test machine here, parse_symbols() and parse_vmlinux() were taking long enough (almost 0.5 seconds) for the mmap buffer to overflow before we got to the first mmap_read() call, so this moves them before we open all the counters. - The error message if sys_perf_counter_open fails needs to use errno, not -fd[i][counter]. Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt; Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Acked-by: Mike Galbraith &lt;efault@gmx.de&gt; Cc: Arjan van de Ven &lt;arjan@linux.intel.com&gt; Orig-LKML-Reference: &lt;18888.29986.340328.540512@cargo.ozlabs.ibm.com&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: need consistent spacing around &#39;-&#39; (ctx:WxV) #74: FILE: Documentation/perf_counter/kerneltop.c:6: + cc -O6 -Wall -c -o kerneltop.o kerneltop.c -lrt ^ ERROR: need consistent spacing around &#39;-&#39; (ctx:WxV) #74: FILE: Documentation/perf_counter/kerneltop.c:6: + cc -O6 -Wall -c -o kerneltop.o kerneltop.c -lrt ^ ERROR: need consistent spacing around &#39;-&#39; (ctx:WxV) #74: FILE: Documentation/perf_counter/kerneltop.c:6: + cc -O6 -Wall -c -o kerneltop.o kerneltop.c -lrt ^ ERROR: need consistent spacing around &#39;-&#39; (ctx:WxV) #74: FILE: Documentation/perf_counter/kerneltop.c:6: + cc -O6 -Wall -c -o kerneltop.o kerneltop.c -lrt ^ ERROR: need consistent spacing around &#39;-&#39; (ctx:WxV) #74: FILE: Documentation/perf_counter/kerneltop.c:6: + cc -O6 -Wall -c -o kerneltop.o kerneltop.c -lrt ^ ERROR: code indent should use tabs where possible #130: FILE: Documentation/perf_counter/kerneltop.c:145: + return syscall($ WARNING: line over 80 characters #176: FILE: Documentation/perf_counter/kerneltop.c:510: + if (event_id[counter] == EID(PERF_TYPE_SOFTWARE, PERF_COUNT_CPU_CLOCK) || WARNING: line over 80 characters #177: FILE: Documentation/perf_counter/kerneltop.c:511: + event_id[counter] == EID(PERF_TYPE_SOFTWARE, PERF_COUNT_TASK_CLOCK)) { ERROR: space prohibited before that &#39;++&#39; (ctx:WxO) #308: FILE: Documentation/perf_counter/kerneltop.c:935: + line_queue_count ++; ^ ERROR: space prohibited before that &#39;--&#39; (ctx:WxO) #322: FILE: Documentation/perf_counter/kerneltop.c:943: + line_queue_count --; ^ total: 8 errors, 2 warnings, 295 lines checked </pre> badincludes: perf_counter tools: remove glib dependency and fix bugs in kerneltop.c <pre>commit cbe46555dc4de6403cd757139d42289b5f21abb9 Author: Paul Mackerras &lt;paulus@samba.org&gt; Date: Tue Mar 24 16:52:34 2009 +1100 perf_counter tools: remove glib dependency and fix bugs in kerneltop.c The glib dependency in kerneltop.c is only for a little bit of list manipulation, and I find it inconvenient. This adds a &#39;next&#39; field to struct source_line, which lets us link them together into a list. The code to do the linking ourselves turns out to be no longer or more difficult than using glib. This also fixes a few other problems: - We need to #include &lt;limits.h&gt; to get PATH_MAX on powerpc. - We need to #include &lt;linux/types.h&gt; rather than have our own definitions of __u64 and __s64; on powerpc the installed headers define them to be unsigned long and long respectively, and if we have our own, different definition here that causes a compile error. - This takes out the x86 setting of errno from -ret in sys_perf_counter_open. My experiments on x86 indicate that the glibc syscall() does this for us already. - We had two CPU migration counters in the default set, which seems unnecessary; I changed one of them to a context switch counter. - In perfstat mode we were printing CPU cycles and instructions as milliseconds, and the cpu clock and task clock counters as events. This fixes that. - In perfstat mode we were still printing a blank line after the first counter, which was a holdover from when a task clock counter was automatically included as the first counter. This removes the blank line. - On a test machine here, parse_symbols() and parse_vmlinux() were taking long enough (almost 0.5 seconds) for the mmap buffer to overflow before we got to the first mmap_read() call, so this moves them before we open all the counters. - The error message if sys_perf_counter_open fails needs to use errno, not -fd[i][counter]. Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt; Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Acked-by: Mike Galbraith &lt;efault@gmx.de&gt; Cc: Arjan van de Ven &lt;arjan@linux.intel.com&gt; Orig-LKML-Reference: &lt;18888.29986.340328.540512@cargo.ozlabs.ibm.com&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>diff --git a/Documentation/perf_counter/kerneltop.c b/Documentation/perf_counter/kerneltop.c index 2ab29b5..ea13e4e 100644 --- a/Documentation/perf_counter/kerneltop.c +++ b/Documentation/perf_counter/kerneltop.c @@ -87,6 +87,7 @@ #include &lt;sys/mman.h&gt; #include &lt;linux/unistd.h&gt; +#include &lt;linux/types.h&gt; #include &quot;../../include/linux/perf_counter.h&quot; include linux/types.h inserted after linux/unistd.h </pre> checkpatch: perf_counter: optionally provide the pid/tid of the sampled task <pre>commit ea5d20cf99db5d26d43b6d322d3ace17e08a6552 Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Date: Wed Mar 25 12:30:25 2009 +0100 perf_counter: optionally provide the pid/tid of the sampled task Allow cpu wide counters to profile userspace by providing what process the sample belongs to. This raises the first issue with the output type, lots of these options: group, tid, callchain, etc.. are non-exclusive and could be combined, suggesting a bitfield. However, things like the mmap() data stream doesn&#39;t fit in that. How to split the type field... Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Cc: Paul Mackerras &lt;paulus@samba.org&gt; Cc: Mike Galbraith &lt;efault@gmx.de&gt; Cc: Arjan van de Ven &lt;arjan@infradead.org&gt; Cc: Wu Fengguang &lt;fengguang.wu@intel.com&gt; Orig-LKML-Reference: &lt;20090325113317.013775235@chello.nl&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #33: FILE: include/linux/perf_counter.h:130: + include_tid : 1, /* include the tid */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #36: FILE: include/linux/perf_counter.h:132: + __reserved_1 : 54; ^ total: 2 errors, 0 warnings, 50 lines checked </pre> checkpatch: perf_counter: kerneltop: mmap_pages argument <pre>commit 4c4ba21d2c3659e4c0421533939b58a8fd9f06c9 Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Date: Wed Mar 25 12:30:26 2009 +0100 perf_counter: kerneltop: mmap_pages argument provide a knob to set the number of mmap data pages. Signed-off-by: Mike Galbraith &lt;efault@gmx.de&gt; Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Cc: Paul Mackerras &lt;paulus@samba.org&gt; Cc: Mike Galbraith &lt;efault@gmx.de&gt; Cc: Arjan van de Ven &lt;arjan@infradead.org&gt; Cc: Wu Fengguang &lt;fengguang.wu@intel.com&gt; Orig-LKML-Reference: &lt;20090325113317.104545398@chello.nl&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: trailing statements should be on next line #64: FILE: Documentation/perf_counter/kerneltop.c:1089: + case &#39;m&#39;: mmap_pages = atoi(optarg); break; WARNING: line over 80 characters #91: FILE: Documentation/perf_counter/kerneltop.c:1160: + fprintf(stderr, &quot;WARNING: failed to keep up with mmap data. Last read %lu msecs ago.\n&quot;, msecs); WARNING: line over 80 characters #108: FILE: Documentation/perf_counter/kerneltop.c:1243: + mmap_array[i][counter].base = mmap(NULL, (mmap_pages+1)*page_size, total: 1 errors, 2 warnings, 84 lines checked </pre> checkpatch: perf_counter: kerneltop: output event support <pre>commit 00f0ad73ac90e3fba8b4cbe4cf21b2fb9a56cb72 Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Date: Wed Mar 25 12:30:27 2009 +0100 perf_counter: kerneltop: output event support Teach kerneltop about the new output ABI. XXX: anybody fancy integrating the PID/TID data into the output? Bump the mmap_data pages a little because we bloated the output and have to be more careful about overruns with structured data. Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Cc: Paul Mackerras &lt;paulus@samba.org&gt; Cc: Mike Galbraith &lt;efault@gmx.de&gt; Cc: Arjan van de Ven &lt;arjan@infradead.org&gt; Cc: Wu Fengguang &lt;fengguang.wu@intel.com&gt; Orig-LKML-Reference: &lt;20090325113317.192910290@chello.nl&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>WARNING: line over 80 characters #105: FILE: Documentation/perf_counter/kerneltop.c:1206: + cpy = min(md-&gt;mask + 1 - (offset &amp; md-&gt;mask), len); total: 0 errors, 1 warnings, 106 lines checked </pre> checkpatch: perf_counter: executable mmap() information <pre>commit 0a4a93919bdc5cee48fe4367591e8e0449c1086c Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Date: Mon Mar 30 19:07:05 2009 +0200 perf_counter: executable mmap() information Currently the profiling information returns userspace IPs but no way to correlate them to userspace code. Userspace could look into /proc/$pid/maps but that might not be current or even present anymore at the time of analyzing the IPs. Therefore provide means to track the mmap information and provide it in the output stream. XXX: only covers mmap()/munmap(), mremap() and mprotect() are missing. Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Acked-by: Paul Mackerras &lt;paulus@samba.org&gt; Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt; Orig-LKML-Reference: &lt;20090330171023.417259499@chello.nl&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #31: FILE: include/linux/perf_counter.h:140: + include_tid : 1, /* include the tid */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #32: FILE: include/linux/perf_counter.h:141: + mmap : 1, /* include mmap data */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #33: FILE: include/linux/perf_counter.h:142: + munmap : 1, /* include munmap data */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #36: FILE: include/linux/perf_counter.h:144: + __reserved_1 : 52; ^ total: 4 errors, 0 warnings, 234 lines checked </pre> checkpatch: perf_counter: kerneltop: parse the mmap data stream <pre>commit 3c1ba6fafecaed295017881f8863a18602f32c1d Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Date: Mon Mar 30 19:07:06 2009 +0200 perf_counter: kerneltop: parse the mmap data stream frob the kerneltop code to print the mmap data in the stream Better use would be collecting the IPs per PID and mapping them onto the provided userspace code.. TODO Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Acked-by: Paul Mackerras &lt;paulus@samba.org&gt; Orig-LKML-Reference: &lt;20090330171023.501902515@chello.nl&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: do not initialise statics to 0 or NULL #24: FILE: Documentation/perf_counter/kerneltop.c:187: +static int use_mmap = 0; ERROR: do not initialise statics to 0 or NULL #25: FILE: Documentation/perf_counter/kerneltop.c:188: +static int use_munmap = 0; WARNING: line over 80 characters #47: FILE: Documentation/perf_counter/kerneltop.c:1063: + int c = getopt_long(argc, argv, &quot;+:ac:C:d:De:f:g:hn:m:p:s:Sx:zMU&quot;, ERROR: trailing statements should be on next line #55: FILE: Documentation/perf_counter/kerneltop.c:1101: + case &#39;M&#39;: use_mmap = 1; break; ERROR: trailing statements should be on next line #56: FILE: Documentation/perf_counter/kerneltop.c:1102: + case &#39;U&#39;: use_munmap = 1; break; WARNING: do not add new typedefs #81: FILE: Documentation/perf_counter/kerneltop.c:1197: + typedef union event_union { WARNING: %Ld/%Lu are not-standard C, use %lld/%llu #112: FILE: Documentation/perf_counter/kerneltop.c:1239: + printf(&quot;%s: %Lu %Lu %Lu %s\n&quot;, total: 4 errors, 3 warnings, 103 lines checked </pre> checkpatch: perf_counter tools: optionally scale counter values in perfstat mode <pre>commit 31f004df8d14212f0a8a2fb12a8ed44a3d80e2fb Author: Paul Mackerras &lt;paulus@samba.org&gt; Date: Mon Mar 30 19:07:10 2009 +0200 perf_counter tools: optionally scale counter values in perfstat mode Impact: new functionality This adds add an option to the perfstat mode of kerneltop to scale the reported counter values according to the fraction of time that each counter gets to count. This is invoked with the -l option (I used &#39;l&#39; because s, c, a and e were all taken already.) This uses the new PERF_RECORD_TOTAL_TIME_{ENABLED,RUNNING} read format options. With this, we get output like this: $ ./perfstat -l -e 0:0,0:1,0:2,0:3,0:4,0:5 ./spin Performance counter stats for &#39;./spin&#39;: 4016072055 CPU cycles (events) (scaled from 66.53%) 2005887318 instructions (events) (scaled from 66.53%) 1762849 cache references (events) (scaled from 66.69%) 165229 cache misses (events) (scaled from 66.85%) 1001298009 branches (events) (scaled from 66.78%) 41566 branch misses (events) (scaled from 66.61%) Wall-clock time elapsed: 2438.227446 msecs This also lets us detect when a counter is zero because the counter never got to go on the CPU at all. In that case we print &lt;not counted&gt; rather than 0. Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt; Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Orig-LKML-Reference: &lt;20090330171023.871484899@chello.nl&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>WARNING: line over 80 characters #115: FILE: Documentation/perf_counter/kerneltop.c:545: + ((double)count[0] * count[1] / count[2] + 0.5); WARNING: line over 80 characters #154: FILE: Documentation/perf_counter/kerneltop.c:1096: + int c = getopt_long(argc, argv, &quot;+:ac:C:d:De:f:g:hln:m:p:s:Sx:zMU&quot;, ERROR: trailing statements should be on next line #162: FILE: Documentation/perf_counter/kerneltop.c:1120: + case &#39;l&#39;: scale = 1; break; total: 1 errors, 2 warnings, 116 lines checked </pre> checkpatch: perf_counter: provide generic callchain bits <pre>commit 394ee07623cf556c8daae2b3c00cf5fea47f0811 Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Date: Mon Mar 30 19:07:14 2009 +0200 perf_counter: provide generic callchain bits Provide the generic callchain support bits. If hw_event-&gt;callchain is set the arch specific perf_callchain() function is called upon to provide a perf_callchain_entry structure filled with the current callchain. If it does so, it is added to the overflow output event. Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Acked-by: Paul Mackerras &lt;paulus@samba.org&gt; Orig-LKML-Reference: &lt;20090330171024.254266860@chello.nl&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #26: FILE: include/linux/perf_counter.h:143: + callchain : 1, /* add callchain data */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #29: FILE: include/linux/perf_counter.h:145: + __reserved_1 : 51; ^ total: 2 errors, 0 warnings, 83 lines checked </pre> badincludes: perf_counter: pmc arbitration <pre>commit 4e935e47177c3b26cf383e79849bae2a464d0160 Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Date: Mon Mar 30 19:07:16 2009 +0200 perf_counter: pmc arbitration Follow the example set by powerpc and try to play nice with oprofile and the nmi watchdog. Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Acked-by: Paul Mackerras &lt;paulus@samba.org&gt; Orig-LKML-Reference: &lt;20090330171024.459968444@chello.nl&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>diff --git a/arch/x86/kernel/cpu/perf_counter.c b/arch/x86/kernel/cpu/perf_counter.c index e16dfaf..2a946a1 100644 --- a/arch/x86/kernel/cpu/perf_counter.c +++ b/arch/x86/kernel/cpu/perf_counter.c @@ -20,6 +20,7 @@ #include &lt;asm/apic.h&gt; #include &lt;asm/stacktrace.h&gt; +#include &lt;asm/nmi.h&gt; static bool perf_counters_initialized __read_mostly; include asm/nmi.h inserted after asm/stacktrace.h </pre> checkpatch: perf_counter tools: kerneltop: add real-time data acquisition thread <pre>commit 9dd499889bdb12ac0e412ccdd718fe0d348258f2 Author: Mike Galbraith &lt;efault@gmx.de&gt; Date: Fri Mar 27 12:13:43 2009 +0100 perf_counter tools: kerneltop: add real-time data acquisition thread Decouple kerneltop display from event acquisition by introducing a separate data acquisition thread. This fixes annnoying kerneltop display refresh jitter and missed events. Also add a -r &lt;prio&gt; option, to switch the data acquisition thread to real-time priority. Signed-off-by: Mike Galbraith &lt;efault@gmx.de&gt; Cc: Paul Mackerras &lt;paulus@samba.org&gt; Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Orig-LKML-Reference: &lt;new-submission&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: do not initialise statics to 0 or NULL #36: FILE: Documentation/perf_counter/kerneltop.c:186: +static unsigned int realtime_prio = 0; WARNING: line over 80 characters #44: FILE: Documentation/perf_counter/kerneltop.c:340: + &quot; -r prio --realtime=&lt;prio&gt; # event acquisition runs with SCHED_FIFO policy\n&quot; WARNING: line over 80 characters #113: FILE: Documentation/perf_counter/kerneltop.c:1109: + int c = getopt_long(argc, argv, &quot;+:ac:C:d:De:f:g:hln:m:p:r:s:Sx:zMU&quot;, ERROR: trailing statements should be on next line #121: FILE: Documentation/perf_counter/kerneltop.c:1143: + case &#39;r&#39;: realtime_prio = atoi(optarg); break; total: 2 errors, 2 warnings, 137 lines checked </pre> checkpatch: perf_counter: move the event overflow output bits to record_type <pre>commit 8a057d84912f36e53f970c4d177cb4bb6b2f9e08 Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Date: Thu Apr 2 11:11:59 2009 +0200 perf_counter: move the event overflow output bits to record_type Per suggestion from Paul, move the event overflow bits to record_type and sanitize the enums a bit. Breaks the ABI -- again ;-) Suggested-by: Paul Mackerras &lt;paulus@samba.org&gt; Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Cc: Corey Ashford &lt;cjashfor@linux.vnet.ibm.com&gt; Orig-LKML-Reference: &lt;20090402091319.151921176@chello.nl&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #76: FILE: include/linux/perf_counter.h:145: + __reserved_1 : 53; ^ total: 1 errors, 0 warnings, 227 lines checked </pre> checkpatch: perf_counter: kerneltop: update to new ABI <pre>commit 3df70fd623bb109e0079e697c0276d220a4b7908 Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Date: Thu Apr 2 11:12:02 2009 +0200 perf_counter: kerneltop: update to new ABI Update to reflect the new record_type ABI changes. Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Cc: Paul Mackerras &lt;paulus@samba.org&gt; Cc: Corey Ashford &lt;cjashfor@linux.vnet.ibm.com&gt; Orig-LKML-Reference: &lt;20090402091319.407283141@chello.nl&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>WARNING: line over 80 characters #34: FILE: Documentation/perf_counter/kerneltop.c:1281: + case PERF_EVENT_COUNTER_OVERFLOW | __PERF_EVENT_IP | __PERF_EVENT_TID: WARNING: line over 80 characters #43: FILE: Documentation/perf_counter/kerneltop.c:1340: + hw_event.record_type = PERF_RECORD_IP | PERF_RECORD_TID; total: 0 errors, 2 warnings, 28 lines checked </pre> coccinelle: tomoyo: remove "undelete domain" command. <pre>commit 7ba5779533819fc061b4afafcb4a609d55f37057 Author: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt; Date: Mon Apr 6 20:49:14 2009 +0900 tomoyo: remove &quot;undelete domain&quot; command. Since TOMOYO&#39;s policy management tools does not use the &quot;undelete domain&quot; command, we decided to remove that command. Signed-off-by: Kentaro Takeda &lt;takedakn@nttdata.co.jp&gt; Signed-off-by: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt; Signed-off-by: Toshiharu Harada &lt;haradats@nttdata.co.jp&gt; Signed-off-by: James Morris &lt;jmorris@namei.org&gt; </pre>---<pre>rules/mutex2.cocci: // A mutex should be manipulated using mutex_lock and mutex_unlock // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/mutex2.html // Options: diff --git a/security/tomoyo/domain.c b/security/tomoyo/domain.c index 2f2b449..2049cf3 100644 --- a/tmp/dEjvZtPlB8.c +++ b/tmp/ykAo664lod.c @@ -68,12 +68,12 @@ void tomoyo_set_domain_flag(struct tomoyo_domain_info *domain, /* We need to serialize because this is bitfield operation. */ static DEFINE_SPINLOCK(lock); /***** CRITICAL SECTION START *****/ - spin_lock(&amp;lock); + mutex_lock(&amp;lock); if (!is_delete) domain-&gt;flags |= flags; else domain-&gt;flags &amp;= ~flags; - spin_unlock(&amp;lock); + mutex_unlock(&amp;lock); /***** CRITICAL SECTION END *****/ } </pre> checkpatch: perf_counter: counter overflow limit <pre>commit 79f146415623fe74f39af67c0f6adc208939a410 Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Date: Mon Apr 6 11:45:07 2009 +0200 perf_counter: counter overflow limit Provide means to auto-disable the counter after &#39;n&#39; overflow events. Create the counter with hw_event.disabled = 1, and then issue an ioctl(fd, PREF_COUNTER_IOC_REFRESH, n); to set the limit and enable the counter. Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Cc: Paul Mackerras &lt;paulus@samba.org&gt; Cc: Corey Ashford &lt;cjashfor@linux.vnet.ibm.com&gt; LKML-Reference: &lt;20090406094518.083139737@chello.nl&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>WARNING: space prohibited between function name and open parenthesis &#39;(&#39; #28: FILE: include/linux/perf_counter.h:158: +#define PERF_COUNTER_IOC_ENABLE _IO (&#39;$&#39;, 0) WARNING: space prohibited between function name and open parenthesis &#39;(&#39; #29: FILE: include/linux/perf_counter.h:159: +#define PERF_COUNTER_IOC_DISABLE _IO (&#39;$&#39;, 1) total: 0 errors, 2 warnings, 115 lines checked </pre> checkpatch: perf_counter tools: kerneltop: display per function percentage along with event count <pre>commit 6278af660ff83fbafb18e53fc2747eb2ee6780fa Author: Mike Galbraith &lt;efault@gmx.de&gt; Date: Thu Apr 2 10:40:28 2009 +0200 perf_counter tools: kerneltop: display per function percentage along with event count ------------------------------------------------------------------------------ KernelTop: 90551 irqs/sec kernel:15.0% [NMI, 100000 CPU cycles], (all, 4 CPUs) ------------------------------------------------------------------------------ events pcnt RIP kernel function ______ ______ _____ ________________ _______________ 16871.00 - 19.1% - ffffffff80328e20 : clear_page_c 8810.00 - 9.9% - ffffffff8048ce80 : page_fault 4746.00 - 5.4% - ffffffff8048cae2 : _spin_lock 4428.00 - 5.0% - ffffffff80328e70 : copy_page_c 3340.00 - 3.8% - ffffffff80329090 : copy_user_generic_string! 2679.00 - 3.0% - ffffffff8028a16b : get_page_from_freelist 2254.00 - 2.5% - ffffffff80296f19 : unmap_vmas 2082.00 - 2.4% - ffffffff80297e19 : handle_mm_fault 1754.00 - 2.0% - ffffffff80288dc8 : __rmqueue_smallest 1553.00 - 1.8% - ffffffff8048ca58 : _spin_lock_irqsave 1400.00 - 1.6% - ffffffff8028cdc8 : release_pages 1337.00 - 1.5% - ffffffff80285400 : find_get_page 1335.00 - 1.5% - ffffffff80225a23 : do_page_fault 1299.00 - 1.5% - ffffffff802ba8e7 : __d_lookup 1174.00 - 1.3% - ffffffff802b38f3 : __link_path_walk 1155.00 - 1.3% - ffffffff802843e1 : perf_swcounter_ctx_event! 1137.00 - 1.3% - ffffffff8028d118 : ____pagevec_lru_add 963.00 - 1.1% - ffffffff802a670b : kmem_cache_alloc 885.00 - 1.0% - ffffffff8024bc61 : __wake_up_bit Display per function percentage along with event count. Signed-off-by: Mike Galbraith &lt;efault@gmx.de&gt; Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Cc: Paul Mackerras &lt;paulus@samba.org&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: space prohibited after that open parenthesis &#39;(&#39; #62: FILE: Documentation/perf_counter/kerneltop.c:652: + printf( &quot; KernelTop:%8.0f irqs/sec kernel:%4.1f%% [%s, &quot;, WARNING: line over 80 characters #78: FILE: Documentation/perf_counter/kerneltop.c:691: + &quot; ______ ______ _____ ________________ _______________\n\n&quot; ERROR: code indent should use tabs where possible #78: FILE: Documentation/perf_counter/kerneltop.c:691: +^I ^I &quot; ______ ______ _____ ________________ _______________\n\n&quot;$ WARNING: line over 80 characters #104: FILE: Documentation/perf_counter/kerneltop.c:699: + pcnt = 100.0 - (100.0*((sum_kevents-tmp[i].count[0])/sum_kevents)); total: 2 errors, 2 warnings, 73 lines checked </pre> badincludes: x86, ds: add leakage warning <pre>commit 2311f0de21c17b2a8b960677a9cccfbfa52beb35 Author: Markus Metzger &lt;markus.t.metzger@intel.com&gt; Date: Fri Apr 3 16:43:46 2009 +0200 x86, ds: add leakage warning Add a warning in case a debug store context is not removed before the task it is attached to is freed. Remove the old warning at thread exit. It is too early. Declare the debug store context field in thread_struct unconditionally. Remove ds_copy_thread() and ds_exit_thread() and do the work directly in process*.c. Signed-off-by: Markus Metzger &lt;markus.t.metzger@intel.com&gt; Cc: roland@redhat.com Cc: eranian@googlemail.com Cc: oleg@redhat.com Cc: juan.villacis@intel.com Cc: ak@linux.jf.intel.com LKML-Reference: &lt;20090403144601.254472000@intel.com&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index ca98915..fb5dfb8 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -14,6 +14,7 @@ #include &lt;asm/idle.h&gt; #include &lt;asm/uaccess.h&gt; #include &lt;asm/i387.h&gt; +#include &lt;asm/ds.h&gt; unsigned long idle_halt; EXPORT_SYMBOL(idle_halt); include asm/ds.h inserted after asm/i387.h </pre> coccinelle: tracing/ftrace: factorize the tracing files creation <pre>commit 5452af664f6fba26b80eb2c8c4ceae2999d5cf56 Author: Frederic Weisbecker &lt;fweisbec@gmail.com&gt; Date: Fri Mar 27 00:25:38 2009 +0100 tracing/ftrace: factorize the tracing files creation Impact: cleanup Most of the tracing files creation follow the same pattern: ret = debugfs_create_file(...) if (!ret) pr_warning(&quot;Couldn&#39;t create ... entry\n&quot;) Unify it! Reported-by: Ingo Molnar &lt;mingo@elte.hu&gt; Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt; LKML-Reference: &lt;1238109938-11840-1-git-send-email-fweisbec@gmail.com&gt; Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 6ea5a1a..3befdfb 100644 --- a/tmp/dTMeMm8swq.c +++ b/tmp/JZnAD91OgT.c @@ -481,7 +481,7 @@ static int ftrace_profile_init_cpu(int cpu) */ size = FTRACE_PROFILE_HASH_SIZE; - stat-&gt;hash = kzalloc(sizeof(struct hlist_head) * size, GFP_KERNEL); + stat-&gt;hash = kcalloc(size, sizeof(struct hlist_head), GFP_KERNEL); if (!stat-&gt;hash) return -ENOMEM; rules/mut.cocci: // A mutex_lock is not matched by a mutex_unlock before an error return. // // Confidence: Moderate // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/mut.html // Options: -no_includes -include_headers diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 6ea5a1a..aa97d83 100644 --- a/tmp/dTMeMm8swq.c +++ b/tmp/wA76m1uoSD.c @@ -1518,9 +1518,11 @@ static void *t_start(struct seq_file *m, loff_t *pos) */ if (iter-&gt;flags &amp; FTRACE_ITER_FILTER &amp;&amp; !ftrace_filtered) { if (*pos &gt; 0) + mutex_unlock(&amp;ftrace_lock); return t_hash_start(m, pos); iter-&gt;flags |= FTRACE_ITER_PRINTALL; (*pos)++; + mutex_unlock(&amp;ftrace_lock); return iter; } </pre> coccinelle: function-graph: use int instead of atomic for ftrace_graph_active <pre>commit 597af81537654097b67fd7a0c92775e66d4a86fe Author: Steven Rostedt &lt;srostedt@redhat.com&gt; Date: Fri Apr 3 15:24:12 2009 -0400 function-graph: use int instead of atomic for ftrace_graph_active Impact: cleanup The variable ftrace_graph_active is only modified under the ftrace_lock mutex, thus an atomic is not necessary for modification. Reported-by: Andrew Morton &lt;akpm@linux-foundation.org&gt; Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 8e6a0b5..c4cf1e7 100644 --- a/tmp/Rm0NyqMrDH.c +++ b/tmp/0ymGA7oMdh.c @@ -481,7 +481,7 @@ static int ftrace_profile_init_cpu(int cpu) */ size = FTRACE_PROFILE_HASH_SIZE; - stat-&gt;hash = kzalloc(sizeof(struct hlist_head) * size, GFP_KERNEL); + stat-&gt;hash = kcalloc(size, sizeof(struct hlist_head), GFP_KERNEL); if (!stat-&gt;hash) return -ENOMEM; rules/mut.cocci: // A mutex_lock is not matched by a mutex_unlock before an error return. // // Confidence: Moderate // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/mut.html // Options: -no_includes -include_headers diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 8e6a0b5..f271cac 100644 --- a/tmp/Rm0NyqMrDH.c +++ b/tmp/efmTJ0k3Bv.c @@ -1518,9 +1518,11 @@ static void *t_start(struct seq_file *m, loff_t *pos) */ if (iter-&gt;flags &amp; FTRACE_ITER_FILTER &amp;&amp; !ftrace_filtered) { if (*pos &gt; 0) + mutex_unlock(&amp;ftrace_lock); return t_hash_start(m, pos); iter-&gt;flags |= FTRACE_ITER_PRINTALL; (*pos)++; + mutex_unlock(&amp;ftrace_lock); return iter; } </pre> checkpatch: ASoC: Provide core support for symmetric sample rates <pre>commit 06f409d76f1d382167eb1cadde2e23a73272865d Author: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt; Date: Tue Apr 7 18:10:13 2009 +0100 ASoC: Provide core support for symmetric sample rates Many devices require symmetric configurations of capture and playback data formats, often due to shared clocking but sometimes also due to other shared playback and record configuration in the device. Start providing core support for this by allowing the DAIs or the machine to specify that the sample rates used should be kept symmetric. A flag symmetric_rates is provided in the snd_soc_dai and snd_soc_dai_link structures. If this is set in either of the DAIs or in the machine then a constraint will be applied when a stream is already open preventing any changes in sample rate. Signed-off-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt; </pre>---<pre>ERROR: trailing whitespace #68: FILE: sound/soc/soc-core.c:128: +^I^Idev_dbg(card-&gt;dev, &quot;Symmetry forces %dHz rate\n&quot;, $ WARNING: line over 80 characters #77: FILE: sound/soc/soc-core.c:137: + &quot;Unable to apply rate symmetry constraint: %d\n&quot;, ret); total: 1 errors, 1 warnings, 75 lines checked </pre> checkpatch: perf_counter: powerpc: set sample enable bit for marked instruction events <pre>commit f708223d49ac39f5af1643985056206c98033f5b Author: Paul Mackerras &lt;paulus@samba.org&gt; Date: Wed Apr 8 20:30:18 2009 +1000 perf_counter: powerpc: set sample enable bit for marked instruction events Impact: enable access to hardware feature POWER processors have the ability to &quot;mark&quot; a subset of the instructions and provide more detailed information on what happens to the marked instructions as they flow through the pipeline. This marking is enabled by the &quot;sample enable&quot; bit in MMCRA, and there are synchronization requirements around setting and clearing the bit. This adds logic to the processor-specific back-ends so that they know which events relate to marked instructions and set the sampling enable bit if any event that we want to put on the PMU is a marked instruction event. It also adds logic to the generic powerpc code to do the necessary synchronization if that bit is set. Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt; Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; LKML-Reference: &lt;18908.31930.1024.228867@cargo.ozlabs.ibm.com&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: trailing whitespace #441: FILE: arch/powerpc/kernel/power6-pmu.c:132: +^I$ ERROR: spaces required around that &#39;?&#39; (ctx:VxW) #568: FILE: arch/powerpc/kernel/ppc970-pmu.c:161: + bit = (pmc &lt;= 4)? pmc - 1: 8 - pmc; ^ ERROR: spaces required around that &#39;:&#39; (ctx:VxW) #568: FILE: arch/powerpc/kernel/ppc970-pmu.c:161: + bit = (pmc &lt;= 4)? pmc - 1: 8 - pmc; ^ total: 3 errors, 0 warnings, 569 lines checked </pre> coccinelle: swiotlb: comment corrections <pre>commit ceb5ac3264686e75e6951de6a18d4baa9bdecb92 Author: Becky Bruce &lt;beckyb@kernel.crashing.org&gt; Date: Wed Apr 8 09:09:15 2009 -0500 swiotlb: comment corrections Impact: cleanup swiotlb_map/unmap_single are now swiotlb_map/unmap_page; trivially change all the comments to reference new names. Also, there were some comments that should have been referring to just plain old map_single, not swiotlb_map_single; fix those as well. Also change a use of the word &quot;pointer&quot;, when what is referred to is actually a dma/physical address. Signed-off-by: Becky Bruce &lt;beckyb@kernel.crashing.org&gt; Acked-by: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt; Signed-off-by: Kumar Gala &lt;galak@kernel.crashing.org&gt; Cc: jeremy@goop.org Cc: ian.campbell@citrix.com LKML-Reference: &lt;1239199761-22886-2-git-send-email-galak@kernel.crashing.org&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/bootmem.cocci: // alloc_bootmem and variants never return NULL and always zero the allocated // data // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/bootmem.html // Options: -no_includes -include_headers diff --git a/lib/swiotlb.c b/lib/swiotlb.c index 170cf56..c800f8a 100644 --- a/tmp/O4VgAbn5vL.c +++ b/tmp/EVtTeDjBcc.c @@ -203,8 +203,6 @@ swiotlb_init_with_default_size(size_t default_size) * Get the overflow emergency buffer */ io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow); - if (!io_tlb_overflow_buffer) - panic(&quot;Cannot allocate SWIOTLB overflow buffer!\n&quot;); swiotlb_print_info(bytes); } </pre> coccinelle: swiotlb: fix compile warning <pre>commit 67131ad0514d7105b55003a0506209cf1bba3f00 Author: Becky Bruce &lt;beckyb@kernel.crashing.org&gt; Date: Wed Apr 8 09:09:16 2009 -0500 swiotlb: fix compile warning Squash a build warning seen on 32-bit powerpc caused by calling min() with 2 different types. Use min_t() instead. Signed-off-by: Becky Bruce &lt;beckyb@kernel.crashing.org&gt; Acked-by: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt; Signed-off-by: Kumar Gala &lt;galak@kernel.crashing.org&gt; Cc: jeremy@goop.org Cc: ian.campbell@citrix.com LKML-Reference: &lt;1239199761-22886-3-git-send-email-galak@kernel.crashing.org&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/bootmem.cocci: // alloc_bootmem and variants never return NULL and always zero the allocated // data // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/bootmem.html // Options: -no_includes -include_headers diff --git a/lib/swiotlb.c b/lib/swiotlb.c index 4fd6a76..4645c90 100644 --- a/tmp/o4QYSERy1L.c +++ b/tmp/h0LUdDmd6U.c @@ -203,8 +203,6 @@ swiotlb_init_with_default_size(size_t default_size) * Get the overflow emergency buffer */ io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow); - if (!io_tlb_overflow_buffer) - panic(&quot;Cannot allocate SWIOTLB overflow buffer!\n&quot;); swiotlb_print_info(bytes); } </pre> coccinelle: swiotlb: map_page fix for highmem systems <pre>commit dd6b02fe427f30520d0adc94aa52352367227873 Author: Becky Bruce &lt;beckyb@kernel.crashing.org&gt; Date: Wed Apr 8 09:09:17 2009 -0500 swiotlb: map_page fix for highmem systems The current code calls virt_to_phys() on address that might be in highmem, which is bad. This wasn&#39;t needed, anyway, because we already have the physical address we need. Get rid of the now-unused virtual address as well. Signed-off-by: Becky Bruce &lt;beckyb@kernel.crashing.org&gt; Acked-by: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt; Signed-off-by: Kumar Gala &lt;galak@kernel.crashing.org&gt; Cc: jeremy@goop.org Cc: ian.campbell@citrix.com LKML-Reference: &lt;1239199761-22886-4-git-send-email-galak@kernel.crashing.org&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/bootmem.cocci: // alloc_bootmem and variants never return NULL and always zero the allocated // data // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/bootmem.html // Options: -no_includes -include_headers diff --git a/lib/swiotlb.c b/lib/swiotlb.c index e8a47c8..e380970 100644 --- a/tmp/AYCPMdpgJh.c +++ b/tmp/8XTvERJKlL.c @@ -203,8 +203,6 @@ swiotlb_init_with_default_size(size_t default_size) * Get the overflow emergency buffer */ io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow); - if (!io_tlb_overflow_buffer) - panic(&quot;Cannot allocate SWIOTLB overflow buffer!\n&quot;); swiotlb_print_info(bytes); } </pre> coccinelle: swiotlb: allow arch override of address_needs_mapping <pre>commit ef5722f698bde01cfec2b98fff733a48663ebf55 Author: Becky Bruce &lt;beckyb@kernel.crashing.org&gt; Date: Wed Apr 8 09:09:18 2009 -0500 swiotlb: allow arch override of address_needs_mapping Some architectures require additional checking to determine if a device can dma to an address and need to provide their own address_needs_mapping.. Signed-off-by: Becky Bruce &lt;beckyb@kernel.crashing.org&gt; Acked-by: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt; Signed-off-by: Kumar Gala &lt;galak@kernel.crashing.org&gt; Cc: jeremy@goop.org Cc: ian.campbell@citrix.com LKML-Reference: &lt;1239199761-22886-5-git-send-email-galak@kernel.crashing.org&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/bootmem.cocci: // alloc_bootmem and variants never return NULL and always zero the allocated // data // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/bootmem.html // Options: -no_includes -include_headers diff --git a/lib/swiotlb.c b/lib/swiotlb.c index d81afab..a3c6e6e 100644 --- a/tmp/7xkDWEm4LA.c +++ b/tmp/ldSLreIGZi.c @@ -209,8 +209,6 @@ swiotlb_init_with_default_size(size_t default_size) * Get the overflow emergency buffer */ io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow); - if (!io_tlb_overflow_buffer) - panic(&quot;Cannot allocate SWIOTLB overflow buffer!\n&quot;); swiotlb_print_info(bytes); } </pre> coccinelle: swiotlb: rename unmap_single to do_unmap_single <pre>commit 7fcebbd2d984eac3fdd6da2f4453e7c43d32de89 Author: Becky Bruce &lt;beckyb@kernel.crashing.org&gt; Date: Wed Apr 8 09:09:19 2009 -0500 swiotlb: rename unmap_single to do_unmap_single Previously, swiotlb_unmap_page and swiotlb_unmap_sg were duplicating very similar code. Refactor that code into a new unmap_single and unmap_single use do_unmap_single. Note that the swiotlb_unmap_sg code was previously doing a complicated comparison to determine if an addresses needed to be unmapped where a simple is_swiotlb_buffer() call would have sufficed. Signed-off-by: Becky Bruce &lt;beckyb@kernel.crashing.org&gt; Signed-off-by: Kumar Gala &lt;galak@kernel.crashing.org&gt; Cc: jeremy@goop.org Cc: ian.campbell@citrix.com LKML-Reference: &lt;1239199761-22886-6-git-send-email-galak@kernel.crashing.org&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/bootmem.cocci: // alloc_bootmem and variants never return NULL and always zero the allocated // data // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/bootmem.html // Options: -no_includes -include_headers diff --git a/lib/swiotlb.c b/lib/swiotlb.c index 2bde54a..9ffb319 100644 --- a/tmp/yQIxdq4B9j.c +++ b/tmp/FbEVExiYl3.c @@ -209,8 +209,6 @@ swiotlb_init_with_default_size(size_t default_size) * Get the overflow emergency buffer */ io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow); - if (!io_tlb_overflow_buffer) - panic(&quot;Cannot allocate SWIOTLB overflow buffer!\n&quot;); swiotlb_print_info(bytes); } </pre> coccinelle: swiotlb: use swiotlb_sync_single instead of duplicating code <pre>commit 380d687833aee098c4a2c3b35beaefe1c1f48d01 Author: Becky Bruce &lt;beckyb@kernel.crashing.org&gt; Date: Wed Apr 8 09:09:20 2009 -0500 swiotlb: use swiotlb_sync_single instead of duplicating code Right now both swiotlb_sync_single_range and swiotlb_sync_sg were duplicating the code in swiotlb_sync_single. Just call it instead. Also rearrange the sync_single code for readability. Note that the swiotlb_sync_sg code was previously doing a complicated comparison to determine if an addresses needed to be unmapped where a simple is_swiotlb_buffer() call would have sufficed. Signed-off-by: Becky Bruce &lt;beckyb@kernel.crashing.org&gt; Acked-by: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt; Signed-off-by: Kumar Gala &lt;galak@kernel.crashing.org&gt; Cc: jeremy@goop.org Cc: ian.campbell@citrix.com LKML-Reference: &lt;1239199761-22886-7-git-send-email-galak@kernel.crashing.org&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/bootmem.cocci: // alloc_bootmem and variants never return NULL and always zero the allocated // data // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/bootmem.html // Options: -no_includes -include_headers diff --git a/lib/swiotlb.c b/lib/swiotlb.c index d912f06..e4486a8 100644 --- a/tmp/zt9W0pJ3Yk.c +++ b/tmp/W11cXDiFw8.c @@ -209,8 +209,6 @@ swiotlb_init_with_default_size(size_t default_size) * Get the overflow emergency buffer */ io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow); - if (!io_tlb_overflow_buffer) - panic(&quot;Cannot allocate SWIOTLB overflow buffer!\n&quot;); swiotlb_print_info(bytes); } </pre> coccinelle: swiotlb: change swiotlb_bus_to[phys,virt] prototypes <pre>commit 42d7c5e353cef9062129b0de3ec9ddf10567b9ca Author: Becky Bruce &lt;beckyb@kernel.crashing.org&gt; Date: Wed Apr 8 09:09:21 2009 -0500 swiotlb: change swiotlb_bus_to[phys,virt] prototypes Add a hwdev argument that is needed on some architectures in order to access a per-device offset that is taken into account when producing a physical address (also needed to get from bus address to virtual address because the physical address is an intermediate step). Also make swiotlb_bus_to_virt weak so architectures can override it. Signed-off-by: Becky Bruce &lt;beckyb@kernel.crashing.org&gt; Acked-by: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt; Signed-off-by: Kumar Gala &lt;galak@kernel.crashing.org&gt; Cc: jeremy@goop.org Cc: ian.campbell@citrix.com LKML-Reference: &lt;1239199761-22886-8-git-send-email-galak@kernel.crashing.org&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/bootmem.cocci: // alloc_bootmem and variants never return NULL and always zero the allocated // data // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/bootmem.html // Options: -no_includes -include_headers diff --git a/lib/swiotlb.c b/lib/swiotlb.c index bffe6d7..70583b3 100644 --- a/tmp/vFyZTwM4Zf.c +++ b/tmp/gVrt8FvnVV.c @@ -209,8 +209,6 @@ swiotlb_init_with_default_size(size_t default_size) * Get the overflow emergency buffer */ io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow); - if (!io_tlb_overflow_buffer) - panic(&quot;Cannot allocate SWIOTLB overflow buffer!\n&quot;); swiotlb_print_info(bytes); } </pre> checkpatch: percpu: remove rbtree and use page->index instead <pre>commit e1b9aa3f47242e757c776a3771bb6613e675bf9c Author: Christoph Lameter &lt;cl@linux.com&gt; Date: Thu Apr 2 13:21:44 2009 +0900 percpu: remove rbtree and use page-&gt;index instead Impact: use page-&gt;index for addr to chunk mapping instead of dedicated rbtree The rbtree is used to determine the chunk from the virtual address. However, we can already determine the page struct from a virtual address and there are several unused fields in page struct used by vmalloc. Use the index field to store a pointer to the chunk. Then there is no need anymore for an rbtree. tj: * s/(set|get)_chunk/pcpu_\1_page_chunk/ * Drop inline from the above two functions and moved them upwards so that they are with other simple helpers. * Initial pages might not (actually most of the time don&#39;t) live in the vmalloc area. With the previous patch to manually reverse-map both first chunks, this is no longer an issue. Removed pcpu_set_chunk() call on initial pages. Signed-off-by: Christoph Lameter &lt;cl@linux.com&gt; Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt; Cc: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt; Cc: rusty@rustcorp.com.au Cc: Paul Mundt &lt;lethal@linux-sh.org&gt; Cc: rmk@arm.linux.org.uk Cc: starvik@axis.com Cc: ralf@linux-mips.org Cc: davem@davemloft.net Cc: cooloney@kernel.org Cc: kyle@mcmartin.ca Cc: matthew@wil.cx Cc: grundler@parisc-linux.org Cc: takata@linux-m32r.org Cc: benh@kernel.crashing.org Cc: rth@twiddle.net Cc: ink@jurassic.park.msu.ru Cc: heiko.carstens@de.ibm.com Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt; Cc: Nick Piggin &lt;npiggin@suse.de&gt; LKML-Reference: &lt;49D43D58.4050102@kernel.org&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: Aspace prohibited after that &#39;*&#39; (ctx:ExW) #92: FILE: mm/percpu.c:134: + * chunk slots, chunks and area maps in chunks. ^ total: 1 errors, 0 warnings, 179 lines checked </pre> checkpatch: perf_counter: fix NMI race in task clock <pre>commit e30e08f65c7ef6c230424264f09c3d53f117f58b Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Date: Wed Apr 8 15:01:25 2009 +0200 perf_counter: fix NMI race in task clock We should not be updating ctx-&gt;time from NMI context, work around that. Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Cc: Paul Mackerras &lt;paulus@samba.org&gt; Cc: Corey Ashford &lt;cjashfor@linux.vnet.ibm.com&gt; LKML-Reference: &lt;20090408130408.681326666@chello.nl&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>WARNING: line over 80 characters #32: FILE: kernel/perf_counter.c:2336: +static void task_clock_perf_counter_update(struct perf_counter *counter, u64 now) total: 0 errors, 1 warnings, 50 lines checked </pre> checkpatch: perf_counter: kerneltop: keep up with ABI changes <pre>commit 808382b33bb4c60df6379ec2db39f332cc56b82a Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Date: Wed Apr 8 15:01:28 2009 +0200 perf_counter: kerneltop: keep up with ABI changes Update kerneltop to use PERF_EVENT_MISC_OVERFLOW Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Cc: Paul Mackerras &lt;paulus@samba.org&gt; Cc: Corey Ashford &lt;cjashfor@linux.vnet.ibm.com&gt; LKML-Reference: &lt;20090408130408.947197470@chello.nl&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: switch and case should be at the same indent #42: FILE: Documentation/perf_counter/kerneltop.c:1284: + switch (event-&gt;header.type) { + case PERF_EVENT_MMAP: + case PERF_EVENT_MUNMAP: WARNING: %Ld/%Lu are not-standard C, use %lld/%llu #45: FILE: Documentation/perf_counter/kerneltop.c:1287: + printf(&quot;%s: %Lu %Lu %Lu %s\n&quot;, WARNING: line over 80 characters #46: FILE: Documentation/perf_counter/kerneltop.c:1288: + event-&gt;header.type == PERF_EVENT_MMAP total: 1 errors, 2 warnings, 38 lines checked </pre> checkpatch: perf_counter: track task-comm data <pre>commit 8d1b2d9361b494bfc761700c348c65ebbe3deb5b Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Date: Wed Apr 8 15:01:30 2009 +0200 perf_counter: track task-comm data Similar to the mmap data stream, add one that tracks the task COMM field, so that the userspace reporting knows what to call a task. Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Cc: Paul Mackerras &lt;paulus@samba.org&gt; Cc: Corey Ashford &lt;cjashfor@linux.vnet.ibm.com&gt; LKML-Reference: &lt;20090408130409.127422406@chello.nl&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #35: FILE: include/linux/perf_counter.h:145: + comm : 1, /* include comm data */ ^ ERROR: spaces prohibited around that &#39;:&#39; (ctx:WxW) #38: FILE: include/linux/perf_counter.h:147: + __reserved_1 : 52; ^ total: 2 errors, 0 warnings, 147 lines checked </pre> checkpatch: perf_counter: some simple userspace profiling <pre>commit de9ac07bbf8f51e0ce40e5428c3a8f627bd237c2 Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Date: Wed Apr 8 15:01:31 2009 +0200 perf_counter: some simple userspace profiling # perf-record make -j4 kernel/ # perf-report | tail -15 0.39 cc1 [kernel] lock_acquired 0.42 cc1 [kernel] lock_acquire 0.51 cc1 [ user ] /lib64/libc-2.8.90.so: _int_free 0.51 as [kernel] clear_page_c 0.53 cc1 [ user ] /lib64/libc-2.8.90.so: memcpy 0.56 cc1 [ user ] /lib64/libc-2.8.90.so: _IO_vfprintf 0.63 cc1 [kernel] lock_release 0.67 cc1 [ user ] /lib64/libc-2.8.90.so: strlen 0.68 cc1 [kernel] debug_smp_processor_id 1.38 cc1 [ user ] /lib64/libc-2.8.90.so: _int_malloc 1.55 cc1 [ user ] /lib64/libc-2.8.90.so: memset 1.77 cc1 [kernel] __lock_acquire 1.88 cc1 [kernel] clear_page_c 3.61 as [ user ] /usr/bin/as: &lt;unknown&gt; 59.16 cc1 [ user ] /usr/libexec/gcc/x86_64-redhat-linux/4.3.2/cc1: &lt;unknown&gt; Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Cc: Paul Mackerras &lt;paulus@samba.org&gt; Cc: Corey Ashford &lt;cjashfor@linux.vnet.ibm.com&gt; Cc: Arnaldo Carvalho de Melo &lt;acme@ghostprotocols.net&gt; LKML-Reference: &lt;20090408130409.220518450@chello.nl&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: code indent should use tabs where possible #106: FILE: Documentation/perf_counter/perf-record.c:47: + struct timespec ts; \$ ERROR: code indent should use tabs where possible #107: FILE: Documentation/perf_counter/perf-record.c:48: + \$ ERROR: code indent should use tabs where possible #108: FILE: Documentation/perf_counter/perf-record.c:49: + clock_gettime(CLOCK_MONOTONIC, &amp;ts); \$ ERROR: code indent should use tabs where possible #109: FILE: Documentation/perf_counter/perf-record.c:50: + ts.tv_sec * 1000000000ULL + ts.tv_nsec; \$ ERROR: spaces required around that &#39;:&#39; (ctx:WxO) #120: FILE: Documentation/perf_counter/perf-record.c:61: +#define rmb() asm volatile(&quot;lfence&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxO) #120: FILE: Documentation/perf_counter/perf-record.c:61: +#define rmb() asm volatile(&quot;lfence&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxW) #120: FILE: Documentation/perf_counter/perf-record.c:61: +#define rmb() asm volatile(&quot;lfence&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:WxO) #121: FILE: Documentation/perf_counter/perf-record.c:62: +#define cpu_relax() asm volatile(&quot;rep; nop&quot; ::: &quot;memory&quot;); ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxO) #121: FILE: Documentation/perf_counter/perf-record.c:62: +#define cpu_relax() asm volatile(&quot;rep; nop&quot; ::: &quot;memory&quot;); ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxW) #121: FILE: Documentation/perf_counter/perf-record.c:62: +#define cpu_relax() asm volatile(&quot;rep; nop&quot; ::: &quot;memory&quot;); ^ ERROR: spaces required around that &#39;:&#39; (ctx:WxO) #126: FILE: Documentation/perf_counter/perf-record.c:67: +#define rmb() asm volatile(&quot;lfence&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxO) #126: FILE: Documentation/perf_counter/perf-record.c:67: +#define rmb() asm volatile(&quot;lfence&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxW) #126: FILE: Documentation/perf_counter/perf-record.c:67: +#define rmb() asm volatile(&quot;lfence&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:WxO) #127: FILE: Documentation/perf_counter/perf-record.c:68: +#define cpu_relax() asm volatile(&quot;rep; nop&quot; ::: &quot;memory&quot;); ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxO) #127: FILE: Documentation/perf_counter/perf-record.c:68: +#define cpu_relax() asm volatile(&quot;rep; nop&quot; ::: &quot;memory&quot;); ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxW) #127: FILE: Documentation/perf_counter/perf-record.c:68: +#define cpu_relax() asm volatile(&quot;rep; nop&quot; ::: &quot;memory&quot;); ^ ERROR: spaces required around that &#39;:&#39; (ctx:WxO) #132: FILE: Documentation/perf_counter/perf-record.c:73: +#define rmb() asm volatile (&quot;sync&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxO) #132: FILE: Documentation/perf_counter/perf-record.c:73: +#define rmb() asm volatile (&quot;sync&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxW) #132: FILE: Documentation/perf_counter/perf-record.c:73: +#define rmb() asm volatile (&quot;sync&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:WxO) #133: FILE: Documentation/perf_counter/perf-record.c:74: +#define cpu_relax() asm volatile (&quot;&quot; ::: &quot;memory&quot;); ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxO) #133: FILE: Documentation/perf_counter/perf-record.c:74: +#define cpu_relax() asm volatile (&quot;&quot; ::: &quot;memory&quot;); ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxW) #133: FILE: Documentation/perf_counter/perf-record.c:74: +#define cpu_relax() asm volatile (&quot;&quot; ::: &quot;memory&quot;); ^ ERROR: code indent should use tabs where possible #144: FILE: Documentation/perf_counter/perf-record.c:85: + struct perf_counter_hw_event *hw_event_uptr __user,$ ERROR: code indent should use tabs where possible #145: FILE: Documentation/perf_counter/perf-record.c:86: + pid_t pid,$ ERROR: code indent should use tabs where possible #146: FILE: Documentation/perf_counter/perf-record.c:87: + int cpu,$ ERROR: code indent should use tabs where possible #147: FILE: Documentation/perf_counter/perf-record.c:88: + int group_fd,$ ERROR: code indent should use tabs where possible #148: FILE: Documentation/perf_counter/perf-record.c:89: + unsigned long flags)$ ERROR: code indent should use tabs where possible #150: FILE: Documentation/perf_counter/perf-record.c:91: + return syscall($ WARNING: line over 80 characters #151: FILE: Documentation/perf_counter/perf-record.c:92: + __NR_perf_counter_open, hw_event_uptr, pid, cpu, group_fd, flags); ERROR: code indent should use tabs where possible #151: FILE: Documentation/perf_counter/perf-record.c:92: + __NR_perf_counter_open, hw_event_uptr, pid, cpu, group_fd, flags);$ ERROR: do not initialise statics to 0 or NULL #159: FILE: Documentation/perf_counter/perf-record.c:100: +static int nr_counters = 0; ERROR: do not initialise statics to 0 or NULL #164: FILE: Documentation/perf_counter/perf-record.c:105: +static int nr_cpus = 0; ERROR: do not initialise statics to 0 or NULL #169: FILE: Documentation/perf_counter/perf-record.c:110: +static int group = 0; ERROR: do not initialise statics to 0 or NULL #170: FILE: Documentation/perf_counter/perf-record.c:111: +static unsigned int realtime_prio = 0; WARNING: line over 80 characters #207: FILE: Documentation/perf_counter/perf-record.c:148: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_CPU_CYCLES), &quot;cpu-cycles&quot;, }, WARNING: line over 80 characters #208: FILE: Documentation/perf_counter/perf-record.c:149: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_CPU_CYCLES), &quot;cycles&quot;, }, WARNING: line over 80 characters #209: FILE: Documentation/perf_counter/perf-record.c:150: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_INSTRUCTIONS), &quot;instructions&quot;, }, WARNING: line over 80 characters #210: FILE: Documentation/perf_counter/perf-record.c:151: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_CACHE_REFERENCES), &quot;cache-references&quot;, }, WARNING: line over 80 characters #211: FILE: Documentation/perf_counter/perf-record.c:152: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_CACHE_MISSES), &quot;cache-misses&quot;, }, WARNING: line over 80 characters #212: FILE: Documentation/perf_counter/perf-record.c:153: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_BRANCH_INSTRUCTIONS), &quot;branch-instructions&quot;, }, WARNING: line over 80 characters #213: FILE: Documentation/perf_counter/perf-record.c:154: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_BRANCH_INSTRUCTIONS), &quot;branches&quot;, }, WARNING: line over 80 characters #214: FILE: Documentation/perf_counter/perf-record.c:155: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_BRANCH_MISSES), &quot;branch-misses&quot;, }, WARNING: line over 80 characters #215: FILE: Documentation/perf_counter/perf-record.c:156: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_BUS_CYCLES), &quot;bus-cycles&quot;, }, WARNING: line over 80 characters #217: FILE: Documentation/perf_counter/perf-record.c:158: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_CPU_CLOCK), &quot;cpu-clock&quot;, }, WARNING: line over 80 characters #218: FILE: Documentation/perf_counter/perf-record.c:159: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_TASK_CLOCK), &quot;task-clock&quot;, }, WARNING: line over 80 characters #219: FILE: Documentation/perf_counter/perf-record.c:160: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_PAGE_FAULTS), &quot;page-faults&quot;, }, WARNING: line over 80 characters #220: FILE: Documentation/perf_counter/perf-record.c:161: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_PAGE_FAULTS), &quot;faults&quot;, }, WARNING: line over 80 characters #221: FILE: Documentation/perf_counter/perf-record.c:162: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_PAGE_FAULTS_MIN), &quot;minor-faults&quot;, }, WARNING: line over 80 characters #222: FILE: Documentation/perf_counter/perf-record.c:163: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_PAGE_FAULTS_MAJ), &quot;major-faults&quot;, }, WARNING: line over 80 characters #223: FILE: Documentation/perf_counter/perf-record.c:164: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_CONTEXT_SWITCHES), &quot;context-switches&quot;, }, WARNING: line over 80 characters #224: FILE: Documentation/perf_counter/perf-record.c:165: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_CONTEXT_SWITCHES), &quot;cs&quot;, }, WARNING: line over 80 characters #225: FILE: Documentation/perf_counter/perf-record.c:166: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_CPU_MIGRATIONS), &quot;cpu-migrations&quot;, }, WARNING: line over 80 characters #226: FILE: Documentation/perf_counter/perf-record.c:167: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_CPU_MIGRATIONS), &quot;migrations&quot;, }, WARNING: line over 80 characters #313: FILE: Documentation/perf_counter/perf-record.c:254: + &quot;perf-record Options (up to %d event types can be specified at once):\n\n&quot;, ERROR: trailing statements should be on next line #349: FILE: Documentation/perf_counter/perf-record.c:290: + case &#39;c&#39;: default_interval = atoi(optarg); break; WARNING: line over 80 characters #350: FILE: Documentation/perf_counter/perf-record.c:291: + case &#39;e&#39;: error = parse_events(optarg); break; ERROR: trailing statements should be on next line #350: FILE: Documentation/perf_counter/perf-record.c:291: + case &#39;e&#39;: error = parse_events(optarg); break; ERROR: trailing statements should be on next line #351: FILE: Documentation/perf_counter/perf-record.c:292: + case &#39;m&#39;: mmap_pages = atoi(optarg); break; ERROR: trailing statements should be on next line #352: FILE: Documentation/perf_counter/perf-record.c:293: + case &#39;o&#39;: output_name = strdup(optarg); break; ERROR: trailing statements should be on next line #353: FILE: Documentation/perf_counter/perf-record.c:294: + case &#39;r&#39;: realtime_prio = atoi(optarg); break; ERROR: trailing statements should be on next line #354: FILE: Documentation/perf_counter/perf-record.c:295: + default: error = 1; break; ERROR: do not initialise statics to 0 or NULL #468: FILE: Documentation/perf_counter/perf-record.c:409: +static volatile int done = 0; WARNING: Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt #468: FILE: Documentation/perf_counter/perf-record.c:409: +static volatile int done = 0; WARNING: line over 80 characters #509: FILE: Documentation/perf_counter/perf-record.c:450: + hw_event.record_type = PERF_RECORD_IP | PERF_RECORD_TID; WARNING: line over 80 characters #514: FILE: Documentation/perf_counter/perf-record.c:455: + fd[i][counter] = sys_perf_counter_open(&amp;hw_event, -1, i, group_fd, 0); WARNING: line over 80 characters #517: FILE: Documentation/perf_counter/perf-record.c:458: + printf(&quot;kerneltop error: syscall returned with %d (%s)\n&quot;, WARNING: line over 80 characters #539: FILE: Documentation/perf_counter/perf-record.c:480: + mmap_array[i][counter].base = mmap(NULL, (mmap_pages+1)*page_size, WARNING: line over 80 characters #540: FILE: Documentation/perf_counter/perf-record.c:481: + PROT_READ, MAP_SHARED, fd[i][counter], 0); WARNING: line over 80 characters #542: FILE: Documentation/perf_counter/perf-record.c:483: + printf(&quot;kerneltop error: failed to mmap with %d (%s)\n&quot;, total: 40 errors, 29 warnings, 1019 lines checked </pre> badincludes: netxen: code cleanup <pre>commit e98e3350c03af4187e1d5fe007c7b460e378990c Author: Dhananjay Phadke &lt;dhananjay@netxen.com&gt; Date: Tue Apr 7 22:50:38 2009 +0000 netxen: code cleanup o remove unused structure defs. o remove unnecessary includes. o replace enums with specific #defines. o reduce footprint of stats structure. Signed-off-by: Dhananjay Phadke &lt;dhananjay@netxen.com&gt; Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt; </pre>---<pre>diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index aef7728..85693c0 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c @@ -29,7 +29,7 @@ */ #include &lt;linux/vmalloc.h&gt; -#include &lt;linux/highmem.h&gt; +#include &lt;linux/interrupt.h&gt; #include &quot;netxen_nic_hw.h&quot; #include &quot;netxen_nic.h&quot; include linux/interrupt.h inserted after linux/vmalloc.h </pre> checkpatch: netxen: async link event handling <pre>commit 3bf26ce3f4cc3c9e0d0478b4016c6113a16faaf1 Author: Dhananjay Phadke &lt;dhananjay@netxen.com&gt; Date: Tue Apr 7 22:50:42 2009 +0000 netxen: async link event handling Add support for asynchronous events from firmware, received over one of the rx rings. Add support for event based phy interrupts, enhanced links status reporting from firmware. Signed-off-by: Dhananjay Phadke &lt;dhananjay@netxen.com&gt; Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt; </pre>---<pre>WARNING: do not add new typedefs #134: FILE: drivers/net/netxen/netxen_nic.h:1149: +typedef struct { total: 0 errors, 1 warnings, 489 lines checked </pre> checkpatch: x86: consolidate SMP code in io_apic.c <pre>commit e85abf8f432bb2a13733ab7609fbb8e1500af51d Author: Gary Hade &lt;garyhade@us.ibm.com&gt; Date: Wed Apr 8 14:07:25 2009 -0700 x86: consolidate SMP code in io_apic.c Impact: Cleanup Reorganizes the code in arch/x86/kernel/io_apic.c by combining two &#39;#ifdef CONFIG_SMP&#39; regions. In addition to making the code easier to understand the first &#39;#ifdef CONFIG_SMP&#39; region is moved to a location later in the file which will reduce the need for function forward declarations when the code subsequently revised. The only changes other than relocating code to a different position in the file were the removal of the assign_irq_vector() forward declaration which was no longer needed and some line length reduction formatting changes. Signed-off-by: Gary Hade &lt;garyhade@us.ibm.com&gt; Cc: lcm@us.ibm.com LKML-Reference: &lt;20090408210725.GC11159@us.ibm.com&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>WARNING: line over 80 characters #164: FILE: arch/x86/kernel/apic/io_apic.c:2259: + apic-&gt;send_IPI_mask(cpumask_of(i), IRQ_MOVE_CLEANUP_VECTOR); total: 0 errors, 1 warnings, 235 lines checked </pre> coccinelle: x86: consolidate SMP code in io_apic.c <pre>commit e85abf8f432bb2a13733ab7609fbb8e1500af51d Author: Gary Hade &lt;garyhade@us.ibm.com&gt; Date: Wed Apr 8 14:07:25 2009 -0700 x86: consolidate SMP code in io_apic.c Impact: Cleanup Reorganizes the code in arch/x86/kernel/io_apic.c by combining two &#39;#ifdef CONFIG_SMP&#39; regions. In addition to making the code easier to understand the first &#39;#ifdef CONFIG_SMP&#39; region is moved to a location later in the file which will reduce the need for function forward declarations when the code subsequently revised. The only changes other than relocating code to a different position in the file were the removal of the assign_irq_vector() forward declaration which was no longer needed and some line length reduction formatting changes. Signed-off-by: Gary Hade &lt;garyhade@us.ibm.com&gt; Cc: lcm@us.ibm.com LKML-Reference: &lt;20090408210725.GC11159@us.ibm.com&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 7c9d045..34a2126 100644 --- a/tmp/poHyRFnqgZ.c +++ b/tmp/m9c9AJZTlX.c @@ -742,15 +742,13 @@ struct IO_APIC_route_entry **alloc_ioapic_entries(void) int apic; struct IO_APIC_route_entry **ioapic_entries; - ioapic_entries = kzalloc(sizeof(*ioapic_entries) * nr_ioapics, - GFP_ATOMIC); + ioapic_entries = kcalloc(nr_ioapics, sizeof(*ioapic_entries), GFP_ATOMIC); if (!ioapic_entries) return 0; for (apic = 0; apic &lt; nr_ioapics; apic++) { ioapic_entries[apic] = - kzalloc(sizeof(struct IO_APIC_route_entry) * - nr_ioapic_registers[apic], GFP_ATOMIC); + kcalloc(nr_ioapic_registers[apic], sizeof(struct IO_APIC_route_entry), GFP_ATOMIC); if (!ioapic_entries[apic]) goto nomem; } </pre> checkpatch: perf_counter: optimize mmap/comm tracking <pre>commit 9ee318a7825929bc3734110b83ae8e20e53d9de3 Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Date: Thu Apr 9 10:53:44 2009 +0200 perf_counter: optimize mmap/comm tracking Impact: performance optimization The mmap/comm tracking code does quite a lot of work before it discovers there&#39;s no interest in it, avoid that by keeping a counter. Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Cc: Paul Mackerras &lt;paulus@samba.org&gt; Cc: Corey Ashford &lt;cjashfor@linux.vnet.ibm.com&gt; LKML-Reference: &lt;20090409085524.427173196@chello.nl&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: trailing whitespace #55: FILE: kernel/perf_counter.c:2023: + $ total: 1 errors, 0 warnings, 75 lines checked </pre> coccinelle: perf_counter: sysctl for system wide perf counters <pre>commit 1ccd15497869f3ed83b5225d410df53a96e52757 Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Date: Thu Apr 9 10:53:45 2009 +0200 perf_counter: sysctl for system wide perf counters Impact: add sysctl for paranoid/relaxed perfcounters policy Allow the use of system wide perf counters to everybody, but provide a sysctl to disable it for the paranoid security minded. Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Cc: Paul Mackerras &lt;paulus@samba.org&gt; Cc: Corey Ashford &lt;cjashfor@linux.vnet.ibm.com&gt; LKML-Reference: &lt;20090409085524.514046352@chello.nl&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/bugon.cocci: // using BUG_ON implies that the if disappears when checking is not desired // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/bugon.html // Options: -no_includes -include_headers diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 8ba4578..b118773 100644 --- a/tmp/RojQrVXjqz.c +++ b/tmp/lGMTolPhLB.c @@ -1566,8 +1566,7 @@ void sysctl_head_put(struct ctl_table_header *head) struct ctl_table_header *sysctl_head_grab(struct ctl_table_header *head) { - if (!head) - BUG(); + BUG_ON(!head); spin_lock(&amp;sysctl_lock); if (!use_table(head)) head = ERR_PTR(-ENOENT); </pre> checkpatch: x86, setup: "glove box" BIOS interrupts in the video code <pre>commit cf06de7b9cdd3efee7a59dced1977b3c21d43732 Author: H. Peter Anvin &lt;hpa@linux.intel.com&gt; Date: Wed Apr 1 18:20:11 2009 -0700 x86, setup: &quot;glove box&quot; BIOS interrupts in the video code Impact: BIOS proofing &quot;Glove box&quot; off BIOS interrupts in the video code. LKML-Reference: &lt;49DE7F79.4030106@zytor.com&gt; Signed-off-by: H. Peter Anvin &lt;hpa@linux.intel.com&gt; Cc: Pavel Machek &lt;pavel@ucw.cz&gt; Cc: Rafael J. Wysocki &lt;rjw@sisk.pl&gt; </pre>---<pre>ERROR: spaces required around that &#39;=&#39; (ctx:WxV) #304: FILE: arch/x86/boot/video-vesa.c:271: + ireg.di =(size_t)&amp;boot_params.edid_info; /* (ES:)Pointer to block */ ^ total: 1 errors, 0 warnings, 553 lines checked </pre> coccinelle: x86, setup: "glove box" BIOS interrupts in the video code <pre>commit cf06de7b9cdd3efee7a59dced1977b3c21d43732 Author: H. Peter Anvin &lt;hpa@linux.intel.com&gt; Date: Wed Apr 1 18:20:11 2009 -0700 x86, setup: &quot;glove box&quot; BIOS interrupts in the video code Impact: BIOS proofing &quot;Glove box&quot; off BIOS interrupts in the video code. LKML-Reference: &lt;49DE7F79.4030106@zytor.com&gt; Signed-off-by: H. Peter Anvin &lt;hpa@linux.intel.com&gt; Cc: Pavel Machek &lt;pavel@ucw.cz&gt; Cc: Rafael J. Wysocki &lt;rjw@sisk.pl&gt; </pre>---<pre>rules/unused.cocci: // A variable is only initialized to a constant and is never used otherwise // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/unused.html // Options: -no_includes -include_headers diff --git a/arch/x86/boot/video-vga.c b/arch/x86/boot/video-vga.c index 8f8d827..4936af2 100644 --- a/tmp/lMyiy48glq.c +++ b/tmp/lpE0w0JSzd.c @@ -41,7 +41,6 @@ static __videocard video_vga; static u8 vga_set_basic_mode(void) { struct biosregs ireg, oreg; - u16 ax; u8 rows; u8 mode; @@ -55,7 +54,6 @@ static u8 vga_set_basic_mode(void) } #endif - ax = 0x0f00; intcall(0x10, &amp;ireg, &amp;oreg); mode = oreg.al; </pre> coccinelle: RDS/IW+IB: Set the RDS_LL_SEND_FULL bit when we're throttled. <pre>commit d39e0602bb987133321d358d9b837d67c27b223d Author: Steve Wise &lt;swise@opengridcomputing.com&gt; Date: Thu Apr 9 14:09:38 2009 +0000 RDS/IW+IB: Set the RDS_LL_SEND_FULL bit when we&#39;re throttled. The RDS_LL_SEND_FULL bit should be set when we stop transmitted due to flow control. Otherwise the send worker will keep trying as opposed to sleeping until we unthrottle. Saves CPU. Signed-off-by: Steve Wise &lt;swise@opengridcomputing.com&gt; Signed-off-by: Andy Grover &lt;andy.grover@oracle.com&gt; Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt; </pre>---<pre>rules/bugon.cocci: // using BUG_ON implies that the if disappears when checking is not desired // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/bugon.html // Options: -no_includes -include_headers diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c index fa684b7..48d1552 100644 --- a/tmp/iiDUDodtz8.c +++ b/tmp/ukOoMQA5kU.c @@ -574,8 +574,7 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm, rds_ib_send_grab_credits(ic, 0, &amp;posted, 1); adv_credits += posted; BUG_ON(adv_credits &gt; 255); - } else if (ic-&gt;i_rm != rm) - BUG(); + } else BUG_ON(ic-&gt;i_rm != rm); send = &amp;ic-&gt;i_sends[pos]; first = send; rules/bugon.cocci: // using BUG_ON implies that the if disappears when checking is not desired // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/bugon.html // Options: -no_includes -include_headers diff --git a/net/rds/iw_send.c b/net/rds/iw_send.c index 626290b..196a9cd 100644 --- a/tmp/CzgWOzMApX.c +++ b/tmp/7bvpsFW7d1.c @@ -617,8 +617,7 @@ int rds_iw_xmit(struct rds_connection *conn, struct rds_message *rm, rds_iw_send_grab_credits(ic, 0, &amp;posted, 1); adv_credits += posted; BUG_ON(adv_credits &gt; 255); - } else if (ic-&gt;i_rm != rm) - BUG(); + } else BUG_ON(ic-&gt;i_rm != rm); send = &amp;ic-&gt;i_sends[pos]; first = send; </pre> checkpatch: RDS/IW+IB: Allow max credit advertise window. <pre>commit 7b70d0336da777c00395cc7a503497c2cdabd1a8 Author: Steve Wise &lt;swise@opengridcomputing.com&gt; Date: Thu Apr 9 14:09:39 2009 +0000 RDS/IW+IB: Allow max credit advertise window. Fix hack that restricts the credit advertisement to 127. Signed-off-by: Steve Wise &lt;swise@opengridcomputing.com&gt; Signed-off-by: Andy Grover &lt;andy.grover@oracle.com&gt; Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt; </pre>---<pre>WARNING: line over 80 characters #34: FILE: net/rds/ib_recv.c:527: + if (!rds_ib_send_grab_credits(ic, 1, &amp;adv_credits, 0, RDS_MAX_ADV_CREDIT)) { WARNING: line over 80 characters #47: FILE: net/rds/ib_send.c:314: + u32 wanted, u32 *adv_credits, int need_posted, int max_posted) WARNING: line over 80 characters #65: FILE: net/rds/ib_send.c:501: + credit_alloc = rds_ib_send_grab_credits(ic, work_alloc, &amp;posted, 0, RDS_MAX_ADV_CREDIT); WARNING: line over 80 characters #74: FILE: net/rds/ib_send.c:574: + rds_ib_send_grab_credits(ic, 0, &amp;posted, 1, RDS_MAX_ADV_CREDIT - adv_credits); WARNING: line over 80 characters #100: FILE: net/rds/iw_recv.c:527: + if (!rds_iw_send_grab_credits(ic, 1, &amp;adv_credits, 0, RDS_MAX_ADV_CREDIT)) { WARNING: line over 80 characters #113: FILE: net/rds/iw_send.c:350: + u32 wanted, u32 *adv_credits, int need_posted, int max_posted) WARNING: line over 80 characters #131: FILE: net/rds/iw_send.c:544: + credit_alloc = rds_iw_send_grab_credits(ic, work_alloc, &amp;posted, 0, RDS_MAX_ADV_CREDIT); WARNING: line over 80 characters #140: FILE: net/rds/iw_send.c:617: + rds_iw_send_grab_credits(ic, 0, &amp;posted, 1, RDS_MAX_ADV_CREDIT - adv_credits); total: 0 errors, 8 warnings, 104 lines checked </pre> coccinelle: RDS/IW+IB: Allow max credit advertise window. <pre>commit 7b70d0336da777c00395cc7a503497c2cdabd1a8 Author: Steve Wise &lt;swise@opengridcomputing.com&gt; Date: Thu Apr 9 14:09:39 2009 +0000 RDS/IW+IB: Allow max credit advertise window. Fix hack that restricts the credit advertisement to 127. Signed-off-by: Steve Wise &lt;swise@opengridcomputing.com&gt; Signed-off-by: Andy Grover &lt;andy.grover@oracle.com&gt; Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt; </pre>---<pre>rules/bugon.cocci: // using BUG_ON implies that the if disappears when checking is not desired // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/bugon.html // Options: -no_includes -include_headers diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c index 23bf830..e6ee864 100644 --- a/tmp/upcvpda2eB.c +++ b/tmp/2Iqcc1wmLv.c @@ -574,8 +574,7 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm, rds_ib_send_grab_credits(ic, 0, &amp;posted, 1, RDS_MAX_ADV_CREDIT - adv_credits); adv_credits += posted; BUG_ON(adv_credits &gt; 255); - } else if (ic-&gt;i_rm != rm) - BUG(); + } else BUG_ON(ic-&gt;i_rm != rm); send = &amp;ic-&gt;i_sends[pos]; first = send; rules/bugon.cocci: // using BUG_ON implies that the if disappears when checking is not desired // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/bugon.html // Options: -no_includes -include_headers diff --git a/net/rds/iw_send.c b/net/rds/iw_send.c index 44a6a05..7501860 100644 --- a/tmp/yU2uXrNXu1.c +++ b/tmp/QolWmn4Zcu.c @@ -617,8 +617,7 @@ int rds_iw_xmit(struct rds_connection *conn, struct rds_message *rm, rds_iw_send_grab_credits(ic, 0, &amp;posted, 1, RDS_MAX_ADV_CREDIT - adv_credits); adv_credits += posted; BUG_ON(adv_credits &gt; 255); - } else if (ic-&gt;i_rm != rm) - BUG(); + } else BUG_ON(ic-&gt;i_rm != rm); send = &amp;ic-&gt;i_sends[pos]; first = send; </pre> checkpatch: tracing, net, skb tracepoint: make skb tracepoint use the TRACE_EVENT() macro <pre>commit 5cb3d1d9d34ac04bcaa2034139345b2a5fea54c1 Author: Zhaolei &lt;zhaolei@cn.fujitsu.com&gt; Date: Thu Apr 9 14:08:18 2009 +0800 tracing, net, skb tracepoint: make skb tracepoint use the TRACE_EVENT() macro TRACE_EVENT is a more generic way to define a tracepoint. Doing so adds these new capabilities to this tracepoint: - zero-copy and per-cpu splice() tracing - binary tracing without printf overhead - structured logging records exposed under /debug/tracing/events - trace events embedded in function tracer output and other plugins - user-defined, per tracepoint filter expressions Signed-off-by: Zhao Lei &lt;zhaolei@cn.fujitsu.com&gt; Acked-by: Neil Horman &lt;nhorman@tuxdriver.com&gt; Cc: &quot;David S. Miller&quot; &lt;davem@davemloft.net&gt; Cc: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt; Cc: &quot;Steven Rostedt ;&quot; &lt;rostedt@goodmis.org&gt; Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt; Cc: Tom Zanussi &lt;tzanussi@gmail.com&gt; LKML-Reference: &lt;49DD90D2.5020604@cn.fujitsu.com&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: space prohibited after that open parenthesis &#39;(&#39; #65: FILE: include/trace/skb_event_types.h:21: + __field( void *, skbaddr ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #65: FILE: include/trace/skb_event_types.h:21: + __field( void *, skbaddr ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #66: FILE: include/trace/skb_event_types.h:22: + __field( unsigned short, protocol ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #66: FILE: include/trace/skb_event_types.h:22: + __field( unsigned short, protocol ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #67: FILE: include/trace/skb_event_types.h:23: + __field( void *, location ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #67: FILE: include/trace/skb_event_types.h:23: + __field( void *, location ) WARNING: braces {} are not necessary for single statement blocks #72: FILE: include/trace/skb_event_types.h:28: + if (skb) { + __entry-&gt;protocol = ntohs(skb-&gt;protocol); + } total: 6 errors, 1 warnings, 55 lines checked </pre> coccinelle: x86: cacheinfo: use L3 cache index disable feature only for CPUs that support it <pre>commit bda869c614c937c318547c3ee1d65a316b693c21 Author: Andreas Herrmann &lt;andreas.herrmann3@amd.com&gt; Date: Thu Apr 9 15:05:10 2009 +0200 x86: cacheinfo: use L3 cache index disable feature only for CPUs that support it AMD family 0x11 CPU doesn&#39;t support the feature. Some AMD family 0x10 CPUs do not support it or have an erratum, see erratum #382 in &quot;Revision Guide for AMD Family 10h Processors, 41322 Rev. 3.40 February 2009&quot;. Signed-off-by: Andreas Herrmann &lt;andreas.herrmann3@amd.com&gt; CC: Mark Langsdorf &lt;mark.langsdorf@amd.com&gt; Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt; LKML-Reference: &lt;20090409130510.GG31527@alberich.amd.com&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index 7240126..2768446 100644 --- a/tmp/Z8dTfN4Mes.c +++ b/tmp/fVmyuKTBdK.c @@ -608,8 +608,7 @@ static int __cpuinit detect_cache_attributes(unsigned int cpu) if (num_cache_leaves == 0) return -ENOENT; - per_cpu(cpuid4_info, cpu) = kzalloc( - sizeof(struct _cpuid4_info) * num_cache_leaves, GFP_KERNEL); + per_cpu(cpuid4_info, cpu) = kcalloc(num_cache_leaves, sizeof(struct _cpuid4_info), GFP_KERNEL); if (per_cpu(cpuid4_info, cpu) == NULL) return -ENOMEM; @@ -899,8 +898,7 @@ static int __cpuinit cpuid4_cache_sysfs_init(unsigned int cpu) if (unlikely(per_cpu(cache_kobject, cpu) == NULL)) goto err_out; - per_cpu(index_kobject, cpu) = kzalloc( - sizeof(struct _index_kobject ) * num_cache_leaves, GFP_KERNEL); + per_cpu(index_kobject, cpu) = kcalloc(num_cache_leaves, sizeof(struct _index_kobject), GFP_KERNEL); if (unlikely(per_cpu(index_kobject, cpu) == NULL)) goto err_out; </pre> coccinelle: x86: cacheinfo: correct return value when cache_disable feature is not active <pre>commit 845d8c761ec763871936c62b837c4a9ea6d0fbdb Author: Andreas Herrmann &lt;andreas.herrmann3@amd.com&gt; Date: Thu Apr 9 15:07:29 2009 +0200 x86: cacheinfo: correct return value when cache_disable feature is not active Impact: bug fix If user writes to &quot;cache_disable&quot; attribute on a CPU that does not support this feature, the process hangs due to an invalid return value in store_cache_disable(). Signed-off-by: Andreas Herrmann &lt;andreas.herrmann3@amd.com&gt; Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt; Cc: Mark Langsdorf &lt;mark.langsdorf@amd.com&gt; LKML-Reference: &lt;20090409130729.GH31527@alberich.amd.com&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index 1ab46e0..f5f6442 100644 --- a/tmp/Ck7Po0hgQN.c +++ b/tmp/7nFI4kDhby.c @@ -608,8 +608,7 @@ static int __cpuinit detect_cache_attributes(unsigned int cpu) if (num_cache_leaves == 0) return -ENOENT; - per_cpu(cpuid4_info, cpu) = kzalloc( - sizeof(struct _cpuid4_info) * num_cache_leaves, GFP_KERNEL); + per_cpu(cpuid4_info, cpu) = kcalloc(num_cache_leaves, sizeof(struct _cpuid4_info), GFP_KERNEL); if (per_cpu(cpuid4_info, cpu) == NULL) return -ENOMEM; @@ -899,8 +898,7 @@ static int __cpuinit cpuid4_cache_sysfs_init(unsigned int cpu) if (unlikely(per_cpu(cache_kobject, cpu) == NULL)) goto err_out; - per_cpu(index_kobject, cpu) = kzalloc( - sizeof(struct _index_kobject ) * num_cache_leaves, GFP_KERNEL); + per_cpu(index_kobject, cpu) = kcalloc(num_cache_leaves, sizeof(struct _index_kobject), GFP_KERNEL); if (unlikely(per_cpu(index_kobject, cpu) == NULL)) goto err_out; </pre> badincludes: x86: cacheinfo: use cached K8 NB_MISC devices instead of scanning for it <pre>commit afd9fceec55225d33be878927056a548c2eef26c Author: Andreas Herrmann &lt;andreas.herrmann3@amd.com&gt; Date: Thu Apr 9 15:16:17 2009 +0200 x86: cacheinfo: use cached K8 NB_MISC devices instead of scanning for it Impact: avoid code duplication Signed-off-by: Andreas Herrmann &lt;andreas.herrmann3@amd.com&gt; Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt; Cc: Mark Langsdorf &lt;mark.langsdorf@amd.com&gt; LKML-Reference: &lt;20090409131617.GI31527@alberich.amd.com&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index 1ab46e0..0cde071 100644 --- a/arch/x86/kernel/cpu/intel_cacheinfo.c +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c @@ -17,6 +17,7 @@ #include &lt;asm/processor.h&gt; #include &lt;asm/smp.h&gt; +#include &lt;asm/k8.h&gt; #define LVL_1_INST 1 #define LVL_1_DATA 2 include asm/k8.h inserted after asm/smp.h </pre> coccinelle: x86: cacheinfo: use cached K8 NB_MISC devices instead of scanning for it <pre>commit afd9fceec55225d33be878927056a548c2eef26c Author: Andreas Herrmann &lt;andreas.herrmann3@amd.com&gt; Date: Thu Apr 9 15:16:17 2009 +0200 x86: cacheinfo: use cached K8 NB_MISC devices instead of scanning for it Impact: avoid code duplication Signed-off-by: Andreas Herrmann &lt;andreas.herrmann3@amd.com&gt; Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt; Cc: Mark Langsdorf &lt;mark.langsdorf@amd.com&gt; LKML-Reference: &lt;20090409131617.GI31527@alberich.amd.com&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index 0cde071..577f074 100644 --- a/tmp/IDlwLzjUA8.c +++ b/tmp/WLWNHRD272.c @@ -601,8 +601,7 @@ static int __cpuinit detect_cache_attributes(unsigned int cpu) if (num_cache_leaves == 0) return -ENOENT; - per_cpu(cpuid4_info, cpu) = kzalloc( - sizeof(struct _cpuid4_info) * num_cache_leaves, GFP_KERNEL); + per_cpu(cpuid4_info, cpu) = kcalloc(num_cache_leaves, sizeof(struct _cpuid4_info), GFP_KERNEL); if (per_cpu(cpuid4_info, cpu) == NULL) return -ENOMEM; @@ -868,8 +867,7 @@ static int __cpuinit cpuid4_cache_sysfs_init(unsigned int cpu) if (unlikely(per_cpu(cache_kobject, cpu) == NULL)) goto err_out; - per_cpu(index_kobject, cpu) = kzalloc( - sizeof(struct _index_kobject ) * num_cache_leaves, GFP_KERNEL); + per_cpu(index_kobject, cpu) = kcalloc(num_cache_leaves, sizeof(struct _index_kobject), GFP_KERNEL); if (unlikely(per_cpu(index_kobject, cpu) == NULL)) goto err_out; </pre> coccinelle: x86: cacheinfo: replace sysfs interface for cache_disable feature <pre>commit f8b201fc7110c3673437254e8ba02451461ece0b Author: Mark Langsdorf &lt;mark.langsdorf@amd.com&gt; Date: Thu Apr 9 15:18:49 2009 +0200 x86: cacheinfo: replace sysfs interface for cache_disable feature Impact: replace sysfs attribute Current interface violates against &quot;one-value-per-sysfs-attribute rule&quot;. This patch replaces current attribute with two attributes -- one for each L3 Cache Index Disable register. Signed-off-by: Mark Langsdorf &lt;mark.langsdorf@amd.com&gt; Signed-off-by: Andreas Herrmann &lt;andreas.herrmann3@amd.com&gt; Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt; LKML-Reference: &lt;20090409131849.GJ31527@alberich.amd.com&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index fc28291..15435c6 100644 --- a/tmp/kl4Lcf92ol.c +++ b/tmp/47SzJjvaaj.c @@ -601,8 +601,7 @@ static int __cpuinit detect_cache_attributes(unsigned int cpu) if (num_cache_leaves == 0) return -ENOENT; - per_cpu(cpuid4_info, cpu) = kzalloc( - sizeof(struct _cpuid4_info) * num_cache_leaves, GFP_KERNEL); + per_cpu(cpuid4_info, cpu) = kcalloc(num_cache_leaves, sizeof(struct _cpuid4_info), GFP_KERNEL); if (per_cpu(cpuid4_info, cpu) == NULL) return -ENOMEM; @@ -868,8 +867,7 @@ static int __cpuinit cpuid4_cache_sysfs_init(unsigned int cpu) if (unlikely(per_cpu(cache_kobject, cpu) == NULL)) goto err_out; - per_cpu(index_kobject, cpu) = kzalloc( - sizeof(struct _index_kobject ) * num_cache_leaves, GFP_KERNEL); + per_cpu(index_kobject, cpu) = kcalloc(num_cache_leaves, sizeof(struct _index_kobject), GFP_KERNEL); if (unlikely(per_cpu(index_kobject, cpu) == NULL)) goto err_out; </pre> coccinelle: x86: cacheinfo: disable L3 ECC scrubbing when L3 cache index is disabled <pre>commit ba518bea2db21c72d44a6cbfd825b026ef9cdcb6 Author: Mark Langsdorf &lt;mark.langsdorf@amd.com&gt; Date: Thu Apr 9 15:24:06 2009 +0200 x86: cacheinfo: disable L3 ECC scrubbing when L3 cache index is disabled (Use correct mask to zero out bits 24-28 by Andreas) Signed-off-by: Mark Langsdorf &lt;mark.langsdorf@amd.com&gt; Signed-off-by: Andreas Herrmann &lt;andreas.herrmann3@amd.com&gt; Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt; LKML-Reference: &lt;20090409132406.GK31527@alberich.amd.com&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index d46a849..2c622ed 100644 --- a/tmp/oGsBhUleWo.c +++ b/tmp/eU7TPJsH69.c @@ -601,8 +601,7 @@ static int __cpuinit detect_cache_attributes(unsigned int cpu) if (num_cache_leaves == 0) return -ENOENT; - per_cpu(cpuid4_info, cpu) = kzalloc( - sizeof(struct _cpuid4_info) * num_cache_leaves, GFP_KERNEL); + per_cpu(cpuid4_info, cpu) = kcalloc(num_cache_leaves, sizeof(struct _cpuid4_info), GFP_KERNEL); if (per_cpu(cpuid4_info, cpu) == NULL) return -ENOMEM; @@ -874,8 +873,7 @@ static int __cpuinit cpuid4_cache_sysfs_init(unsigned int cpu) if (unlikely(per_cpu(cache_kobject, cpu) == NULL)) goto err_out; - per_cpu(index_kobject, cpu) = kzalloc( - sizeof(struct _index_kobject ) * num_cache_leaves, GFP_KERNEL); + per_cpu(index_kobject, cpu) = kcalloc(num_cache_leaves, sizeof(struct _index_kobject), GFP_KERNEL); if (unlikely(per_cpu(index_kobject, cpu) == NULL)) goto err_out; </pre> badincludes: x86: unify trivial differences in irqinit_{32,64}.c <pre>commit 778838600eb6973bdb6fd11e7f91b43cea4d6f45 Author: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt; Date: Thu Apr 9 11:52:26 2009 +0300 x86: unify trivial differences in irqinit_{32,64}.c Impact: cleanup Reviewed-by Cyrill Gorcunov &lt;gorcunov@openvz.org&gt; Signed-off-by: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>diff --git a/arch/x86/kernel/irqinit_32.c b/arch/x86/kernel/irqinit_32.c index a780de3..72ce942 100644 --- a/arch/x86/kernel/irqinit_32.c +++ b/arch/x86/kernel/irqinit_32.c @@ -1,20 +1,24 @@ +#include &lt;linux/linkage.h&gt; #include &lt;linux/errno.h&gt; #include &lt;linux/signal.h&gt; #include &lt;linux/sched.h&gt; #include &lt;linux/ioport.h&gt; #include &lt;linux/interrupt.h&gt; +#include &lt;linux/timex.h&gt; #include &lt;linux/slab.h&gt; #include &lt;linux/random.h&gt; #include &lt;linux/init.h&gt; #include &lt;linux/kernel_stat.h&gt; #include &lt;linux/sysdev.h&gt; #include &lt;linux/bitops.h&gt; +#include &lt;linux/acpi.h&gt; #include &lt;linux/io.h&gt; #include &lt;linux/delay.h&gt; #include &lt;asm/atomic.h&gt; #include &lt;asm/system.h&gt; #include &lt;asm/timer.h&gt; +#include &lt;asm/hw_irq.h&gt; #include &lt;asm/pgtable.h&gt; #include &lt;asm/desc.h&gt; #include &lt;asm/apic.h&gt; include linux/linkage.h inserted before linux/errno.h </pre> coccinelle: x86: cacheinfo: complete L2/L3 Cache and TLB associativity field definitions <pre>commit 6265ff19ca08df0d96c859ae5e4dc2d9ad07070e Author: Andreas Herrmann &lt;andreas.herrmann3@amd.com&gt; Date: Thu Apr 9 15:47:10 2009 +0200 x86: cacheinfo: complete L2/L3 Cache and TLB associativity field definitions See &quot;CPUID Specification&quot; (AMD Publication #: 25481, Rev. 2.28, April 2008) Signed-off-by: Andreas Herrmann &lt;andreas.herrmann3@amd.com&gt; Cc: Mark Langsdorf &lt;mark.langsdorf@amd.com&gt; LKML-Reference: &lt;20090409134710.GA8026@alberich.amd.com&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index 789efe2..eb987bb 100644 --- a/tmp/QOAQIritGN.c +++ b/tmp/xaplbbr1La.c @@ -609,8 +609,7 @@ static int __cpuinit detect_cache_attributes(unsigned int cpu) if (num_cache_leaves == 0) return -ENOENT; - per_cpu(cpuid4_info, cpu) = kzalloc( - sizeof(struct _cpuid4_info) * num_cache_leaves, GFP_KERNEL); + per_cpu(cpuid4_info, cpu) = kcalloc(num_cache_leaves, sizeof(struct _cpuid4_info), GFP_KERNEL); if (per_cpu(cpuid4_info, cpu) == NULL) return -ENOMEM; @@ -882,8 +881,7 @@ static int __cpuinit cpuid4_cache_sysfs_init(unsigned int cpu) if (unlikely(per_cpu(cache_kobject, cpu) == NULL)) goto err_out; - per_cpu(index_kobject, cpu) = kzalloc( - sizeof(struct _index_kobject ) * num_cache_leaves, GFP_KERNEL); + per_cpu(index_kobject, cpu) = kcalloc(num_cache_leaves, sizeof(struct _index_kobject), GFP_KERNEL); if (unlikely(per_cpu(index_kobject, cpu) == NULL)) goto err_out; </pre> checkpatch: ixgbe: Move PHY ops initialization to centralize bus accesses <pre>commit 04f165ef4f18444854865d44a3359618480060af Author: PJ Waskiewicz &lt;peter.p.waskiewicz.jr@intel.com&gt; Date: Thu Apr 9 22:27:57 2009 +0000 ixgbe: Move PHY ops initialization to centralize bus accesses When PHY operations are determined, the PHY must be identified. This identification causes bus access, and should be contained within its own routines. This also helps the 82599 PHY init paths for both SFP+ and KX/KX4 devices to be easier to maintain. Signed-off-by: Peter P Waskiewicz Jr &lt;peter.p.waskiewicz.jr@intel.com&gt; Signed-off-by: Jeff Kirsher &lt;jeffrey.t.kirsher@intel.com&gt; Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt; </pre>---<pre>ERROR: code indent should use tabs where possible #64: FILE: drivers/net/ixgbe/ixgbe_82598.c:115: +^I^I &amp;ixgbe_setup_copper_link_speed_82598;$ ERROR: code indent should use tabs where possible #66: FILE: drivers/net/ixgbe/ixgbe_82598.c:117: +^I^I &amp;ixgbe_get_copper_link_capabilities_82598;$ ERROR: code indent should use tabs where possible #81: FILE: drivers/net/ixgbe/ixgbe_82598.c:140: +^I^I &amp;list_offset,$ ERROR: code indent should use tabs where possible #82: FILE: drivers/net/ixgbe/ixgbe_82598.c:141: +^I^I &amp;data_offset);$ ERROR: code indent should use tabs where possible #208: FILE: drivers/net/ixgbe/ixgbe_82599.c:189: +^I^I &amp;ixgbe_setup_copper_link_speed_82599;$ ERROR: code indent should use tabs where possible #220: FILE: drivers/net/ixgbe/ixgbe_82599.c:199: +^I^I &amp;ixgbe_get_phy_firmware_version_tnx;$ ERROR: code indent should use tabs where possible #291: FILE: drivers/net/ixgbe/ixgbe_main.c:4635: +^I^I &quot;unsupported SFP+ module type was detected.\n&quot;);$ total: 7 errors, 0 warnings, 275 lines checked </pre> coccinelle: ixgbe: Move PHY ops initialization to centralize bus accesses <pre>commit 04f165ef4f18444854865d44a3359618480060af Author: PJ Waskiewicz &lt;peter.p.waskiewicz.jr@intel.com&gt; Date: Thu Apr 9 22:27:57 2009 +0000 ixgbe: Move PHY ops initialization to centralize bus accesses When PHY operations are determined, the PHY must be identified. This identification causes bus access, and should be contained within its own routines. This also helps the 82599 PHY init paths for both SFP+ and KX/KX4 devices to be easier to maintain. Signed-off-by: Peter P Waskiewicz Jr &lt;peter.p.waskiewicz.jr@intel.com&gt; Signed-off-by: Jeff Kirsher &lt;jeffrey.t.kirsher@intel.com&gt; Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt; </pre>---<pre>rules/notand.cocci: // !x&amp;y combines boolean negation with bitwise and // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/notand.html // Options: -no_includes -include_headers diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 936a3ef..dec844d 100644 --- a/tmp/mjcIzTs7JT.c +++ b/tmp/20geihJI3H.c @@ -3917,7 +3917,7 @@ static void ixgbe_sfp_config_module_task(struct work_struct *work) } hw-&gt;mac.ops.setup_sfp(hw); - if (!adapter-&gt;flags &amp; IXGBE_FLAG_IN_SFP_LINK_TASK) + if (!(adapter-&gt;flags &amp; IXGBE_FLAG_IN_SFP_LINK_TASK)) /* This will also work for DA Twinax connections */ schedule_work(&amp;adapter-&gt;multispeed_fiber_task); adapter-&gt;flags &amp;= ~IXGBE_FLAG_IN_SFP_MOD_TASK; </pre> coccinelle: ixgbe: Update get_physical_layer() calls, plus a version bump <pre>commit 04193058c1005551af93f04a4b975fbd7f95cad5 Author: Peter P Waskiewicz Jr &lt;peter.p.waskiewicz.jr@intel.com&gt; Date: Thu Apr 9 22:28:50 2009 +0000 ixgbe: Update get_physical_layer() calls, plus a version bump Not all physical connection types are being correctly identified. This fixes that issue, and cleans up the logic to make it more maintainable. Also clean up the code for device capabilities from the EEPROM to support multiple SKUs of the same hardware. Bump the version to reflect all the updates since the 82599 merge. Signed-off-by: Peter P Waskiewicz Jr &lt;peter.p.waskiewicz.jr@intel.com&gt; Signed-off-by: Jeff Kirsher &lt;jeffrey.t.kirsher@intel.com&gt; Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt; </pre>---<pre>rules/notand.cocci: // !x&amp;y combines boolean negation with bitwise and // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/notand.html // Options: -no_includes -include_headers diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 2856486..813c5bc 100644 --- a/tmp/jPEMIhRv2p.c +++ b/tmp/bd9jqU4qdc.c @@ -3917,7 +3917,7 @@ static void ixgbe_sfp_config_module_task(struct work_struct *work) } hw-&gt;mac.ops.setup_sfp(hw); - if (!adapter-&gt;flags &amp; IXGBE_FLAG_IN_SFP_LINK_TASK) + if (!(adapter-&gt;flags &amp; IXGBE_FLAG_IN_SFP_LINK_TASK)) /* This will also work for DA Twinax connections */ schedule_work(&amp;adapter-&gt;multispeed_fiber_task); adapter-&gt;flags &amp;= ~IXGBE_FLAG_IN_SFP_MOD_TASK; </pre> coccinelle: x86: clean up declarations and variables <pre>commit 2c1b284e4fa260fd922b9a65c99169e2630c6862 Author: Jaswinder Singh Rajput &lt;jaswinder@kernel.org&gt; Date: Sat Apr 11 00:03:10 2009 +0530 x86: clean up declarations and variables Impact: cleanup, no code changed - syscalls.h update declarations due to unifications - irq.c declare smp_generic_interrupt() before it gets used - process.c declare sys_fork() and sys_vfork() before they get used - tsc.c rename tsc_khz shadowed variable - apic/probe_32.c declare apic_default before it gets used - apic/nmi.c prev_nmi_count should be unsigned - apic/io_apic.c declare smp_irq_move_cleanup_interrupt() before it gets used - mm/init.c declare direct_gbpages and free_initrd_mem before they get used Signed-off-by: Jaswinder Singh Rajput &lt;jaswinder@kernel.org&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 870c92d..a7644e5 100644 --- a/tmp/kiavy2EuZv.c +++ b/tmp/y4e2geJ9Lx.c @@ -857,15 +857,13 @@ struct IO_APIC_route_entry **alloc_ioapic_entries(void) int apic; struct IO_APIC_route_entry **ioapic_entries; - ioapic_entries = kzalloc(sizeof(*ioapic_entries) * nr_ioapics, - GFP_ATOMIC); + ioapic_entries = kcalloc(nr_ioapics, sizeof(*ioapic_entries), GFP_ATOMIC); if (!ioapic_entries) return 0; for (apic = 0; apic &lt; nr_ioapics; apic++) { ioapic_entries[apic] = - kzalloc(sizeof(struct IO_APIC_route_entry) * - nr_ioapic_registers[apic], GFP_ATOMIC); + kcalloc(nr_ioapic_registers[apic], sizeof(struct IO_APIC_route_entry), GFP_ATOMIC); if (!ioapic_entries[apic]) goto nomem; } </pre> coccinelle: tracing, kmemtrace: Separate include/trace/kmemtrace.h to kmemtrace part and tracepoint part <pre>commit 02af61bb50f5d5f0322dbe5ab2a0d75808d25c7b Author: Zhaolei &lt;zhaolei@cn.fujitsu.com&gt; Date: Fri Apr 10 14:26:18 2009 +0800 tracing, kmemtrace: Separate include/trace/kmemtrace.h to kmemtrace part and tracepoint part Impact: refactor code for future changes Current kmemtrace.h is used both as header file of kmemtrace and kmem&#39;s tracepoints definition. Tracepoints&#39; definition file may be used by other code, and should only have definition of tracepoint. We can separate include/trace/kmemtrace.h into 2 files: include/linux/kmemtrace.h: header file for kmemtrace include/trace/kmem.h: definition of kmem tracepoints Signed-off-by: Zhao Lei &lt;zhaolei@cn.fujitsu.com&gt; Acked-by: Eduard - Gabriel Munteanu &lt;eduard.munteanu@linux360.ro&gt; Acked-by: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt; Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt; Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt; Cc: Tom Zanussi &lt;tzanussi@gmail.com&gt; LKML-Reference: &lt;49DEE68A.5040902@cn.fujitsu.com&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/round.cocci: // roundup and DIV_ROUND_UP are more readable than the expanded calculations // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/round.html // Options: -no_includes -include_headers diff --git a/mm/slob.c b/mm/slob.c index 494f05f..eb0965b 100644 --- a/tmp/FtqTLeYQu0.c +++ b/tmp/KY3Q7Ka1jC.c @@ -170,7 +170,7 @@ static inline void clear_slob_page_free(struct slob_page *sp) } #define SLOB_UNIT sizeof(slob_t) -#define SLOB_UNITS(size) (((size) + SLOB_UNIT - 1)/SLOB_UNIT) +#define SLOB_UNITS(size) DIV_ROUND_UP(size, SLOB_UNIT) #define SLOB_ALIGN L1_CACHE_BYTES /* </pre> checkpatch: tracing, kmemtrace: Make kmem tracepoints use TRACE_EVENT macro <pre>commit fc182a4330fc22ea1b68fa3d5064dd85a73a4c4a Author: Zhaolei &lt;zhaolei@cn.fujitsu.com&gt; Date: Fri Apr 10 14:27:38 2009 +0800 tracing, kmemtrace: Make kmem tracepoints use TRACE_EVENT macro TRACE_EVENT is a more generic way to define tracepoints. Doing so adds these new capabilities to this tracepoint: - zero-copy and per-cpu splice() tracing - binary tracing without printf overhead - structured logging records exposed under /debug/tracing/events - trace events embedded in function tracer output and other plugins - user-defined, per tracepoint filter expressions Signed-off-by: Zhao Lei &lt;zhaolei@cn.fujitsu.com&gt; Acked-by: Eduard - Gabriel Munteanu &lt;eduard.munteanu@linux360.ro&gt; Acked-by: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt; Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt; Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt; Cc: Tom Zanussi &lt;tzanussi@gmail.com&gt; LKML-Reference: &lt;49DEE6DA.80600@cn.fujitsu.com&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: space prohibited after that open parenthesis &#39;(&#39; #102: FILE: include/trace/kmem_event_types.h:22: + __field( unsigned long, call_site ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #102: FILE: include/trace/kmem_event_types.h:22: + __field( unsigned long, call_site ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #103: FILE: include/trace/kmem_event_types.h:23: + __field( const void *, ptr ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #103: FILE: include/trace/kmem_event_types.h:23: + __field( const void *, ptr ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #104: FILE: include/trace/kmem_event_types.h:24: + __field( size_t, bytes_req ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #104: FILE: include/trace/kmem_event_types.h:24: + __field( size_t, bytes_req ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #105: FILE: include/trace/kmem_event_types.h:25: + __field( size_t, bytes_alloc ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #105: FILE: include/trace/kmem_event_types.h:25: + __field( size_t, bytes_alloc ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #106: FILE: include/trace/kmem_event_types.h:26: + __field( gfp_t, gfp_flags ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #106: FILE: include/trace/kmem_event_types.h:26: + __field( gfp_t, gfp_flags ) WARNING: line over 80 characters #117: FILE: include/trace/kmem_event_types.h:37: + TP_printk(&quot;call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x&quot;, ERROR: space prohibited after that open parenthesis &#39;(&#39; #136: FILE: include/trace/kmem_event_types.h:56: + __field( unsigned long, call_site ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #136: FILE: include/trace/kmem_event_types.h:56: + __field( unsigned long, call_site ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #137: FILE: include/trace/kmem_event_types.h:57: + __field( const void *, ptr ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #137: FILE: include/trace/kmem_event_types.h:57: + __field( const void *, ptr ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #138: FILE: include/trace/kmem_event_types.h:58: + __field( size_t, bytes_req ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #138: FILE: include/trace/kmem_event_types.h:58: + __field( size_t, bytes_req ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #139: FILE: include/trace/kmem_event_types.h:59: + __field( size_t, bytes_alloc ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #139: FILE: include/trace/kmem_event_types.h:59: + __field( size_t, bytes_alloc ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #140: FILE: include/trace/kmem_event_types.h:60: + __field( gfp_t, gfp_flags ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #140: FILE: include/trace/kmem_event_types.h:60: + __field( gfp_t, gfp_flags ) WARNING: line over 80 characters #151: FILE: include/trace/kmem_event_types.h:71: + TP_printk(&quot;call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x&quot;, ERROR: space prohibited after that open parenthesis &#39;(&#39; #171: FILE: include/trace/kmem_event_types.h:91: + __field( unsigned long, call_site ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #171: FILE: include/trace/kmem_event_types.h:91: + __field( unsigned long, call_site ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #172: FILE: include/trace/kmem_event_types.h:92: + __field( const void *, ptr ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #172: FILE: include/trace/kmem_event_types.h:92: + __field( const void *, ptr ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #173: FILE: include/trace/kmem_event_types.h:93: + __field( size_t, bytes_req ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #173: FILE: include/trace/kmem_event_types.h:93: + __field( size_t, bytes_req ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #174: FILE: include/trace/kmem_event_types.h:94: + __field( size_t, bytes_alloc ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #174: FILE: include/trace/kmem_event_types.h:94: + __field( size_t, bytes_alloc ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #175: FILE: include/trace/kmem_event_types.h:95: + __field( gfp_t, gfp_flags ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #175: FILE: include/trace/kmem_event_types.h:95: + __field( gfp_t, gfp_flags ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #176: FILE: include/trace/kmem_event_types.h:96: + __field( int, node ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #176: FILE: include/trace/kmem_event_types.h:96: + __field( int, node ) WARNING: line over 80 characters #188: FILE: include/trace/kmem_event_types.h:108: + TP_printk(&quot;call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x node=%d&quot;, ERROR: space prohibited after that open parenthesis &#39;(&#39; #209: FILE: include/trace/kmem_event_types.h:129: + __field( unsigned long, call_site ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #209: FILE: include/trace/kmem_event_types.h:129: + __field( unsigned long, call_site ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #210: FILE: include/trace/kmem_event_types.h:130: + __field( const void *, ptr ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #210: FILE: include/trace/kmem_event_types.h:130: + __field( const void *, ptr ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #211: FILE: include/trace/kmem_event_types.h:131: + __field( size_t, bytes_req ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #211: FILE: include/trace/kmem_event_types.h:131: + __field( size_t, bytes_req ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #212: FILE: include/trace/kmem_event_types.h:132: + __field( size_t, bytes_alloc ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #212: FILE: include/trace/kmem_event_types.h:132: + __field( size_t, bytes_alloc ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #213: FILE: include/trace/kmem_event_types.h:133: + __field( gfp_t, gfp_flags ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #213: FILE: include/trace/kmem_event_types.h:133: + __field( gfp_t, gfp_flags ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #214: FILE: include/trace/kmem_event_types.h:134: + __field( int, node ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #214: FILE: include/trace/kmem_event_types.h:134: + __field( int, node ) WARNING: line over 80 characters #226: FILE: include/trace/kmem_event_types.h:146: + TP_printk(&quot;call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x node=%d&quot;, ERROR: space prohibited after that open parenthesis &#39;(&#39; #242: FILE: include/trace/kmem_event_types.h:162: + __field( unsigned long, call_site ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #242: FILE: include/trace/kmem_event_types.h:162: + __field( unsigned long, call_site ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #243: FILE: include/trace/kmem_event_types.h:163: + __field( const void *, ptr ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #243: FILE: include/trace/kmem_event_types.h:163: + __field( const void *, ptr ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #261: FILE: include/trace/kmem_event_types.h:181: + __field( unsigned long, call_site ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #261: FILE: include/trace/kmem_event_types.h:181: + __field( unsigned long, call_site ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #262: FILE: include/trace/kmem_event_types.h:182: + __field( const void *, ptr ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #262: FILE: include/trace/kmem_event_types.h:182: + __field( const void *, ptr ) total: 52 errors, 4 warnings, 247 lines checked </pre> badincludes: tracing, kmemtrace: Make kmem tracepoints use TRACE_EVENT macro <pre>commit fc182a4330fc22ea1b68fa3d5064dd85a73a4c4a Author: Zhaolei &lt;zhaolei@cn.fujitsu.com&gt; Date: Fri Apr 10 14:27:38 2009 +0800 tracing, kmemtrace: Make kmem tracepoints use TRACE_EVENT macro TRACE_EVENT is a more generic way to define tracepoints. Doing so adds these new capabilities to this tracepoint: - zero-copy and per-cpu splice() tracing - binary tracing without printf overhead - structured logging records exposed under /debug/tracing/events - trace events embedded in function tracer output and other plugins - user-defined, per tracepoint filter expressions Signed-off-by: Zhao Lei &lt;zhaolei@cn.fujitsu.com&gt; Acked-by: Eduard - Gabriel Munteanu &lt;eduard.munteanu@linux360.ro&gt; Acked-by: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt; Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt; Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt; Cc: Tom Zanussi &lt;tzanussi@gmail.com&gt; LKML-Reference: &lt;49DEE6DA.80600@cn.fujitsu.com&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>diff --git a/include/trace/trace_events.h b/include/trace/trace_events.h index 0e2aa80..13d6b85 100644 --- a/include/trace/trace_events.h +++ b/include/trace/trace_events.h @@ -4,3 +4,4 @@ #include &lt;trace/irq.h&gt; #include &lt;trace/lockdep.h&gt; #include &lt;trace/skb.h&gt; +#include &lt;trace/kmem.h&gt; include trace/kmem.h inserted after trace/skb.h </pre> checkpatch: x86: irq.c - tiny cleanup <pre>commit edea7148a87c099e5d5d4838285cc27e459588b7 Author: Cyrill Gorcunov &lt;gorcunov@openvz.org&gt; Date: Sun Apr 12 20:47:39 2009 +0400 x86: irq.c - tiny cleanup Impact: cleanup, robustization 1) guard ack_bad_irq with printk_ratelimit since there is no guarantee we will not be flooded one day 2) use pr_emerg() helper Signed-off-by: Cyrill Gorcunov &lt;gorcunov@openvz.org&gt; LKML-Reference: &lt;20090412165058.277579847@openvz.org&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>WARNING: line over 80 characters #46: FILE: arch/x86/kernel/irq.c:223: + pr_emerg(&quot;%s: %d.%d No irq handler for vector (irq %d)\n&quot;, total: 0 errors, 1 warnings, 27 lines checked </pre> coccinelle: x86: apic - introduce imcr_ helpers <pre>commit c0eaa4536f08b98fbcfa7fce5b7b0de1bebcb0e1 Author: Cyrill Gorcunov &lt;gorcunov@openvz.org&gt; Date: Sun Apr 12 20:47:40 2009 +0400 x86: apic - introduce imcr_ helpers Impact: cleanup Distinguish port writting magic into helpers with comments. Signed-off-by: Cyrill Gorcunov &lt;gorcunov@openvz.org&gt; LKML-Reference: &lt;20090412165058.535921550@openvz.org&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/local.cocci: // local_irq_save should be matched by local_irq_restore in error-handling code // // Confidence: Moderate // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/local.html // Options: -no_includes -include_headers diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index c3be10f..6ea185c 100644 --- a/tmp/7wIqobCg3e.c +++ b/tmp/ZwKkwJfylM.c @@ -2010,6 +2010,7 @@ static int lapic_resume(struct sys_device *dev) ioapic_entries = alloc_ioapic_entries(); if (!ioapic_entries) { WARN(1, &quot;Alloc ioapic_entries in lapic resume failed.&quot;); + local_irq_restore(flags); return -ENOMEM; } @@ -2025,8 +2026,9 @@ static int lapic_resume(struct sys_device *dev) enable_x2apic(); } #else - if (!apic_pm_state.active) + if (!apic_pm_state.active){local_irq_restore(flags); return 0; + } local_irq_save(flags); if (x2apic) </pre> coccinelle: x86: apic - introduce dummy apic operations <pre>commit 08306ce61d6848e6fbf74fa4cc693c3fb29e943f Author: Cyrill Gorcunov &lt;gorcunov@openvz.org&gt; Date: Sun Apr 12 20:47:41 2009 +0400 x86: apic - introduce dummy apic operations Impact: refactor, speed up and robustize code In case if apic was disabled by kernel option or by hardware limits we can use dummy operations in apic-&gt;write to simplify the ack_APIC_irq() code. At the lame time the patch fixes the missed EOI in do_IRQ function (which has place if kernel is compiled as X86-32 and interrupt without handler happens where apic was not asked to be disabled via kernel option). Note that native_apic_write_dummy() consists of WARN_ON_ONCE to catch any buggy writes on enabled APICs. Could be removed after some time of testing. Signed-off-by: Cyrill Gorcunov &lt;gorcunov@openvz.org&gt; LKML-Reference: &lt;20090412165058.724788431@openvz.org&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/local.cocci: // local_irq_save should be matched by local_irq_restore in error-handling code // // Confidence: Moderate // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/local.html // Options: -no_includes -include_headers diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 9b849d4..c20d414 100644 --- a/tmp/q5T6pzCAVV.c +++ b/tmp/zRwVpUisL9.c @@ -2034,6 +2034,7 @@ static int lapic_resume(struct sys_device *dev) ioapic_entries = alloc_ioapic_entries(); if (!ioapic_entries) { WARN(1, &quot;Alloc ioapic_entries in lapic resume failed.&quot;); + local_irq_restore(flags); return -ENOMEM; } @@ -2049,8 +2050,9 @@ static int lapic_resume(struct sys_device *dev) enable_x2apic(); } #else - if (!apic_pm_state.active) + if (!apic_pm_state.active){local_irq_restore(flags); return 0; + } local_irq_save(flags); if (x2apic) </pre> coccinelle: x86: fix function definitions after: x86: apic - introduce imcr_ helpers <pre>commit 5cda395f4a262788d8ed79ac8a26a2b821e5f751 Author: Alexander van Heukelum &lt;heukelum@mailshack.com&gt; Date: Mon Apr 13 17:39:24 2009 +0200 x86: fix function definitions after: x86: apic - introduce imcr_ helpers The patch &quot;introduce imcr_ helpers&quot; introduced good comments, but also a few new compile warnings. This fixes the function definitions to have a &#39;void&#39; return type. Signed-off-by: Alexander van Heukelum &lt;heukelum@fastmail.fm&gt; Acked-by: Cyrill Gorcunov &lt;gorcunov@openvz.org&gt; LKML-Reference: &lt;20090413153924.GA20287@mailshack.com&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/local.cocci: // local_irq_save should be matched by local_irq_restore in error-handling code // // Confidence: Moderate // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/local.html // Options: -no_includes -include_headers diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 4b48ff9..7061955 100644 --- a/tmp/7apKjGcqfz.c +++ b/tmp/oO3h8Mrp1j.c @@ -2034,6 +2034,7 @@ static int lapic_resume(struct sys_device *dev) ioapic_entries = alloc_ioapic_entries(); if (!ioapic_entries) { WARN(1, &quot;Alloc ioapic_entries in lapic resume failed.&quot;); + local_irq_restore(flags); return -ENOMEM; } @@ -2049,8 +2050,9 @@ static int lapic_resume(struct sys_device *dev) enable_x2apic(); } #else - if (!apic_pm_state.active) + if (!apic_pm_state.active){local_irq_restore(flags); return 0; + } local_irq_save(flags); if (x2apic) </pre> checkpatch: tracing/filters: add run-time field descriptions to TRACE_EVENT_FORMAT events <pre>commit e1112b4d96859367a93468027c9635e2ac04eb3f Author: Tom Zanussi &lt;tzanussi@gmail.com&gt; Date: Tue Mar 31 00:48:49 2009 -0500 tracing/filters: add run-time field descriptions to TRACE_EVENT_FORMAT events This patch adds run-time field descriptions to all the event formats exported using TRACE_EVENT_FORMAT. It also hooks up all the tracers that use them (i.e. the tracers in the &#39;ftrace subsystem&#39;) so they can also have their output filtered by the event-filtering mechanism. When I was testing this, there were a couple of things that fooled me into thinking the filters weren&#39;t working, when actually they were - I&#39;ll mention them here so others don&#39;t make the same mistakes (and file bug reports. ;-) One is that some of the tracers trace multiple events e.g. the sched_switch tracer uses the context_switch and wakeup events, and if you don&#39;t set filters on all of the traced events, the unfiltered output from the events without filters on them can make it look like the filtering as a whole isn&#39;t working properly, when actually it is doing what it was asked to do - it just wasn&#39;t asked to do the right thing. The other is that for the really high-volume tracers e.g. the function tracer, the volume of filtered events can be so high that it pushes the unfiltered events out of the ring buffer before they can be read so e.g. cat&#39;ing the trace file repeatedly shows either no output, or once in awhile some output but that isn&#39;t there the next time you read the trace, which isn&#39;t what you normally expect when reading the trace file. If you read from the trace_pipe file though, you can catch them before they disappear. Changes from v1: As suggested by Frederic Weisbecker: - get rid of externs in functions - added unlikely() to filter_check_discard() Signed-off-by: Tom Zanussi &lt;tzanussi@gmail.com&gt; Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: Macros with multiple statements should be enclosed in a do - while loop #266: FILE: kernel/trace/trace.h:877: +#define __common_field(type, item) \ + ret = trace_define_field(event_call, #type, &quot;common_&quot; #item, \ + offsetof(typeof(field.ent), item), \ + sizeof(field.ent.item)); \ + if (ret) \ + return ret; ERROR: Macros with multiple statements should be enclosed in a do - while loop #435: FILE: kernel/trace/trace_export.c:115: +#define TRACE_FIELD(type, item, assign) \ + ret = trace_define_field(event_call, #type, #item, \ + offsetof(typeof(field), item), \ + sizeof(field.item)); \ + if (ret) \ + return ret; ERROR: Macros with multiple statements should be enclosed in a do - while loop #443: FILE: kernel/trace/trace_export.c:123: +#define TRACE_FIELD_SPECIAL(type, item, len, cmd) \ + ret = trace_define_field(event_call, #type &quot;[&quot; #len &quot;]&quot;, #item, \ + offsetof(typeof(field), item), \ + sizeof(field.item)); \ + if (ret) \ + return ret; total: 3 errors, 0 warnings, 401 lines checked </pre> coccinelle: tracing/filters: add run-time field descriptions to TRACE_EVENT_FORMAT events <pre>commit e1112b4d96859367a93468027c9635e2ac04eb3f Author: Tom Zanussi &lt;tzanussi@gmail.com&gt; Date: Tue Mar 31 00:48:49 2009 -0500 tracing/filters: add run-time field descriptions to TRACE_EVENT_FORMAT events This patch adds run-time field descriptions to all the event formats exported using TRACE_EVENT_FORMAT. It also hooks up all the tracers that use them (i.e. the tracers in the &#39;ftrace subsystem&#39;) so they can also have their output filtered by the event-filtering mechanism. When I was testing this, there were a couple of things that fooled me into thinking the filters weren&#39;t working, when actually they were - I&#39;ll mention them here so others don&#39;t make the same mistakes (and file bug reports. ;-) One is that some of the tracers trace multiple events e.g. the sched_switch tracer uses the context_switch and wakeup events, and if you don&#39;t set filters on all of the traced events, the unfiltered output from the events without filters on them can make it look like the filtering as a whole isn&#39;t working properly, when actually it is doing what it was asked to do - it just wasn&#39;t asked to do the right thing. The other is that for the really high-volume tracers e.g. the function tracer, the volume of filtered events can be so high that it pushes the unfiltered events out of the ring buffer before they can be read so e.g. cat&#39;ing the trace file repeatedly shows either no output, or once in awhile some output but that isn&#39;t there the next time you read the trace, which isn&#39;t what you normally expect when reading the trace file. If you read from the trace_pipe file though, you can catch them before they disappear. Changes from v1: As suggested by Frederic Weisbecker: - get rid of externs in functions - added unlikely() to filter_check_discard() Signed-off-by: Tom Zanussi &lt;tzanussi@gmail.com&gt; Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index 470ad94..487dbce 100644 --- a/tmp/rg1XiirB70.c +++ b/tmp/Og6WI7HfVA.c @@ -202,8 +202,7 @@ static int __filter_add_pred(struct ftrace_event_call *call, filter_free_preds(call); if (!call-&gt;preds) { - call-&gt;preds = kzalloc(MAX_FILTER_PRED * sizeof(pred), - GFP_KERNEL); + call-&gt;preds = kcalloc(MAX_FILTER_PRED, sizeof(pred), GFP_KERNEL); if (!call-&gt;preds) return -ENOMEM; } @@ -305,8 +304,7 @@ int filter_add_subsystem_pred(struct event_subsystem *system, filter_free_subsystem_preds(system); if (!system-&gt;preds) { - system-&gt;preds = kzalloc(MAX_FILTER_PRED * sizeof(pred), - GFP_KERNEL); + system-&gt;preds = kcalloc(MAX_FILTER_PRED, sizeof(pred), GFP_KERNEL); if (!system-&gt;preds) return -ENOMEM; } </pre> coccinelle: tracing/filters: allow on-the-fly filter switching <pre>commit 0a19e53c1514ad8e9c3cbab40c6c3f52c86f403d Author: Tom Zanussi &lt;tzanussi@gmail.com&gt; Date: Mon Apr 13 03:17:50 2009 -0500 tracing/filters: allow on-the-fly filter switching This patch allows event filters to be safely removed or switched on-the-fly while avoiding the use of rcu or the suspension of tracing of previous versions. It does it by adding a new filter_pred_none() predicate function which does nothing and by never deallocating either the predicates or any of the filter_pred members used in matching; the predicate lists are allocated and initialized during ftrace_event_calls initialization. Whenever a filter is removed or replaced, the filter_pred_* functions currently in use by the affected ftrace_event_call are immediately switched over to to the filter_pred_none() function, while the rest of the filter_pred members are left intact, allowing any currently executing filter_pred_* functions to finish up, using the values they&#39;re currently using. In the case of filter replacement, the new predicate values are copied into the old predicates after the above step, and the filter_pred_none() functions are replaced by the filter_pred_* functions for the new filter. In this case, it is possible though very unlikely that a previous filter_pred_* is still running even after the filter_pred_none() switch and the switch to the new filter_pred_*. In that case, however, because nothing has been deallocated in the filter_pred, the worst that can happen is that the old filter_pred_* function sees the new values and as a result produces either a false positive or a false negative, depending on the values it finds. So one downside to this method is that rarely, it can produce a bad match during the filter switch, but it should be possible to live with that, IMHO. The other downside is that at least in this patch the predicate lists are always pre-allocated, taking up memory from the start. They could probably be allocated on first-use, and de-allocated when tracing is completely stopped - if this patch makes sense, I could create another one to do that later on. Oh, and it also places a restriction on the size of __arrays in events, currently set to 128, since they can&#39;t be larger than the now embedded str_val arrays in the filter_pred struct. Signed-off-by: Tom Zanussi &lt;tzanussi@gmail.com&gt; Acked-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt; Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt; Cc: paulmck@linux.vnet.ibm.com LKML-Reference: &lt;1239610670.6660.49.camel@tropicana&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index de42dad..d66cf60 100644 --- a/tmp/0Eb6V2KSgY.c +++ b/tmp/CiD54PgrDZ.c @@ -196,7 +196,7 @@ int init_preds(struct ftrace_event_call *call) call-&gt;n_preds = 0; - call-&gt;preds = kzalloc(MAX_FILTER_PRED * sizeof(pred), GFP_KERNEL); + call-&gt;preds = kcalloc(MAX_FILTER_PRED, sizeof(pred), GFP_KERNEL); if (!call-&gt;preds) return -ENOMEM; @@ -326,8 +326,7 @@ int filter_add_subsystem_pred(struct event_subsystem *system, filter_free_subsystem_preds(system); if (!system-&gt;n_preds) { - system-&gt;preds = kzalloc(MAX_FILTER_PRED * sizeof(pred), - GFP_KERNEL); + system-&gt;preds = kcalloc(MAX_FILTER_PRED, sizeof(pred), GFP_KERNEL); if (!system-&gt;preds) return -ENOMEM; } </pre> checkpatch: smack: implement logging V3 <pre>commit ecfcc53fef3c357574bb6143dce6631e6d56295c Author: Etienne Basset &lt;etienne.basset@numericable.fr&gt; Date: Wed Apr 8 20:40:06 2009 +0200 smack: implement logging V3 the following patch, add logging of Smack security decisions. This is of course very useful to understand what your current smack policy does. As suggested by Casey, it also now forbids labels with &#39;, &quot; or \ It introduces a &#39;/smack/logging&#39; switch : 0: no logging 1: log denied (default) 2: log accepted 3: log denied&amp;accepted Signed-off-by: Etienne Basset &lt;etienne.basset@numericable.fr&gt; Acked-by: Casey Schaufler &lt;casey@schaufler-ca.com&gt; Acked-by: Eric Paris &lt;eparis@redhat.com&gt; Signed-off-by: James Morris &lt;jmorris@namei.org&gt; </pre>---<pre>ERROR: code indent should use tabs where possible #437: FILE: security/smack/smack_access.c:293: + int result, struct smk_audit_info *ad)$ total: 1 errors, 0 warnings, 1383 lines checked </pre> badincludes: smack: implement logging V3 <pre>commit ecfcc53fef3c357574bb6143dce6631e6d56295c Author: Etienne Basset &lt;etienne.basset@numericable.fr&gt; Date: Wed Apr 8 20:40:06 2009 +0200 smack: implement logging V3 the following patch, add logging of Smack security decisions. This is of course very useful to understand what your current smack policy does. As suggested by Casey, it also now forbids labels with &#39;, &quot; or \ It introduces a &#39;/smack/logging&#39; switch : 0: no logging 1: log denied (default) 2: log accepted 3: log denied&amp;accepted Signed-off-by: Etienne Basset &lt;etienne.basset@numericable.fr&gt; Acked-by: Casey Schaufler &lt;casey@schaufler-ca.com&gt; Acked-by: Eric Paris &lt;eparis@redhat.com&gt; Signed-off-by: James Morris &lt;jmorris@namei.org&gt; </pre>---<pre>diff --git a/security/smack/smack.h b/security/smack/smack.h index 42ef313..243bec1 100644 --- a/security/smack/smack.h +++ b/security/smack/smack.h @@ -20,6 +20,7 @@ #include &lt;net/netlabel.h&gt; #include &lt;linux/list.h&gt; #include &lt;linux/rculist.h&gt; +#include &lt;linux/lsm_audit.h&gt; /* * Why 23? CIPSO is constrained to 30, so a 32 byte buffer is include linux/lsm_audit.h inserted after linux/rculist.h </pre> checkpatch: rcu: Add __rcu_pending tracing to hierarchical RCU <pre>commit 7ba5c840e64d4a967379f1ae3eca73278180b11d Author: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt; Date: Mon Apr 13 21:31:17 2009 -0700 rcu: Add __rcu_pending tracing to hierarchical RCU Add tracing to __rcu_pending() to provide information on why RCU processing was kicked off. This is helpful for debugging hierarchical RCU, and might also be helpful in learning how hierarchical RCU operates. Located-by: Anton Blanchard &lt;anton@au1.ibm.com&gt; Tested-by: Anton Blanchard &lt;anton@au1.ibm.com&gt; Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt; Cc: anton@samba.org Cc: akpm@linux-foundation.org Cc: dipankar@in.ibm.com Cc: manfred@colorfullife.com Cc: cl@linux-foundation.org Cc: josht@linux.vnet.ibm.com Cc: schamp@sgi.com Cc: niv@us.ibm.com Cc: dvhltc@us.ibm.com Cc: ego@in.ibm.com Cc: laijs@cn.fujitsu.com Cc: rostedt@goodmis.org Cc: peterz@infradead.org Cc: penberg@cs.helsinki.fi Cc: andi@firstfloor.org Cc: &quot;Paul E. McKenney&quot; &lt;paulmck@linux.vnet.ibm.com&gt; LKML-Reference: &lt;1239683479943-git-send-email-&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>WARNING: struct file_operations should normally be const #159: FILE: kernel/rcutree_trace.c:258: +static struct file_operations rcu_pending_fops = { total: 0 errors, 1 warnings, 148 lines checked </pre> coccinelle: rcu: Add __rcu_pending tracing to hierarchical RCU <pre>commit 7ba5c840e64d4a967379f1ae3eca73278180b11d Author: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt; Date: Mon Apr 13 21:31:17 2009 -0700 rcu: Add __rcu_pending tracing to hierarchical RCU Add tracing to __rcu_pending() to provide information on why RCU processing was kicked off. This is helpful for debugging hierarchical RCU, and might also be helpful in learning how hierarchical RCU operates. Located-by: Anton Blanchard &lt;anton@au1.ibm.com&gt; Tested-by: Anton Blanchard &lt;anton@au1.ibm.com&gt; Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt; Cc: anton@samba.org Cc: akpm@linux-foundation.org Cc: dipankar@in.ibm.com Cc: manfred@colorfullife.com Cc: cl@linux-foundation.org Cc: josht@linux.vnet.ibm.com Cc: schamp@sgi.com Cc: niv@us.ibm.com Cc: dvhltc@us.ibm.com Cc: ego@in.ibm.com Cc: laijs@cn.fujitsu.com Cc: rostedt@goodmis.org Cc: peterz@infradead.org Cc: penberg@cs.helsinki.fi Cc: andi@firstfloor.org Cc: &quot;Paul E. McKenney&quot; &lt;paulmck@linux.vnet.ibm.com&gt; LKML-Reference: &lt;1239683479943-git-send-email-&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/round.cocci: // roundup and DIV_ROUND_UP are more readable than the expanded calculations // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/round.html // Options: -no_includes -include_headers diff --git a/kernel/rcutree.c b/kernel/rcutree.c index 0dccfbb..d2567ee 100644 --- a/tmp/AqrDgxgRle.c +++ b/tmp/xONGsJfHbk.c @@ -1457,7 +1457,7 @@ static void __init rcu_init_levelspread(struct rcu_state *rsp) cprv = NR_CPUS; for (i = NUM_RCU_LVLS - 1; i &gt;= 0; i--) { ccur = rsp-&gt;levelcnt[i]; - rsp-&gt;levelspread[i] = (cprv + ccur - 1) / ccur; + rsp-&gt;levelspread[i] = DIV_ROUND_UP(cprv, ccur); cprv = ccur; } } </pre> checkpatch: ALSA: lx6464es - driver for the digigram lx6464es interface <pre>commit 02bec490450836ebbd628e97ec03f10b57def8ce Author: Tim Blechmann &lt;tim@klingt.org&gt; Date: Tue Mar 24 12:24:35 2009 +0100 ALSA: lx6464es - driver for the digigram lx6464es interface prototype of a driver for the digigram lx6464es 64 channel ethersound interface. Signed-off-by: Tim Blechmann &lt;tim@klingt.org&gt; Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt; </pre>---<pre>WARNING: line over 80 characters #1030: FILE: sound/pci/lx6464es/lx6464es.c:949: +static int __devinit lx_proc_create(struct snd_card *card, struct lx6464es *chip) total: 0 errors, 1 warnings, 3368 lines checked </pre> checkpatch: tracing: consolidate trace and trace_event headers <pre>commit ea20d9293ce423a39717ed4375393129a2e701f9 Author: Steven Rostedt &lt;srostedt@redhat.com&gt; Date: Fri Apr 10 08:54:16 2009 -0400 tracing: consolidate trace and trace_event headers Impact: clean up Neil Horman (et. al.) criticized the way the trace events were broken up into two files. The reason for that was that ftrace needed to separate out the declarations from where the #include &lt;linux/tracepoint.h&gt; was used. It then dawned on me that the tracepoint.h header only needs to define the TRACE_EVENT macro if it is not already defined. The solution is simply to test if TRACE_EVENT is defined, and if it is not then the linux/tracepoint.h header can define it. This change consolidates all the &lt;traces&gt;.h and &lt;traces&gt;_event_types.h into the &lt;traces&gt;.h file. Reported-by: Neil Horman &lt;nhorman@tuxdriver.com&gt; Reported-by: Theodore Tso &lt;tytso@mit.edu&gt; Reported-by: Jiaying Zhang &lt;jiayingz@google.com&gt; Cc: Zhaolei &lt;zhaolei@cn.fujitsu.com&gt; Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt; Cc: Peter Zijlstra &lt;peterz@infradead.org&gt; Cc: Jason Baron &lt;jbaron@redhat.com&gt; Cc: Mathieu Desnoyers &lt;mathieu.desnoyers@polymtl.ca&gt; Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt; </pre>---<pre>ERROR: space prohibited after that open parenthesis &#39;(&#39; #106: FILE: include/trace/irq.h:29: + __field( int, irq ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #106: FILE: include/trace/irq.h:29: + __field( int, irq ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #107: FILE: include/trace/irq.h:30: + __field( int, ret ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #107: FILE: include/trace/irq.h:30: + __field( int, ret ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #222: FILE: include/trace/kmem.h:21: + __field( unsigned long, call_site ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #222: FILE: include/trace/kmem.h:21: + __field( unsigned long, call_site ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #223: FILE: include/trace/kmem.h:22: + __field( const void *, ptr ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #223: FILE: include/trace/kmem.h:22: + __field( const void *, ptr ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #224: FILE: include/trace/kmem.h:23: + __field( size_t, bytes_req ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #224: FILE: include/trace/kmem.h:23: + __field( size_t, bytes_req ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #225: FILE: include/trace/kmem.h:24: + __field( size_t, bytes_alloc ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #225: FILE: include/trace/kmem.h:24: + __field( size_t, bytes_alloc ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #226: FILE: include/trace/kmem.h:25: + __field( gfp_t, gfp_flags ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #226: FILE: include/trace/kmem.h:25: + __field( gfp_t, gfp_flags ) WARNING: line over 80 characters #237: FILE: include/trace/kmem.h:36: + TP_printk(&quot;call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x&quot;, ERROR: space prohibited after that open parenthesis &#39;(&#39; #256: FILE: include/trace/kmem.h:55: + __field( unsigned long, call_site ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #256: FILE: include/trace/kmem.h:55: + __field( unsigned long, call_site ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #257: FILE: include/trace/kmem.h:56: + __field( const void *, ptr ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #257: FILE: include/trace/kmem.h:56: + __field( const void *, ptr ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #258: FILE: include/trace/kmem.h:57: + __field( size_t, bytes_req ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #258: FILE: include/trace/kmem.h:57: + __field( size_t, bytes_req ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #259: FILE: include/trace/kmem.h:58: + __field( size_t, bytes_alloc ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #259: FILE: include/trace/kmem.h:58: + __field( size_t, bytes_alloc ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #260: FILE: include/trace/kmem.h:59: + __field( gfp_t, gfp_flags ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #260: FILE: include/trace/kmem.h:59: + __field( gfp_t, gfp_flags ) WARNING: line over 80 characters #271: FILE: include/trace/kmem.h:70: + TP_printk(&quot;call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x&quot;, ERROR: space prohibited after that open parenthesis &#39;(&#39; #291: FILE: include/trace/kmem.h:90: + __field( unsigned long, call_site ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #291: FILE: include/trace/kmem.h:90: + __field( unsigned long, call_site ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #292: FILE: include/trace/kmem.h:91: + __field( const void *, ptr ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #292: FILE: include/trace/kmem.h:91: + __field( const void *, ptr ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #293: FILE: include/trace/kmem.h:92: + __field( size_t, bytes_req ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #293: FILE: include/trace/kmem.h:92: + __field( size_t, bytes_req ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #294: FILE: include/trace/kmem.h:93: + __field( size_t, bytes_alloc ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #294: FILE: include/trace/kmem.h:93: + __field( size_t, bytes_alloc ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #295: FILE: include/trace/kmem.h:94: + __field( gfp_t, gfp_flags ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #295: FILE: include/trace/kmem.h:94: + __field( gfp_t, gfp_flags ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #296: FILE: include/trace/kmem.h:95: + __field( int, node ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #296: FILE: include/trace/kmem.h:95: + __field( int, node ) WARNING: line over 80 characters #308: FILE: include/trace/kmem.h:107: + TP_printk(&quot;call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x node=%d&quot;, ERROR: space prohibited after that open parenthesis &#39;(&#39; #329: FILE: include/trace/kmem.h:128: + __field( unsigned long, call_site ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #329: FILE: include/trace/kmem.h:128: + __field( unsigned long, call_site ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #330: FILE: include/trace/kmem.h:129: + __field( const void *, ptr ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #330: FILE: include/trace/kmem.h:129: + __field( const void *, ptr ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #331: FILE: include/trace/kmem.h:130: + __field( size_t, bytes_req ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #331: FILE: include/trace/kmem.h:130: + __field( size_t, bytes_req ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #332: FILE: include/trace/kmem.h:131: + __field( size_t, bytes_alloc ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #332: FILE: include/trace/kmem.h:131: + __field( size_t, bytes_alloc ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #333: FILE: include/trace/kmem.h:132: + __field( gfp_t, gfp_flags ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #333: FILE: include/trace/kmem.h:132: + __field( gfp_t, gfp_flags ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #334: FILE: include/trace/kmem.h:133: + __field( int, node ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #334: FILE: include/trace/kmem.h:133: + __field( int, node ) WARNING: line over 80 characters #346: FILE: include/trace/kmem.h:145: + TP_printk(&quot;call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x node=%d&quot;, ERROR: space prohibited after that open parenthesis &#39;(&#39; #362: FILE: include/trace/kmem.h:161: + __field( unsigned long, call_site ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #362: FILE: include/trace/kmem.h:161: + __field( unsigned long, call_site ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #363: FILE: include/trace/kmem.h:162: + __field( const void *, ptr ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #363: FILE: include/trace/kmem.h:162: + __field( const void *, ptr ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #381: FILE: include/trace/kmem.h:180: + __field( unsigned long, call_site ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #381: FILE: include/trace/kmem.h:180: + __field( unsigned long, call_site ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #382: FILE: include/trace/kmem.h:181: + __field( const void *, ptr ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #382: FILE: include/trace/kmem.h:181: + __field( const void *, ptr ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #548: FILE: include/trace/sched.h:20: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #548: FILE: include/trace/sched.h:20: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #549: FILE: include/trace/sched.h:21: + __field( pid_t, pid ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #549: FILE: include/trace/sched.h:21: + __field( pid_t, pid ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #570: FILE: include/trace/sched.h:42: + __field( int, ret ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #570: FILE: include/trace/sched.h:42: + __field( int, ret ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #593: FILE: include/trace/sched.h:65: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #593: FILE: include/trace/sched.h:65: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #594: FILE: include/trace/sched.h:66: + __field( pid_t, pid ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #594: FILE: include/trace/sched.h:66: + __field( pid_t, pid ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #595: FILE: include/trace/sched.h:67: + __field( int, prio ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #595: FILE: include/trace/sched.h:67: + __field( int, prio ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #621: FILE: include/trace/sched.h:93: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #621: FILE: include/trace/sched.h:93: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #622: FILE: include/trace/sched.h:94: + __field( pid_t, pid ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #622: FILE: include/trace/sched.h:94: + __field( pid_t, pid ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #623: FILE: include/trace/sched.h:95: + __field( int, prio ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #623: FILE: include/trace/sched.h:95: + __field( int, prio ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #624: FILE: include/trace/sched.h:96: + __field( int, success ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #624: FILE: include/trace/sched.h:96: + __field( int, success ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #652: FILE: include/trace/sched.h:124: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #652: FILE: include/trace/sched.h:124: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #653: FILE: include/trace/sched.h:125: + __field( pid_t, pid ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #653: FILE: include/trace/sched.h:125: + __field( pid_t, pid ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #654: FILE: include/trace/sched.h:126: + __field( int, prio ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #654: FILE: include/trace/sched.h:126: + __field( int, prio ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #655: FILE: include/trace/sched.h:127: + __field( int, success ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #655: FILE: include/trace/sched.h:127: + __field( int, success ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #684: FILE: include/trace/sched.h:156: + __array( char, prev_comm, TASK_COMM_LEN ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #684: FILE: include/trace/sched.h:156: + __array( char, prev_comm, TASK_COMM_LEN ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #685: FILE: include/trace/sched.h:157: + __field( pid_t, prev_pid ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #685: FILE: include/trace/sched.h:157: + __field( pid_t, prev_pid ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #686: FILE: include/trace/sched.h:158: + __field( int, prev_prio ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #686: FILE: include/trace/sched.h:158: + __field( int, prev_prio ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #687: FILE: include/trace/sched.h:159: + __array( char, next_comm, TASK_COMM_LEN ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #687: FILE: include/trace/sched.h:159: + __array( char, next_comm, TASK_COMM_LEN ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #688: FILE: include/trace/sched.h:160: + __field( pid_t, next_pid ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #688: FILE: include/trace/sched.h:160: + __field( pid_t, next_pid ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #689: FILE: include/trace/sched.h:161: + __field( int, next_prio ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #689: FILE: include/trace/sched.h:161: + __field( int, next_prio ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #716: FILE: include/trace/sched.h:188: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #716: FILE: include/trace/sched.h:188: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #717: FILE: include/trace/sched.h:189: + __field( pid_t, pid ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #717: FILE: include/trace/sched.h:189: + __field( pid_t, pid ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #718: FILE: include/trace/sched.h:190: + __field( int, prio ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #718: FILE: include/trace/sched.h:190: + __field( int, prio ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #719: FILE: include/trace/sched.h:191: + __field( int, orig_cpu ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #719: FILE: include/trace/sched.h:191: + __field( int, orig_cpu ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #720: FILE: include/trace/sched.h:192: + __field( int, dest_cpu ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #720: FILE: include/trace/sched.h:192: + __field( int, dest_cpu ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #746: FILE: include/trace/sched.h:218: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #746: FILE: include/trace/sched.h:218: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #747: FILE: include/trace/sched.h:219: + __field( pid_t, pid ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #747: FILE: include/trace/sched.h:219: + __field( pid_t, pid ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #748: FILE: include/trace/sched.h:220: + __field( int, prio ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #748: FILE: include/trace/sched.h:220: + __field( int, prio ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #771: FILE: include/trace/sched.h:243: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #771: FILE: include/trace/sched.h:243: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #772: FILE: include/trace/sched.h:244: + __field( pid_t, pid ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #772: FILE: include/trace/sched.h:244: + __field( pid_t, pid ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #773: FILE: include/trace/sched.h:245: + __field( int, prio ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #773: FILE: include/trace/sched.h:245: + __field( int, prio ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #796: FILE: include/trace/sched.h:268: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #796: FILE: include/trace/sched.h:268: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #797: FILE: include/trace/sched.h:269: + __field( pid_t, pid ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #797: FILE: include/trace/sched.h:269: + __field( pid_t, pid ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #798: FILE: include/trace/sched.h:270: + __field( int, prio ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #798: FILE: include/trace/sched.h:270: + __field( int, prio ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #821: FILE: include/trace/sched.h:293: + __array( char, parent_comm, TASK_COMM_LEN ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #821: FILE: include/trace/sched.h:293: + __array( char, parent_comm, TASK_COMM_LEN ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #822: FILE: include/trace/sched.h:294: + __field( pid_t, parent_pid ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #822: FILE: include/trace/sched.h:294: + __field( pid_t, parent_pid ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #823: FILE: include/trace/sched.h:295: + __array( char, child_comm, TASK_COMM_LEN ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #823: FILE: include/trace/sched.h:295: + __array( char, child_comm, TASK_COMM_LEN ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #824: FILE: include/trace/sched.h:296: + __field( pid_t, child_pid ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #824: FILE: include/trace/sched.h:296: + __field( pid_t, child_pid ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #849: FILE: include/trace/sched.h:321: + __field( int, sig ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #849: FILE: include/trace/sched.h:321: + __field( int, sig ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #850: FILE: include/trace/sched.h:322: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #850: FILE: include/trace/sched.h:322: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #851: FILE: include/trace/sched.h:323: + __field( pid_t, pid ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #851: FILE: include/trace/sched.h:323: + __field( pid_t, pid ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #1236: FILE: include/trace/skb.h:20: + __field( void *, skbaddr ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #1236: FILE: include/trace/skb.h:20: + __field( void *, skbaddr ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #1237: FILE: include/trace/skb.h:21: + __field( unsigned short, protocol ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #1237: FILE: include/trace/skb.h:21: + __field( unsigned short, protocol ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #1238: FILE: include/trace/skb.h:22: + __field( void *, location ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #1238: FILE: include/trace/skb.h:22: + __field( void *, location ) WARNING: braces {} are not necessary for single statement blocks #1243: FILE: include/trace/skb.h:27: + if (skb) { + __entry-&gt;protocol = ntohs(skb-&gt;protocol); + } total: 144 errors, 5 warnings, 791 lines checked </pre> checkpatch: tracing: create automated trace defines <pre>commit a8d154b009168337494fbf345671bab74d3e4b8b Author: Steven Rostedt &lt;srostedt@redhat.com&gt; Date: Fri Apr 10 09:36:00 2009 -0400 tracing: create automated trace defines This patch lowers the number of places a developer must modify to add new tracepoints. The current method to add a new tracepoint into an existing system is to write the trace point macro in the trace header with one of the macros TRACE_EVENT, TRACE_FORMAT or DECLARE_TRACE, then they must add the same named item into the C file with the macro DEFINE_TRACE(name) and then add the trace point. This change cuts out the needing to add the DEFINE_TRACE(name). Every file that uses the tracepoint must still include the trace/&lt;type&gt;.h file, but the one C file must also add a define before the including of that file. #define CREATE_TRACE_POINTS #include &lt;trace/mytrace.h&gt; This will cause the trace/mytrace.h file to also produce the C code necessary to implement the trace point. Note, if more than one trace/&lt;type&gt;.h is used to create the C code it is best to list them all together. #define CREATE_TRACE_POINTS #include &lt;trace/foo.h&gt; #include &lt;trace/bar.h&gt; #include &lt;trace/fido.h&gt; Thanks to Mathieu Desnoyers and Christoph Hellwig for coming up with the cleaner solution of the define above the includes over my first design to have the C code include a &quot;special&quot; header. This patch converts sched, irq and lockdep and skb to use this new method. Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt; Cc: Neil Horman &lt;nhorman@tuxdriver.com&gt; Cc: Zhao Lei &lt;zhaolei@cn.fujitsu.com&gt; Cc: Eduard - Gabriel Munteanu &lt;eduard.munteanu@linux360.ro&gt; Cc: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt; Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt; </pre>---<pre>WARNING: line over 80 characters #64: FILE: include/trace/define_trace.h:12: + * TRACE_INCLUDE_PATH if the path is something other than core kernel include/trace WARNING: line over 80 characters #66: FILE: include/trace/define_trace.h:14: + * define_trace.h, not the file including it. Full path names for out of tree ERROR: spaces required around that &#39;&lt;&#39; (ctx:WxV) #98: FILE: include/trace/define_trace.h:46: +# define __TRACE_INCLUDE(system) &lt;trace/system.h&gt; ^ ERROR: spaces required around that &#39;&gt;&#39; (ctx:VxE) #98: FILE: include/trace/define_trace.h:46: +# define __TRACE_INCLUDE(system) &lt;trace/system.h&gt; ^ ERROR: Macros with complex values should be enclosed in parenthesis #98: FILE: include/trace/define_trace.h:46: +# define __TRACE_INCLUDE(system) &lt;trace/system.h&gt; total: 3 errors, 2 warnings, 287 lines checked </pre> badincludes: tracing: make trace_seq operations available for core kernel <pre>commit 9504504cbab29ecb694186b1c5b15d3579c43c51 Author: Steven Rostedt &lt;srostedt@redhat.com&gt; Date: Sat Apr 11 12:59:57 2009 -0400 tracing: make trace_seq operations available for core kernel In the process to make TRACE_EVENT macro work for modules, the trace_seq operations must be available for core kernel code. These operations are quite useful and can be used for other implementations. The main idea is that we create a trace_seq handle that acts very much like the seq_file handle. struct trace_seq *s = kmalloc(sizeof(*s, GFP_KERNEL); trace_seq_init(s); trace_seq_printf(s, &quot;some data %d\n&quot;, variable); printk(&quot;%s&quot;, s-&gt;buffer); The main use is to allow a top level function call several other functions that may store printf like data into the buffer. Then at the end, the top level function can process all the data with any method it would like to. It could be passed to userspace, output via printk or even use seq_file: trace_seq_to_user(s, ubuf, cnt); seq_puts(m, s-&gt;buffer); Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt; </pre>---<pre>diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index b05b6ac..1882846 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -12,6 +12,8 @@ #include &lt;linux/kmemtrace.h&gt; #include &lt;trace/power.h&gt; +#include &lt;linux/trace_seq.h&gt; + enum trace_type { __TRACE_FIRST_TYPE = 0, include linux/trace_seq.h inserted after trace/power.h </pre> checkpatch: tracing/events: move declarations from trace directory to core include <pre>commit 97f2025153499faa17267a0d4e18c7afaf73f39d Author: Steven Rostedt &lt;srostedt@redhat.com&gt; Date: Mon Apr 13 11:20:49 2009 -0400 tracing/events: move declarations from trace directory to core include In preparation to allowing trace events to happen in modules, we need to move some of the local declarations in the kernel/trace directory into include/linux. This patch simply moves the declarations and performs no context changes. Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt; </pre>---<pre>ERROR: Macros with multiple statements should be enclosed in a do - while loop #158: FILE: include/linux/ftrace_event.h:139: +#define __common_field(type, item) \ + ret = trace_define_field(event_call, #type, &quot;common_&quot; #item, \ + offsetof(typeof(field.ent), item), \ + sizeof(field.ent.item)); \ + if (ret) \ + return ret; total: 1 errors, 0 warnings, 373 lines checked </pre> badincludes: tracing/events: move declarations from trace directory to core include <pre>commit 97f2025153499faa17267a0d4e18c7afaf73f39d Author: Steven Rostedt &lt;srostedt@redhat.com&gt; Date: Mon Apr 13 11:20:49 2009 -0400 tracing/events: move declarations from trace directory to core include In preparation to allowing trace events to happen in modules, we need to move some of the local declarations in the kernel/trace directory into include/linux. This patch simply moves the declarations and performs no context changes. Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt; </pre>---<pre>diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 1882846..6bcdf4a 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -13,6 +13,7 @@ #include &lt;trace/power.h&gt; #include &lt;linux/trace_seq.h&gt; +#include &lt;linux/ftrace_event.h&gt; enum trace_type { __TRACE_FIRST_TYPE = 0, include linux/ftrace_event.h inserted after linux/trace_seq.h </pre> checkpatch: tracing/events: move the ftrace event tracing code to core <pre>commit f42c85e74faa422cf0bc747ed808681145448f88 Author: Steven Rostedt &lt;srostedt@redhat.com&gt; Date: Mon Apr 13 12:25:37 2009 -0400 tracing/events: move the ftrace event tracing code to core This patch moves the ftrace creation into include/trace/ftrace.h and simplifies the work of developers in adding new tracepoints. Just the act of creating the trace points in include/trace and including define_trace.h will create the events in the debugfs/tracing/events directory. This patch removes the need of include/trace/trace_events.h Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt; </pre>---<pre>ERROR: Macros with complex values should be enclosed in parenthesis #117: FILE: include/trace/ftrace.h:81: +#define TP_printk(fmt, args...) fmt &quot;\n&quot;, args ERROR: need consistent spacing around &#39;*&#39; (ctx:WxV) #125: FILE: include/trace/ftrace.h:89: + struct ftrace_raw_##call *field; \ ^ ERROR: trailing whitespace #144: FILE: include/trace/ftrace.h:108: +^I$ ERROR: Macros with multiple statements should be enclosed in a do - while loop #168: FILE: include/trace/ftrace.h:132: +#define __field(type, item) \ + ret = trace_seq_printf(s, &quot;\tfield:&quot; #type &quot; &quot; #item &quot;;\t&quot; \ + &quot;offset:%u;\tsize:%u;\n&quot;, \ + (unsigned int)offsetof(typeof(field), item), \ + (unsigned int)sizeof(field.item)); \ + if (!ret) \ + return 0; WARNING: line over 80 characters #177: FILE: include/trace/ftrace.h:141: +#define __array(type, item, len) \ ERROR: Macros with multiple statements should be enclosed in a do - while loop #177: FILE: include/trace/ftrace.h:141: +#define __array(type, item, len) \ + ret = trace_seq_printf(s, &quot;\tfield:&quot; #type &quot; &quot; #item &quot;[&quot; #len &quot;];\t&quot; \ + &quot;offset:%u;\tsize:%u;\n&quot;, \ + (unsigned int)offsetof(typeof(field), item), \ + (unsigned int)sizeof(field.item)); \ + if (!ret) \ + return 0; WARNING: line over 80 characters #178: FILE: include/trace/ftrace.h:142: + ret = trace_seq_printf(s, &quot;\tfield:&quot; #type &quot; &quot; #item &quot;[&quot; #len &quot;];\t&quot; \ ERROR: Macros with complex values should be enclosed in parenthesis #189: FILE: include/trace/ftrace.h:153: +#define TP_printk(fmt, args...) &quot;%s, %s\n&quot;, #fmt, __stringify(args) ERROR: Macros with multiple statements should be enclosed in a do - while loop #212: FILE: include/trace/ftrace.h:176: +#define __field(type, item) \ + ret = trace_define_field(event_call, #type, #item, \ + offsetof(typeof(field), item), \ + sizeof(field.item)); \ + if (ret) \ + return ret; ERROR: Macros with multiple statements should be enclosed in a do - while loop #220: FILE: include/trace/ftrace.h:184: +#define __array(type, item, len) \ + BUILD_BUG_ON(len &gt; MAX_FILTER_STR_VAL); \ + ret = trace_define_field(event_call, #type &quot;[&quot; #len &quot;]&quot;, #item, \ + offsetof(typeof(field), item), \ + sizeof(field.item)); \ + if (ret) \ + return ret; ERROR: Macros with complex values should be enclosed in parenthesis #359: FILE: include/trace/ftrace.h:323: +#define TP_FMT(fmt, args...) fmt &quot;\n&quot;, ##args ERROR: need consistent spacing around &#39;*&#39; (ctx:WxV) #458: FILE: include/trace/ftrace.h:422: + struct ftrace_raw_##call *entry; \ ^ total: 10 errors, 2 warnings, 509 lines checked </pre> checkpatch: tracing/events: convert event call sites to use a link list <pre>commit a59fd6027218bd7c994e39d14afe0242f895144f Author: Steven Rostedt &lt;srostedt@redhat.com&gt; Date: Fri Apr 10 13:52:20 2009 -0400 tracing/events: convert event call sites to use a link list Impact: makes it possible to define events in modules The events are created by reading down the section that they are linked in by the macros. But this is not scalable to modules. This patch converts the manipulations to use a global link list, and on boot up it adds the items in the section to the list. This change will allow modules to add their tracing events to the list as well. Note, this change alone does not permit modules to use the TRACE_EVENT macros, but the change is needed for them to eventually do so. Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt; </pre>---<pre>WARNING: externs should be avoided in .c files #214: FILE: kernel/trace/trace_events.c:802: +extern struct ftrace_event_call __start_ftrace_events[]; WARNING: externs should be avoided in .c files #215: FILE: kernel/trace/trace_events.c:803: +extern struct ftrace_event_call __stop_ftrace_events[]; total: 0 errors, 2 warnings, 217 lines checked </pre> coccinelle: tracing/events: convert event call sites to use a link list <pre>commit a59fd6027218bd7c994e39d14afe0242f895144f Author: Steven Rostedt &lt;srostedt@redhat.com&gt; Date: Fri Apr 10 13:52:20 2009 -0400 tracing/events: convert event call sites to use a link list Impact: makes it possible to define events in modules The events are created by reading down the section that they are linked in by the macros. But this is not scalable to modules. This patch converts the manipulations to use a global link list, and on boot up it adds the items in the section to the list. This change will allow modules to add their tracing events to the list as well. Note, this change alone does not permit modules to use the TRACE_EVENT macros, but the change is needed for them to eventually do so. Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index d30b06b..37eddfe 100644 --- a/tmp/UTalZWIiv4.c +++ b/tmp/bOXWQ4mZ1i.c @@ -196,7 +196,7 @@ int init_preds(struct ftrace_event_call *call) call-&gt;n_preds = 0; - call-&gt;preds = kzalloc(MAX_FILTER_PRED * sizeof(pred), GFP_KERNEL); + call-&gt;preds = kcalloc(MAX_FILTER_PRED, sizeof(pred), GFP_KERNEL); if (!call-&gt;preds) return -ENOMEM; @@ -326,8 +326,7 @@ int filter_add_subsystem_pred(struct event_subsystem *system, filter_free_subsystem_preds(system); if (!system-&gt;n_preds) { - system-&gt;preds = kzalloc(MAX_FILTER_PRED * sizeof(pred), - GFP_KERNEL); + system-&gt;preds = kcalloc(MAX_FILTER_PRED, sizeof(pred), GFP_KERNEL); if (!system-&gt;preds) return -ENOMEM; } </pre> coccinelle: tracing/events: add export symbols for trace events in modules <pre>commit 17c873ec280a03894bc718af817f7f24fa787ae1 Author: Steven Rostedt &lt;srostedt@redhat.com&gt; Date: Fri Apr 10 18:12:50 2009 -0400 tracing/events: add export symbols for trace events in modules Impact: let modules add trace events The trace event code requires some functions to be exported to allow modules to use TRACE_EVENT. This patch adds EXPORT_SYMBOL_GPL to the necessary functions. Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index f8e5eab..51a5d50 100644 --- a/tmp/NBSVSUzDEV.c +++ b/tmp/eeHACr71yT.c @@ -197,7 +197,7 @@ int init_preds(struct ftrace_event_call *call) call-&gt;n_preds = 0; - call-&gt;preds = kzalloc(MAX_FILTER_PRED * sizeof(pred), GFP_KERNEL); + call-&gt;preds = kcalloc(MAX_FILTER_PRED, sizeof(pred), GFP_KERNEL); if (!call-&gt;preds) return -ENOMEM; @@ -328,8 +328,7 @@ int filter_add_subsystem_pred(struct event_subsystem *system, filter_free_subsystem_preds(system); if (!system-&gt;n_preds) { - system-&gt;preds = kzalloc(MAX_FILTER_PRED * sizeof(pred), - GFP_KERNEL); + system-&gt;preds = kcalloc(MAX_FILTER_PRED, sizeof(pred), GFP_KERNEL); if (!system-&gt;preds) return -ENOMEM; } </pre> checkpatch: modules: Fix up build when CONFIG_MODULE_UNLOAD=n. <pre>commit 19e4529ee7345079eeacc8e40cf69a304a64dc23 Author: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt; Date: Tue Apr 14 17:27:18 2009 +1000 modules: Fix up build when CONFIG_MODULE_UNLOAD=n. Commit 3d43321b7015387cfebbe26436d0e9d299162ea1 (&quot;modules: sysctl to block module loading&quot;) introduces a modules_disabled variable that is only defined if CONFIG_MODULE_UNLOAD is enabled, despite being used in other places. This moves it up and fixes up the build. CC kernel/module.o kernel/module.c: In function &#39;sys_init_module&#39;: kernel/module.c:2401: error: &#39;modules_disabled&#39; undeclared (first use in this function) kernel/module.c:2401: error: (Each undeclared identifier is reported only once kernel/module.c:2401: error: for each function it appears in.) make[1]: *** [kernel/module.o] Error 1 make: *** [kernel/module.o] Error 2 Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt; Signed-off-by: James Morris &lt;jmorris@namei.org&gt; </pre>---<pre>ERROR: do not initialise externals to 0 or NULL #31: FILE: kernel/module.c:75: +int modules_disabled = 0; total: 1 errors, 0 warnings, 18 lines checked </pre> checkpatch: tracing/events: move trace point headers into include/trace/events <pre>commit ad8d75fff811a6a230f7f43b05a6483099349533 Author: Steven Rostedt &lt;srostedt@redhat.com&gt; Date: Tue Apr 14 19:39:12 2009 -0400 tracing/events: move trace point headers into include/trace/events Impact: clean up Create a sub directory in include/trace called events to keep the trace point headers in their own separate directory. Only headers that declare trace points should be defined in this directory. Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt; Cc: Neil Horman &lt;nhorman@tuxdriver.com&gt; Cc: Zhao Lei &lt;zhaolei@cn.fujitsu.com&gt; Cc: Eduard - Gabriel Munteanu &lt;eduard.munteanu@linux360.ro&gt; Cc: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt; Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt; </pre>---<pre>ERROR: spaces required around that &#39;&lt;&#39; (ctx:WxV) #42: FILE: include/trace/define_trace.h:46: +# define __TRACE_INCLUDE(system) &lt;trace/events/system.h&gt; ^ ERROR: spaces required around that &#39;&gt;&#39; (ctx:VxE) #42: FILE: include/trace/define_trace.h:46: +# define __TRACE_INCLUDE(system) &lt;trace/events/system.h&gt; ^ ERROR: Macros with complex values should be enclosed in parenthesis #42: FILE: include/trace/define_trace.h:46: +# define __TRACE_INCLUDE(system) &lt;trace/events/system.h&gt; ERROR: space prohibited after that open parenthesis &#39;(&#39; #80: FILE: include/trace/events/irq.h:29: + __field( int, irq ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #80: FILE: include/trace/events/irq.h:29: + __field( int, irq ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #81: FILE: include/trace/events/irq.h:30: + __field( int, ret ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #81: FILE: include/trace/events/irq.h:30: + __field( int, ret ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #135: FILE: include/trace/events/kmem.h:21: + __field( unsigned long, call_site ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #135: FILE: include/trace/events/kmem.h:21: + __field( unsigned long, call_site ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #136: FILE: include/trace/events/kmem.h:22: + __field( const void *, ptr ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #136: FILE: include/trace/events/kmem.h:22: + __field( const void *, ptr ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #137: FILE: include/trace/events/kmem.h:23: + __field( size_t, bytes_req ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #137: FILE: include/trace/events/kmem.h:23: + __field( size_t, bytes_req ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #138: FILE: include/trace/events/kmem.h:24: + __field( size_t, bytes_alloc ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #138: FILE: include/trace/events/kmem.h:24: + __field( size_t, bytes_alloc ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #139: FILE: include/trace/events/kmem.h:25: + __field( gfp_t, gfp_flags ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #139: FILE: include/trace/events/kmem.h:25: + __field( gfp_t, gfp_flags ) WARNING: line over 80 characters #150: FILE: include/trace/events/kmem.h:36: + TP_printk(&quot;call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x&quot;, ERROR: space prohibited after that open parenthesis &#39;(&#39; #169: FILE: include/trace/events/kmem.h:55: + __field( unsigned long, call_site ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #169: FILE: include/trace/events/kmem.h:55: + __field( unsigned long, call_site ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #170: FILE: include/trace/events/kmem.h:56: + __field( const void *, ptr ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #170: FILE: include/trace/events/kmem.h:56: + __field( const void *, ptr ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #171: FILE: include/trace/events/kmem.h:57: + __field( size_t, bytes_req ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #171: FILE: include/trace/events/kmem.h:57: + __field( size_t, bytes_req ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #172: FILE: include/trace/events/kmem.h:58: + __field( size_t, bytes_alloc ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #172: FILE: include/trace/events/kmem.h:58: + __field( size_t, bytes_alloc ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #173: FILE: include/trace/events/kmem.h:59: + __field( gfp_t, gfp_flags ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #173: FILE: include/trace/events/kmem.h:59: + __field( gfp_t, gfp_flags ) WARNING: line over 80 characters #184: FILE: include/trace/events/kmem.h:70: + TP_printk(&quot;call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x&quot;, ERROR: space prohibited after that open parenthesis &#39;(&#39; #204: FILE: include/trace/events/kmem.h:90: + __field( unsigned long, call_site ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #204: FILE: include/trace/events/kmem.h:90: + __field( unsigned long, call_site ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #205: FILE: include/trace/events/kmem.h:91: + __field( const void *, ptr ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #205: FILE: include/trace/events/kmem.h:91: + __field( const void *, ptr ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #206: FILE: include/trace/events/kmem.h:92: + __field( size_t, bytes_req ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #206: FILE: include/trace/events/kmem.h:92: + __field( size_t, bytes_req ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #207: FILE: include/trace/events/kmem.h:93: + __field( size_t, bytes_alloc ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #207: FILE: include/trace/events/kmem.h:93: + __field( size_t, bytes_alloc ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #208: FILE: include/trace/events/kmem.h:94: + __field( gfp_t, gfp_flags ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #208: FILE: include/trace/events/kmem.h:94: + __field( gfp_t, gfp_flags ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #209: FILE: include/trace/events/kmem.h:95: + __field( int, node ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #209: FILE: include/trace/events/kmem.h:95: + __field( int, node ) WARNING: line over 80 characters #221: FILE: include/trace/events/kmem.h:107: + TP_printk(&quot;call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x node=%d&quot;, ERROR: space prohibited after that open parenthesis &#39;(&#39; #242: FILE: include/trace/events/kmem.h:128: + __field( unsigned long, call_site ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #242: FILE: include/trace/events/kmem.h:128: + __field( unsigned long, call_site ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #243: FILE: include/trace/events/kmem.h:129: + __field( const void *, ptr ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #243: FILE: include/trace/events/kmem.h:129: + __field( const void *, ptr ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #244: FILE: include/trace/events/kmem.h:130: + __field( size_t, bytes_req ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #244: FILE: include/trace/events/kmem.h:130: + __field( size_t, bytes_req ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #245: FILE: include/trace/events/kmem.h:131: + __field( size_t, bytes_alloc ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #245: FILE: include/trace/events/kmem.h:131: + __field( size_t, bytes_alloc ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #246: FILE: include/trace/events/kmem.h:132: + __field( gfp_t, gfp_flags ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #246: FILE: include/trace/events/kmem.h:132: + __field( gfp_t, gfp_flags ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #247: FILE: include/trace/events/kmem.h:133: + __field( int, node ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #247: FILE: include/trace/events/kmem.h:133: + __field( int, node ) WARNING: line over 80 characters #259: FILE: include/trace/events/kmem.h:145: + TP_printk(&quot;call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%08x node=%d&quot;, ERROR: space prohibited after that open parenthesis &#39;(&#39; #275: FILE: include/trace/events/kmem.h:161: + __field( unsigned long, call_site ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #275: FILE: include/trace/events/kmem.h:161: + __field( unsigned long, call_site ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #276: FILE: include/trace/events/kmem.h:162: + __field( const void *, ptr ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #276: FILE: include/trace/events/kmem.h:162: + __field( const void *, ptr ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #294: FILE: include/trace/events/kmem.h:180: + __field( unsigned long, call_site ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #294: FILE: include/trace/events/kmem.h:180: + __field( unsigned long, call_site ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #295: FILE: include/trace/events/kmem.h:181: + __field( const void *, ptr ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #295: FILE: include/trace/events/kmem.h:181: + __field( const void *, ptr ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #400: FILE: include/trace/events/sched.h:20: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #400: FILE: include/trace/events/sched.h:20: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #401: FILE: include/trace/events/sched.h:21: + __field( pid_t, pid ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #401: FILE: include/trace/events/sched.h:21: + __field( pid_t, pid ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #422: FILE: include/trace/events/sched.h:42: + __field( int, ret ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #422: FILE: include/trace/events/sched.h:42: + __field( int, ret ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #445: FILE: include/trace/events/sched.h:65: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #445: FILE: include/trace/events/sched.h:65: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #446: FILE: include/trace/events/sched.h:66: + __field( pid_t, pid ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #446: FILE: include/trace/events/sched.h:66: + __field( pid_t, pid ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #447: FILE: include/trace/events/sched.h:67: + __field( int, prio ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #447: FILE: include/trace/events/sched.h:67: + __field( int, prio ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #473: FILE: include/trace/events/sched.h:93: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #473: FILE: include/trace/events/sched.h:93: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #474: FILE: include/trace/events/sched.h:94: + __field( pid_t, pid ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #474: FILE: include/trace/events/sched.h:94: + __field( pid_t, pid ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #475: FILE: include/trace/events/sched.h:95: + __field( int, prio ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #475: FILE: include/trace/events/sched.h:95: + __field( int, prio ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #476: FILE: include/trace/events/sched.h:96: + __field( int, success ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #476: FILE: include/trace/events/sched.h:96: + __field( int, success ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #504: FILE: include/trace/events/sched.h:124: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #504: FILE: include/trace/events/sched.h:124: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #505: FILE: include/trace/events/sched.h:125: + __field( pid_t, pid ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #505: FILE: include/trace/events/sched.h:125: + __field( pid_t, pid ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #506: FILE: include/trace/events/sched.h:126: + __field( int, prio ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #506: FILE: include/trace/events/sched.h:126: + __field( int, prio ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #507: FILE: include/trace/events/sched.h:127: + __field( int, success ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #507: FILE: include/trace/events/sched.h:127: + __field( int, success ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #536: FILE: include/trace/events/sched.h:156: + __array( char, prev_comm, TASK_COMM_LEN ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #536: FILE: include/trace/events/sched.h:156: + __array( char, prev_comm, TASK_COMM_LEN ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #537: FILE: include/trace/events/sched.h:157: + __field( pid_t, prev_pid ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #537: FILE: include/trace/events/sched.h:157: + __field( pid_t, prev_pid ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #538: FILE: include/trace/events/sched.h:158: + __field( int, prev_prio ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #538: FILE: include/trace/events/sched.h:158: + __field( int, prev_prio ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #539: FILE: include/trace/events/sched.h:159: + __array( char, next_comm, TASK_COMM_LEN ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #539: FILE: include/trace/events/sched.h:159: + __array( char, next_comm, TASK_COMM_LEN ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #540: FILE: include/trace/events/sched.h:160: + __field( pid_t, next_pid ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #540: FILE: include/trace/events/sched.h:160: + __field( pid_t, next_pid ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #541: FILE: include/trace/events/sched.h:161: + __field( int, next_prio ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #541: FILE: include/trace/events/sched.h:161: + __field( int, next_prio ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #568: FILE: include/trace/events/sched.h:188: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #568: FILE: include/trace/events/sched.h:188: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #569: FILE: include/trace/events/sched.h:189: + __field( pid_t, pid ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #569: FILE: include/trace/events/sched.h:189: + __field( pid_t, pid ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #570: FILE: include/trace/events/sched.h:190: + __field( int, prio ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #570: FILE: include/trace/events/sched.h:190: + __field( int, prio ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #571: FILE: include/trace/events/sched.h:191: + __field( int, orig_cpu ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #571: FILE: include/trace/events/sched.h:191: + __field( int, orig_cpu ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #572: FILE: include/trace/events/sched.h:192: + __field( int, dest_cpu ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #572: FILE: include/trace/events/sched.h:192: + __field( int, dest_cpu ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #598: FILE: include/trace/events/sched.h:218: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #598: FILE: include/trace/events/sched.h:218: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #599: FILE: include/trace/events/sched.h:219: + __field( pid_t, pid ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #599: FILE: include/trace/events/sched.h:219: + __field( pid_t, pid ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #600: FILE: include/trace/events/sched.h:220: + __field( int, prio ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #600: FILE: include/trace/events/sched.h:220: + __field( int, prio ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #623: FILE: include/trace/events/sched.h:243: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #623: FILE: include/trace/events/sched.h:243: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #624: FILE: include/trace/events/sched.h:244: + __field( pid_t, pid ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #624: FILE: include/trace/events/sched.h:244: + __field( pid_t, pid ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #625: FILE: include/trace/events/sched.h:245: + __field( int, prio ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #625: FILE: include/trace/events/sched.h:245: + __field( int, prio ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #648: FILE: include/trace/events/sched.h:268: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #648: FILE: include/trace/events/sched.h:268: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #649: FILE: include/trace/events/sched.h:269: + __field( pid_t, pid ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #649: FILE: include/trace/events/sched.h:269: + __field( pid_t, pid ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #650: FILE: include/trace/events/sched.h:270: + __field( int, prio ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #650: FILE: include/trace/events/sched.h:270: + __field( int, prio ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #673: FILE: include/trace/events/sched.h:293: + __array( char, parent_comm, TASK_COMM_LEN ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #673: FILE: include/trace/events/sched.h:293: + __array( char, parent_comm, TASK_COMM_LEN ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #674: FILE: include/trace/events/sched.h:294: + __field( pid_t, parent_pid ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #674: FILE: include/trace/events/sched.h:294: + __field( pid_t, parent_pid ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #675: FILE: include/trace/events/sched.h:295: + __array( char, child_comm, TASK_COMM_LEN ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #675: FILE: include/trace/events/sched.h:295: + __array( char, child_comm, TASK_COMM_LEN ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #676: FILE: include/trace/events/sched.h:296: + __field( pid_t, child_pid ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #676: FILE: include/trace/events/sched.h:296: + __field( pid_t, child_pid ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #701: FILE: include/trace/events/sched.h:321: + __field( int, sig ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #701: FILE: include/trace/events/sched.h:321: + __field( int, sig ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #702: FILE: include/trace/events/sched.h:322: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #702: FILE: include/trace/events/sched.h:322: + __array( char, comm, TASK_COMM_LEN ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #703: FILE: include/trace/events/sched.h:323: + __field( pid_t, pid ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #703: FILE: include/trace/events/sched.h:323: + __field( pid_t, pid ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #745: FILE: include/trace/events/skb.h:20: + __field( void *, skbaddr ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #745: FILE: include/trace/events/skb.h:20: + __field( void *, skbaddr ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #746: FILE: include/trace/events/skb.h:21: + __field( unsigned short, protocol ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #746: FILE: include/trace/events/skb.h:21: + __field( unsigned short, protocol ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #747: FILE: include/trace/events/skb.h:22: + __field( void *, location ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #747: FILE: include/trace/events/skb.h:22: + __field( void *, location ) WARNING: braces {} are not necessary for single statement blocks #752: FILE: include/trace/events/skb.h:27: + if (skb) { + __entry-&gt;protocol = ntohs(skb-&gt;protocol); + } total: 147 errors, 5 warnings, 832 lines checked </pre> coccinelle: tracing/events: move trace point headers into include/trace/events <pre>commit ad8d75fff811a6a230f7f43b05a6483099349533 Author: Steven Rostedt &lt;srostedt@redhat.com&gt; Date: Tue Apr 14 19:39:12 2009 -0400 tracing/events: move trace point headers into include/trace/events Impact: clean up Create a sub directory in include/trace called events to keep the trace point headers in their own separate directory. Only headers that declare trace points should be defined in this directory. Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt; Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt; Cc: Neil Horman &lt;nhorman@tuxdriver.com&gt; Cc: Zhao Lei &lt;zhaolei@cn.fujitsu.com&gt; Cc: Eduard - Gabriel Munteanu &lt;eduard.munteanu@linux360.ro&gt; Cc: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt; Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index a234889..3fa6ccc 100644 --- a/tmp/P6LS0Yg4i2.c +++ b/tmp/XsQ2VuWVCl.c @@ -481,7 +481,7 @@ static int ftrace_profile_init_cpu(int cpu) */ size = FTRACE_PROFILE_HASH_SIZE; - stat-&gt;hash = kzalloc(sizeof(struct hlist_head) * size, GFP_KERNEL); + stat-&gt;hash = kcalloc(size, sizeof(struct hlist_head), GFP_KERNEL); if (!stat-&gt;hash) return -ENOMEM; rules/mut.cocci: // A mutex_lock is not matched by a mutex_unlock before an error return. // // Confidence: Moderate // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/mut.html // Options: -no_includes -include_headers diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index a234889..f96315e 100644 --- a/tmp/P6LS0Yg4i2.c +++ b/tmp/sSe92rsWFW.c @@ -1518,9 +1518,11 @@ static void *t_start(struct seq_file *m, loff_t *pos) */ if (iter-&gt;flags &amp; FTRACE_ITER_FILTER &amp;&amp; !ftrace_filtered) { if (*pos &gt; 0) + mutex_unlock(&amp;ftrace_lock); return t_hash_start(m, pos); iter-&gt;flags |= FTRACE_ITER_PRINTALL; (*pos)++; + mutex_unlock(&amp;ftrace_lock); return iter; } </pre> checkpatch: tracing/events: add trace-events-sample <pre>commit 9cfe06f8cd5c8c3ad6ab323973e87dde670642b8 Author: Steven Rostedt &lt;srostedt@redhat.com&gt; Date: Tue Apr 14 21:37:03 2009 -0400 tracing/events: add trace-events-sample This patch adds a sample to the samples directory on how to create and use TRACE_EVENT trace points. Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt; </pre>---<pre>ERROR: Macros with complex values should be enclosed in parenthesis #153: FILE: samples/trace_events/trace-events-sample.h:34: +#define TRACE_SYSTEM trace-events-sample ERROR: space prohibited after that open parenthesis &#39;(&#39; #195: FILE: samples/trace_events/trace-events-sample.h:76: + __array( char, foo, 10 ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #195: FILE: samples/trace_events/trace-events-sample.h:76: + __array( char, foo, 10 ) ERROR: space prohibited after that open parenthesis &#39;(&#39; #196: FILE: samples/trace_events/trace-events-sample.h:77: + __field( int, bar ) ERROR: space prohibited before that close parenthesis &#39;)&#39; #196: FILE: samples/trace_events/trace-events-sample.h:77: + __field( int, bar ) total: 5 errors, 0 warnings, 205 lines checked </pre> checkpatch: sh: Add support for SH7724 (SH-Mobile R2R) CPU subtype. <pre>commit 0207a2efb43d81e29e23662b5d035945688a103f Author: Kuninori Morimoto &lt;morimoto.kuninori@renesas.com&gt; Date: Thu Apr 16 14:40:56 2009 +0900 sh: Add support for SH7724 (SH-Mobile R2R) CPU subtype. This implements initial support for the SH-Mobile R2R CPU. Based on Rev 0.11 of the initial SH7724 hardware manual. Signed-off-by: Kuninori Morimoto &lt;morimoto.kuninori@renesas.com&gt; Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt; </pre>---<pre>ERROR: space prohibited before open square bracket &#39;[&#39; #3209: FILE: arch/sh/kernel/setup.c:438: + [CPU_SH7366] = &quot;SH7366&quot;, [CPU_SH7724] = &quot;SH7724&quot;, total: 1 errors, 0 warnings, 3146 lines checked </pre> checkpatch: sh: pass along struct pci_channel <pre>commit b8b47bfbe4eb1ae0e6891e49c86a5f4fb00413be Author: Magnus Damm &lt;damm@igel.co.jp&gt; Date: Wed Mar 11 15:41:51 2009 +0900 sh: pass along struct pci_channel These patches rework the pci code for the sh architecture. Currently each board implements some kind of ioport to address mapping. Some boards use generic_io_base others try passing addresses as io ports. This is the first set of patches that try to unify the pci code as much as possible to avoid duplicated code. This will in the end lead to fewer lines board specific code and more generic code. This patch makes sure a struct pci_channel pointer is passed along to various pci functions such as pci_read_reg(), pci_write_reg(), pci_fixup_pcic(), sh7751_pcic_init() and sh7780_pcic_init(). Signed-off-by: Magnus Damm &lt;damm@igel.co.jp&gt; Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt; </pre>---<pre>ERROR: do not use assignment in if condition #536: FILE: arch/sh/drivers/pci/pci-sh7751.c:50: + if ((ret = sh4_pci_check_direct(NULL)) != 0) ERROR: trailing statements should be on next line #665: FILE: arch/sh/drivers/pci/pci-sh7751.c:171: + case SH7751_CS0_BASE_ADDR: word = __area_sdram_check(chan, 0); break; ERROR: trailing statements should be on next line #666: FILE: arch/sh/drivers/pci/pci-sh7751.c:172: + case SH7751_CS1_BASE_ADDR: word = __area_sdram_check(chan, 1); break; ERROR: trailing statements should be on next line #667: FILE: arch/sh/drivers/pci/pci-sh7751.c:173: + case SH7751_CS2_BASE_ADDR: word = __area_sdram_check(chan, 2); break; ERROR: trailing statements should be on next line #668: FILE: arch/sh/drivers/pci/pci-sh7751.c:174: + case SH7751_CS3_BASE_ADDR: word = __area_sdram_check(chan, 3); break; ERROR: trailing statements should be on next line #669: FILE: arch/sh/drivers/pci/pci-sh7751.c:175: + case SH7751_CS4_BASE_ADDR: word = __area_sdram_check(chan, 4); break; ERROR: trailing statements should be on next line #670: FILE: arch/sh/drivers/pci/pci-sh7751.c:176: + case SH7751_CS5_BASE_ADDR: word = __area_sdram_check(chan, 5); break; ERROR: trailing statements should be on next line #671: FILE: arch/sh/drivers/pci/pci-sh7751.c:177: + case SH7751_CS6_BASE_ADDR: word = __area_sdram_check(chan, 6); break; ERROR: do not use assignment in if condition #738: FILE: arch/sh/drivers/pci/pci-sh7780.c:85: + if ((ret = sh4_pci_check_direct(NULL)) != 0) total: 9 errors, 0 warnings, 691 lines checked </pre> checkpatch: sh: add init member to pci_channel data <pre>commit d0e3db40e2a1352aa2a2f425a7d4631bddc03d51 Author: Magnus Damm &lt;damm@igel.co.jp&gt; Date: Wed Mar 11 15:46:14 2009 +0900 sh: add init member to pci_channel data This patch adds an init callback to struct pci_channel and makes sure it is initialized properly. Code is added to call this init function from pcibios_init(). Return values are adjusted and a warning is is printed if init fails. Signed-off-by: Magnus Damm &lt;damm@igel.co.jp&gt; Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt; </pre>---<pre>WARNING: line over 80 characters #100: FILE: arch/sh/drivers/pci/ops-landisk.c:33: + { sh7751_pci_init, &amp;sh4_pci_ops, &amp;sh7751_io_resource, &amp;sh7751_mem_resource, 0, 0x3ff}, WARNING: line over 80 characters #113: FILE: arch/sh/drivers/pci/ops-lboxre2.c:42: + { sh7751_pci_init, &amp;sh4_pci_ops, &amp;sh7751_io_resource, &amp;sh7751_mem_resource, 0, 0xff }, WARNING: line over 80 characters #126: FILE: arch/sh/drivers/pci/ops-r7780rp.c:46: + { sh7780_pci_init, &amp;sh4_pci_ops, &amp;sh7780_io_resource, &amp;sh7780_mem_resource, 0, 0xff }, WARNING: line over 80 characters #139: FILE: arch/sh/drivers/pci/ops-rts7751r2d.c:50: + { sh7751_pci_init, &amp;sh4_pci_ops, &amp;sh7751_io_resource, &amp;sh7751_mem_resource, 0, 0xff }, WARNING: line over 80 characters #152: FILE: arch/sh/drivers/pci/ops-sdk7780.c:52: + { sh7780_pci_init, &amp;sh4_pci_ops, &amp;sdk7780_io_resource, &amp;sdk7780_mem_resource, 0, 0xff }, WARNING: line over 80 characters #165: FILE: arch/sh/drivers/pci/ops-se7780.c:61: + { sh7780_pci_init, &amp;sh4_pci_ops, &amp;se7780_io_resource, &amp;se7780_mem_resource, 0, 0xff }, WARNING: line over 80 characters #178: FILE: arch/sh/drivers/pci/ops-sh03.c:42: + { sh7751_pci_init, &amp;sh4_pci_ops, &amp;sh7751_io_resource, &amp;sh7751_mem_resource, 0, 0xff }, WARNING: line over 80 characters #191: FILE: arch/sh/drivers/pci/ops-snapgear.c:43: + { sh7751_pci_init, &amp;sh4_pci_ops, &amp;sh7751_io_resource, &amp;sh7751_mem_resource, 0, 0xff }, WARNING: line over 80 characters #204: FILE: arch/sh/drivers/pci/ops-titan.c:55: + { sh7751_pci_init, &amp;sh4_pci_ops, &amp;sh7751_io_resource, &amp;sh7751_mem_resource, 0, 0xff }, ERROR: do not use assignment in if condition #263: FILE: arch/sh/drivers/pci/pci-sh7751.c:50: + if ((ret = sh4_pci_check_direct(chan)) != 0) ERROR: do not use assignment in if condition #327: FILE: arch/sh/drivers/pci/pci-sh7780.c:85: + if ((ret = sh4_pci_check_direct(chan)) != 0) total: 2 errors, 9 warnings, 291 lines checked </pre> checkpatch: sh: avoid using PCIBIOS_MIN_xxx <pre>commit 710fa3c81151948ac4d836ef52b57cef91b0ab72 Author: Magnus Damm &lt;damm@igel.co.jp&gt; Date: Wed Mar 11 15:47:23 2009 +0900 sh: avoid using PCIBIOS_MIN_xxx Replaces PCIBIOS_MIN_IO and PCIBIOS_MIN_MEM with direct struct pci_channel access. This allows us to have more than one pci channel. Signed-off-by: Magnus Damm &lt;damm@igel.co.jp&gt; Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt; </pre>---<pre>ERROR: Macros with complex values should be enclosed in parenthesis #60: FILE: arch/sh/drivers/pci/pci-sh5.c:209: +#define xPCIBIOS_MIN_IO board_pci_channels-&gt;io_resource-&gt;start ERROR: Macros with complex values should be enclosed in parenthesis #61: FILE: arch/sh/drivers/pci/pci-sh5.c:210: +#define xPCIBIOS_MIN_MEM board_pci_channels-&gt;mem_resource-&gt;start total: 2 errors, 0 warnings, 91 lines checked </pre> checkpatch: sh: hook in struct pci_channel in sysdata <pre>commit b6706ef10f75921733d7275fd45d268f2f6254c8 Author: Magnus Damm &lt;magnus.damm@gmail.com&gt; Date: Tue Feb 19 21:34:55 2008 +0900 sh: hook in struct pci_channel in sysdata Store a struct pci_channel pointer in bus-&gt;sysdata. This makes whatever struct pci_channel assigned to a bus available for sh4_pci_read() and sh4_pci_write(). We also modify PCIBIOS_MIN_IO and PCIBIOS_MIN_MEM to use bus-&gt;sysdata - this to gives us support for multiple pci channels. Signed-off-by: Magnus Damm &lt;damm@igel.co.jp&gt; Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt; </pre>---<pre>ERROR: Macros with complex values should be enclosed in parenthesis #87: FILE: arch/sh/include/asm/pci.h:36: +#define PCIBIOS_MIN_IO __PCI_CHAN(bus)-&gt;io_resource-&gt;start ERROR: Macros with complex values should be enclosed in parenthesis #88: FILE: arch/sh/include/asm/pci.h:37: +#define PCIBIOS_MIN_MEM __PCI_CHAN(bus)-&gt;mem_resource-&gt;start total: 2 errors, 0 warnings, 60 lines checked </pre> checkpatch: sh: export board_pci_channels in one place <pre>commit aa5d3ff99cc1f3dfe262ab9dd9179131fcfe39fd Author: Magnus Damm &lt;magnus.damm@gmail.com&gt; Date: Tue Feb 19 21:35:40 2008 +0900 sh: export board_pci_channels in one place Instead of sometimes exporting board_pci_channels[] in the board specific code just export it in one place. Signed-off-by: Magnus Damm &lt;damm@igel.co.jp&gt; Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt; </pre>---<pre>WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable #106: FILE: arch/sh/drivers/pci/pci.c:191: +EXPORT_SYMBOL(board_pci_channels); total: 0 errors, 1 warnings, 55 lines checked </pre> checkpatch: sh: sh7785lcr: Update for recent PCI changes. <pre>commit 3aabce8d3d2f9af2c08c2f590ac9acb272ca8c95 Author: Paul Mundt &lt;lethal@linux-sh.org&gt; Date: Wed Mar 11 16:12:39 2009 +0900 sh: sh7785lcr: Update for recent PCI changes. Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt; </pre>---<pre>WARNING: line over 80 characters #54: FILE: arch/sh/drivers/pci/fixups-sh7785lcr.c:41: + pci_write_reg(chan, chan-&gt;io_resource-&gt;start &amp; ~(SH7780_PCI_IO_SIZE - 1), WARNING: line over 80 characters #71: FILE: arch/sh/drivers/pci/ops-sh7785lcr.c:44: + { sh7780_pci_init, &amp;sh4_pci_ops, &amp;sh7785_io_resource, &amp;sh7785_mem_resource, 0, 0xff }, total: 0 errors, 2 warnings, 63 lines checked </pre> checkpatch: gro: New frags interface to avoid copying shinfo <pre>commit 76620aafd66f0004829764940c5466144969cffc Author: Herbert Xu &lt;herbert@gondor.apana.org.au&gt; Date: Thu Apr 16 02:02:07 2009 -0700 gro: New frags interface to avoid copying shinfo It turns out that copying a 16-byte area at ~800k times a second can be really expensive :) This patch redesigns the frags GRO interface to avoid copying that area twice. The two disciples of the frags interface have been converted. Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt; Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt; </pre>---<pre>ERROR: &quot;foo * bar&quot; should be &quot;foo *bar&quot; #229: FILE: include/linux/netdevice.h:1437: +extern struct sk_buff * napi_get_frags(struct napi_struct *napi); ERROR: &quot;foo * bar&quot; should be &quot;foo *bar&quot; #234: FILE: include/linux/netdevice.h:1440: +extern struct sk_buff * napi_frags_skb(struct napi_struct *napi); total: 2 errors, 0 warnings, 326 lines checked </pre> coccinelle: ipw2x00: remove old compat_net_dev_ops code <pre>commit d130fe5c95739472b61b30f3f2b401ee43d5e3ea Author: Alexander Beregalov &lt;a.beregalov@gmail.com&gt; Date: Wed Apr 15 07:58:27 2009 +0000 ipw2x00: remove old compat_net_dev_ops code Since both ipw2100 and ipw2200 are already converted to new net_device_ops this code is useless. Signed-off-by: Alexander Beregalov &lt;a.beregalov@gmail.com&gt; Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/drivers/net/wireless/ipw2x00/libipw_module.c b/drivers/net/wireless/ipw2x00/libipw_module.c index 8ce6e96..1faa3a2 100644 --- a/tmp/PTV9DT6nUh.c +++ b/tmp/T3C3raGRzy.c @@ -68,8 +68,7 @@ static int ieee80211_networks_allocate(struct ieee80211_device *ieee) return 0; ieee-&gt;networks = - kzalloc(MAX_NETWORK_COUNT * sizeof(struct ieee80211_network), - GFP_KERNEL); + kcalloc(MAX_NETWORK_COUNT, sizeof(struct ieee80211_network), GFP_KERNEL); if (!ieee-&gt;networks) { printk(KERN_WARNING &quot;%s: Out of memory allocating beacons\n&quot;, ieee-&gt;dev-&gt;name); </pre> coccinelle: cpmac: convert to net_device_ops <pre>commit 63ef7d89cbecc249339a59c7a1ec58d2e8e88ea5 Author: Alexander Beregalov &lt;a.beregalov@gmail.com&gt; Date: Wed Apr 15 12:52:36 2009 +0000 cpmac: convert to net_device_ops Signed-off-by: Alexander Beregalov &lt;a.beregalov@gmail.com&gt; Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt; </pre>---<pre>rules/unused.cocci: // A variable is only initialized to a constant and is never used otherwise // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/unused.html // Options: -no_includes -include_headers diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c index af305c0..b7c512f 100644 --- a/tmp/ymYqFdB7TT.c +++ b/tmp/AgCHh62Ukh.c @@ -1111,7 +1111,6 @@ static int external_switch; static int __devinit cpmac_probe(struct platform_device *pdev) { int rc, phy_id, i; - char *mdio_bus_id = &quot;0&quot;; struct resource *mem; struct cpmac_priv *priv; struct net_device *dev; @@ -1128,8 +1127,7 @@ static int __devinit cpmac_probe(struct platform_device *pdev) } if (phy_id == PHY_MAX_ADDR) { - if (external_switch || dumb_switch) { - mdio_bus_id = 0; /* fixed phys bus */ + if (external_switch || dumb_switch) { /* fixed phys bus */ phy_id = pdev-&gt;id; } else { dev_err(&amp;pdev-&gt;dev, &quot;no PHY present\n&quot;); </pre> checkpatch: hplance: convert to net_device_ops <pre>commit 2e303a929f2178420820cbfab581ca1c7efa18e8 Author: Alexander Beregalov &lt;a.beregalov@gmail.com&gt; Date: Wed Apr 15 12:52:38 2009 +0000 hplance: convert to net_device_ops Signed-off-by: Alexander Beregalov &lt;a.beregalov@gmail.com&gt; Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt; </pre>---<pre>ERROR: code indent should use tabs where possible #44: FILE: drivers/net/hplance.c:151: + dev-&gt;netdev_ops = &amp;hplance_netdev_ops;$ total: 1 errors, 0 warnings, 33 lines checked </pre> coccinelle: ibmveth: convert to net_device_ops <pre>commit e186d174e04a7c79606e1ee57abb7470861b3b00 Author: Alexander Beregalov &lt;a.beregalov@gmail.com&gt; Date: Wed Apr 15 12:52:39 2009 +0000 ibmveth: convert to net_device_ops Signed-off-by: Alexander Beregalov &lt;a.beregalov@gmail.com&gt; Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c index 0a51b0b..c2858db 100644 --- a/tmp/Y4zmDDIylw.c +++ b/tmp/5TNr29MBlP.c @@ -191,14 +191,14 @@ static int ibmveth_alloc_buffer_pool(struct ibmveth_buff_pool *pool) return -1; } - pool-&gt;dma_addr = kmalloc(sizeof(dma_addr_t) * pool-&gt;size, GFP_KERNEL); + pool-&gt;dma_addr = kcalloc(pool-&gt;size, sizeof(dma_addr_t), GFP_KERNEL); if(!pool-&gt;dma_addr) { kfree(pool-&gt;free_map); pool-&gt;free_map = NULL; return -1; } - pool-&gt;skbuff = kmalloc(sizeof(void*) * pool-&gt;size, GFP_KERNEL); + pool-&gt;skbuff = kcalloc(pool-&gt;size, sizeof(void *), GFP_KERNEL); if(!pool-&gt;skbuff) { kfree(pool-&gt;dma_addr); @@ -209,8 +209,6 @@ static int ibmveth_alloc_buffer_pool(struct ibmveth_buff_pool *pool) return -1; } - memset(pool-&gt;skbuff, 0, sizeof(void*) * pool-&gt;size); - memset(pool-&gt;dma_addr, 0, sizeof(dma_addr_t) * pool-&gt;size); for(i = 0; i &lt; pool-&gt;size; ++i) { pool-&gt;free_map[i] = i; </pre> coccinelle: pasemi_mac: convert to net_device_ops <pre>commit 9e0ac841f42df4e7acdab7dc1620de0933ed56d7 Author: Alexander Beregalov &lt;a.beregalov@gmail.com&gt; Date: Wed Apr 15 12:52:54 2009 +0000 pasemi_mac: convert to net_device_ops Signed-off-by: Alexander Beregalov &lt;a.beregalov@gmail.com&gt; Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c index 067caba..8c88868 100644 --- a/tmp/n2WCSphEmu.c +++ b/tmp/SuPsu0AN3N.c @@ -426,8 +426,7 @@ static int pasemi_mac_setup_rx_resources(const struct net_device *dev) spin_lock_init(&amp;ring-&gt;lock); ring-&gt;size = RX_RING_SIZE; - ring-&gt;ring_info = kzalloc(sizeof(struct pasemi_mac_buffer) * - RX_RING_SIZE, GFP_KERNEL); + ring-&gt;ring_info = kcalloc(RX_RING_SIZE, sizeof(struct pasemi_mac_buffer), GFP_KERNEL); if (!ring-&gt;ring_info) goto out_ring_info; @@ -511,8 +510,7 @@ pasemi_mac_setup_tx_resources(const struct net_device *dev) spin_lock_init(&amp;ring-&gt;lock); ring-&gt;size = TX_RING_SIZE; - ring-&gt;ring_info = kzalloc(sizeof(struct pasemi_mac_buffer) * - TX_RING_SIZE, GFP_KERNEL); + ring-&gt;ring_info = kcalloc(TX_RING_SIZE, sizeof(struct pasemi_mac_buffer), GFP_KERNEL); if (!ring-&gt;ring_info) goto out_ring_info; </pre> checkpatch: fec: switch to writel/readl <pre>commit f44d6305280378cb34319e0118e18d84cc7ac773 Author: Sascha Hauer &lt;s.hauer@pengutronix.de&gt; Date: Wed Apr 15 03:11:30 2009 +0000 fec: switch to writel/readl Signed-off-by: Sascha Hauer &lt;s.hauer@pengutronix.de&gt; Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt; </pre>---<pre>WARNING: line over 80 characters #175: FILE: drivers/net/fec.c:1246: + *((unsigned long *) &amp;tmpaddr[0]) = readl(fep-&gt;hwp + FEC_ADDR_LOW); WARNING: line over 80 characters #176: FILE: drivers/net/fec.c:1247: + *((unsigned short *) &amp;tmpaddr[4]) = (readl(fep-&gt;hwp + FEC_ADDR_HIGH) &gt;&gt; 16); WARNING: line over 80 characters #256: FILE: drivers/net/fec.c:1619: + tmp = readl(fep-&gt;hwp + FEC_GRP_HASH_TABLE_HIGH); WARNING: line over 80 characters #258: FILE: drivers/net/fec.c:1621: + writel(tmp, fep-&gt;hwp + FEC_GRP_HASH_TABLE_HIGH); WARNING: line over 80 characters #260: FILE: drivers/net/fec.c:1623: + tmp = readl(fep-&gt;hwp + FEC_GRP_HASH_TABLE_LOW); WARNING: line over 80 characters #262: FILE: drivers/net/fec.c:1625: + writel(tmp, fep-&gt;hwp + FEC_GRP_HASH_TABLE_LOW); ERROR: Macros with multiple statements should be enclosed in a do - while loop #693: FILE: drivers/net/fec.h:49: +#define FEC_ECNTRL; 0x000 /* Ethernet control reg */ ERROR: Macros with multiple statements should be enclosed in a do - while loop #694: FILE: drivers/net/fec.h:50: +#define FEC_IEVENT; 0x004 /* Interrupt even reg */ ERROR: Macros with multiple statements should be enclosed in a do - while loop #695: FILE: drivers/net/fec.h:51: +#define FEC_IMASK; 0x008 /* Interrupt mask reg */ ERROR: Macros with multiple statements should be enclosed in a do - while loop #696: FILE: drivers/net/fec.h:52: +#define FEC_IVEC; 0x00c /* Interrupt vec status reg */ ERROR: Macros with multiple statements should be enclosed in a do - while loop #697: FILE: drivers/net/fec.h:53: +#define FEC_R_DES_ACTIVE; 0x010 /* Receive descriptor reg */ ERROR: Macros with multiple statements should be enclosed in a do - while loop #698: FILE: drivers/net/fec.h:54: +#define FEC_X_DES_ACTIVE; 0x01c /* Transmit descriptor reg */ total: 6 errors, 6 warnings, 678 lines checked </pre> checkpatch: fec: do not typedef struct types <pre>commit 2e28532f7e63c3011f7b3c1516cfebd5321bdd15 Author: Sascha Hauer &lt;s.hauer@pengutronix.de&gt; Date: Wed Apr 15 01:32:16 2009 +0000 fec: do not typedef struct types Signed-off-by: Sascha Hauer &lt;s.hauer@pengutronix.de&gt; Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt; </pre>---<pre>ERROR: trailing whitespace #25: FILE: drivers/net/fec.c:187: +^Istruct bufdesc^I*cur_rx, *cur_tx; $ WARNING: line over 80 characters #119: FILE: drivers/net/fec.c:1766: + writel((unsigned long)fep-&gt;bd_dma + sizeof(struct bufdesc) * RX_RING_SIZE, WARNING: line over 80 characters #137: FILE: drivers/net/fec.c:1852: + writel((unsigned long)fep-&gt;bd_dma + sizeof(struct bufdesc) * RX_RING_SIZE, total: 1 errors, 2 warnings, 136 lines checked </pre> checkpatch: fec: Codingstyle cleanups <pre>commit 22f6b860da25abe2c3e33347ccb806e6bcc57390 Author: Sascha Hauer &lt;s.hauer@pengutronix.de&gt; Date: Wed Apr 15 01:32:18 2009 +0000 fec: Codingstyle cleanups Signed-off-by: Sascha Hauer &lt;s.hauer@pengutronix.de&gt; Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt; </pre>---<pre>WARNING: printk() should include KERN_ facility level #224: FILE: drivers/net/fec.c:556: + printk(&quot;FEC ENET: rcv is not +last\n&quot;); ERROR: &quot;(foo*)&quot; should be &quot;(foo *)&quot; #289: FILE: drivers/net/fec.c:591: + data = (__u8*)__va(bdp-&gt;cbd_bufaddr); WARNING: printk() should include KERN_ facility level #328: FILE: drivers/net/fec.c:604: + printk(&quot;%s: Memory squeeze, dropping packet.\n&quot;, WARNING: line over 80 characters #539: FILE: drivers/net/fec.c:1549: + for (bit = 0; bit &lt; 8; bit++, data &gt;&gt;= 1) { WARNING: line over 80 characters #548: FILE: drivers/net/fec.c:1556: + * which point to specific bit in he hash registers total: 1 errors, 4 warnings, 685 lines checked </pre> checkpatch: FEC Buffer rework <pre>commit f0b3fbeae11a526c3d308b691684589ee37c359b Author: Sascha Hauer &lt;s.hauer@pengutronix.de&gt; Date: Wed Apr 15 01:32:24 2009 +0000 FEC Buffer rework Allocate buffers in fec_open and free them again in fec_close. This makes it possible to use this driver as a module. Signed-off-by: Sascha Hauer &lt;s.hauer@pengutronix.de&gt; Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt; </pre>---<pre>ERROR: &quot;foo* bar&quot; should be &quot;foo *bar&quot; #20: FILE: drivers/net/fec.c:175: + struct sk_buff* rx_skbuff[RX_RING_SIZE]; WARNING: line over 80 characters #43: FILE: drivers/net/fec.c:436: + dma_unmap_single(&amp;dev-&gt;dev, bdp-&gt;cbd_bufaddr, FEC_ENET_TX_FRSIZE, DMA_TO_DEVICE); ERROR: code indent should use tabs where possible #54: FILE: drivers/net/fec.c:561: +^I dma_unmap_single(NULL, bdp-&gt;cbd_bufaddr, bdp-&gt;cbd_datlen,$ ERROR: code indent should use tabs where possible #55: FILE: drivers/net/fec.c:562: + ^I^I^IDMA_FROM_DEVICE);$ ERROR: code indent should use tabs where possible #64: FILE: drivers/net/fec.c:583: + ^Ibdp-&gt;cbd_bufaddr = dma_map_single(NULL, data, bdp-&gt;cbd_datlen,$ ERROR: code indent should use tabs where possible #160: FILE: drivers/net/fec.c:1535: + fec_enet_free_buffers(dev);$ total: 5 errors, 1 warnings, 202 lines checked </pre> coccinelle: myri10ge: force stats update in ethtool gstats <pre>commit 590818250684d18bb0e30c45d79971dcdff96ad0 Author: Brice Goglin &lt;brice@myri.com&gt; Date: Thu Apr 16 02:23:56 2009 +0000 myri10ge: force stats update in ethtool gstats Force a statistics update when our ethtool gstats routine is called. Otherwise, ethtool will continue to read stale stats until something forces an update by reading /proc/net/dev This requires putting a lock around the stats update to guard against 2 threads (one via ethtool, and one via procfs) updating the stats at once. Signed-off-by: Brice Goglin &lt;brice@myri.com&gt; Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt; </pre>---<pre>rules/notand.cocci: // !x&amp;y combines boolean negation with bitwise and // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/notand.html // Options: -no_includes -include_headers diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index a833cdd..6a6d894 100644 --- a/tmp/zLopagDH5P.c +++ b/tmp/h8KwsYTiW8.c @@ -2807,7 +2807,7 @@ again: flags_next |= next_is_first * MXGEFW_FLAGS_FIRST; rdma_count |= -(chop | next_is_first); - rdma_count += chop &amp; !next_is_first; + rdma_count += !(next_is_first &amp; chop); } else if (likely(cum_len_next &gt;= 0)) { /* header ends */ int small; </pre> checkpatch: sh: pci: Set pci_cache_line_size on SH7780 via the PCICLS register. <pre>commit c66c1d79a94a7a302e2dc6c93da40902423eac3e Author: Paul Mundt &lt;lethal@linux-sh.org&gt; Date: Fri Apr 17 16:38:00 2009 +0900 sh: pci: Set pci_cache_line_size on SH7780 via the PCICLS register. The SH7780 PCIC contains a read-only cache line size register that we can derive pci_cache_line_size from. So, make sure that the software idea of the cache line size actually matches the host controller&#39;s idea. Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt; </pre>---<pre>WARNING: externs should be avoided in .c files #44: FILE: arch/sh/drivers/pci/pci-sh7780.c:72: +extern u8 pci_cache_line_size; total: 0 errors, 1 warnings, 46 lines checked </pre> checkpatch: sh: pci: Consolidate PCI I/O and mem window definitions for SH7780. <pre>commit ab1363a8929f32cc163cd3f50ca72f20d901b00c Author: Paul Mundt &lt;lethal@linux-sh.org&gt; Date: Fri Apr 17 17:07:47 2009 +0900 sh: pci: Consolidate PCI I/O and mem window definitions for SH7780. This consolidates all of the PCI I/O and memory window definitions across the pci-sh7780 users in pci-sh7780 itself. No functional changes, in that every platform had exactly the same implementation. Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt; </pre>---<pre>WARNING: line over 80 characters #198: FILE: arch/sh/drivers/pci/pci-sh7780.c:89: + { sh7780_pci_init, &amp;sh4_pci_ops, &amp;sh7785_io_resource, &amp;sh7785_mem_resource, 0, 0xff }, total: 0 errors, 1 warnings, 175 lines checked </pre> coccinelle: ftrace: use module notifier for function tracer <pre>commit 93eb677d74a4f7d3edfb678c94f6c0544d9fbad2 Author: Steven Rostedt &lt;srostedt@redhat.com&gt; Date: Wed Apr 15 13:24:06 2009 -0400 ftrace: use module notifier for function tracer The hooks in the module code for the function tracer must be called before any of that module code runs. The function tracer hooks modify the module (replacing calls to mcount to nops). If the code is executed while the change occurs, then the CPU can take a GPF. To handle the above with a bit of paranoia, I originally implemented the hooks as calls directly from the module code. After examining the notifier calls, it looks as though the start up notify is called before any of the module&#39;s code is executed. This makes the use of the notify safe with ftrace. Only the startup notify is required to be &quot;safe&quot;. The shutdown simply removes the entries from the ftrace function list, and does not modify any code. This change has another benefit. It removes a issue with a reverse dependency in the mutexes of ftrace_lock and module_mutex. [ Impact: fix lock dependency bug, cleanup ] Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt; Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 5b606f4..393263a 100644 --- a/tmp/9lB3Vs1GD6.c +++ b/tmp/BWXmtWjKV3.c @@ -481,7 +481,7 @@ static int ftrace_profile_init_cpu(int cpu) */ size = FTRACE_PROFILE_HASH_SIZE; - stat-&gt;hash = kzalloc(sizeof(struct hlist_head) * size, GFP_KERNEL); + stat-&gt;hash = kcalloc(size, sizeof(struct hlist_head), GFP_KERNEL); if (!stat-&gt;hash) return -ENOMEM; rules/mut.cocci: // A mutex_lock is not matched by a mutex_unlock before an error return. // // Confidence: Moderate // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/mut.html // Options: -no_includes -include_headers diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 5b606f4..0acc9d3 100644 --- a/tmp/9lB3Vs1GD6.c +++ b/tmp/4kJMLkeuq8.c @@ -1494,9 +1494,11 @@ static void *t_start(struct seq_file *m, loff_t *pos) */ if (iter-&gt;flags &amp; FTRACE_ITER_FILTER &amp;&amp; !ftrace_filtered) { if (*pos &gt; 0) + mutex_unlock(&amp;ftrace_lock); return t_hash_start(m, pos); iter-&gt;flags |= FTRACE_ITER_PRINTALL; (*pos)++; + mutex_unlock(&amp;ftrace_lock); return iter; } </pre> badincludes: tracing/events: add startup tests for events <pre>commit e6187007d6c365b551c69ea3df46f06fd1c8bd19 Author: Steven Rostedt &lt;srostedt@redhat.com&gt; Date: Wed Apr 15 13:36:40 2009 -0400 tracing/events: add startup tests for events As events start to become popular, and the new way to add tracing infrastructure into ftrace, it is important to catch any problems that might happen with a mistake in the TRACE_EVENT macro. This patch introduces a startup self test on the registered trace events. Note, it can only do a generic test, any type of testing that needs more involement is needed to be implemented by the tracepoint creators. The test goes down one by one enabling a trace point and running some random tasks (random in the sense that I just made them up). Those tasks are creating threads, grabbing mutexes and spinlocks and using workqueues. After testing each event individually, it does the same test after enabling each system of trace points. Like sched, irq, lockdep. Then finally it enables all tracepoints and performs the tasks again. The output to the console on bootup will look like this when everything works: Running tests on trace events: Testing event kfree_skb: OK Testing event kmalloc: OK Testing event kmem_cache_alloc: OK Testing event kmalloc_node: OK Testing event kmem_cache_alloc_node: OK Testing event kfree: OK Testing event kmem_cache_free: OK Testing event irq_handler_exit: OK Testing event irq_handler_entry: OK Testing event softirq_entry: OK Testing event softirq_exit: OK Testing event lock_acquire: OK Testing event lock_release: OK Testing event sched_kthread_stop: OK Testing event sched_kthread_stop_ret: OK Testing event sched_wait_task: OK Testing event sched_wakeup: OK Testing event sched_wakeup_new: OK Testing event sched_switch: OK Testing event sched_migrate_task: OK Testing event sched_process_free: OK Testing event sched_process_exit: OK Testing event sched_process_wait: OK Testing event sched_process_fork: OK Testing event sched_signal_send: OK Running tests on trace event systems: Testing event system skb: OK Testing event system kmem: OK Testing event system irq: OK Testing event system lockdep: OK Testing event system sched: OK Running tests on all trace events: Testing all events: OK [ folded in: tracing: add #include &lt;linux/delay.h&gt; to fix build failure in test_work() This build failure occured on a few rare configs: kernel/trace/trace_events.c: In function &acirc;&#128;&#152;test_work&acirc;&#128;&#153;: kernel/trace/trace_events.c:975: error: implicit declaration of function &acirc;&#128;&#152;udelay&acirc;&#128;&#153; kernel/trace/trace_events.c:980: error: implicit declaration of function &acirc;&#128;&#152;msleep&acirc;&#128;&#153; delay.h is included in way too many other headers, hiding cases where new usage is added without header inclusion. [ Impact: build fix ] Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; ] [ Impact: add event tracer self-tests ] Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt; </pre>---<pre>diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 6591d83..f81d6ee 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -8,10 +8,14 @@ * */ +#include &lt;linux/workqueue.h&gt; +#include &lt;linux/spinlock.h&gt; +#include &lt;linux/kthread.h&gt; #include &lt;linux/debugfs.h&gt; #include &lt;linux/uaccess.h&gt; #include &lt;linux/module.h&gt; #include &lt;linux/ctype.h&gt; +#include &lt;linux/delay.h&gt; #include &quot;trace_output.h&quot; include linux/workqueue.h inserted before linux/debugfs.h diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 6591d83..f81d6ee 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -8,10 +8,14 @@ * */ +#include &lt;linux/workqueue.h&gt; +#include &lt;linux/spinlock.h&gt; +#include &lt;linux/kthread.h&gt; #include &lt;linux/debugfs.h&gt; #include &lt;linux/uaccess.h&gt; #include &lt;linux/module.h&gt; #include &lt;linux/ctype.h&gt; +#include &lt;linux/delay.h&gt; #include &quot;trace_output.h&quot; include linux/spinlock.h inserted before linux/debugfs.h diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 6591d83..f81d6ee 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -8,10 +8,14 @@ * */ +#include &lt;linux/workqueue.h&gt; +#include &lt;linux/spinlock.h&gt; +#include &lt;linux/kthread.h&gt; #include &lt;linux/debugfs.h&gt; #include &lt;linux/uaccess.h&gt; #include &lt;linux/module.h&gt; #include &lt;linux/ctype.h&gt; +#include &lt;linux/delay.h&gt; #include &quot;trace_output.h&quot; include linux/kthread.h inserted before linux/debugfs.h </pre> coccinelle: tracing/filters: add filter_mutex to protect filter predicates <pre>commit ac1adc55fc71c7515caa2eb0e63e49b3d1c6a47c Author: Tom Zanussi &lt;tzanussi@gmail.com&gt; Date: Fri Apr 17 00:27:08 2009 -0500 tracing/filters: add filter_mutex to protect filter predicates This patch adds a filter_mutex to prevent the filter predicates from being accessed concurrently by various external functions. It&#39;s based on a previous patch by Li Zefan: &quot;[PATCH 7/7] tracing/filters: make filter preds RCU safe&quot; v2 changes: - fixed wrong value returned in a add_subsystem_pred() failure case noticed by Li Zefan. [ Impact: fix trace filter corruption/crashes on parallel access ] Signed-off-by: Tom Zanussi &lt;tzanussi@gmail.com&gt; Reviewed-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt; Tested-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt; Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt; Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt; Cc: paulmck@linux.vnet.ibm.com LKML-Reference: &lt;1239946028.6639.13.camel@tropicana&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index e0fcfd2..5a5aad2 100644 --- a/tmp/BNlH2WQwdr.c +++ b/tmp/arqii1ejoI.c @@ -222,7 +222,7 @@ int init_preds(struct ftrace_event_call *call) call-&gt;n_preds = 0; - call-&gt;preds = kzalloc(MAX_FILTER_PRED * sizeof(pred), GFP_KERNEL); + call-&gt;preds = kcalloc(MAX_FILTER_PRED, sizeof(pred), GFP_KERNEL); if (!call-&gt;preds) return -ENOMEM; @@ -374,8 +374,7 @@ int filter_add_subsystem_pred(struct event_subsystem *system, __filter_free_subsystem_preds(system); if (!system-&gt;n_preds) { - system-&gt;preds = kzalloc(MAX_FILTER_PRED * sizeof(pred), - GFP_KERNEL); + system-&gt;preds = kcalloc(MAX_FILTER_PRED, sizeof(pred), GFP_KERNEL); if (!system-&gt;preds) { mutex_unlock(&amp;filter_mutex); return -ENOMEM; </pre> coccinelle: tracing: add same level recursion detection <pre>commit 261842b7c9099f56de2eb969c8ad65402d68e00e Author: Steven Rostedt &lt;srostedt@redhat.com&gt; Date: Thu Apr 16 21:41:52 2009 -0400 tracing: add same level recursion detection The tracing infrastructure allows for recursion. That is, an interrupt may interrupt the act of tracing an event, and that interrupt may very well perform its own trace. This is a recursive trace, and is fine to do. The problem arises when there is a bug, and the utility doing the trace calls something that recurses back into the tracer. This recursion is not caused by an external event like an interrupt, but by code that is not expected to recurse. The result could be a lockup. This patch adds a bitmask to the task structure that keeps track of the trace recursion. To find the interrupt depth, the following algorithm is used: level = hardirq_count() + softirq_count() + in_nmi; Here, level will be the depth of interrutps and softirqs, and even handles the nmi. Then the corresponding bit is set in the recursion bitmask. If the bit was already set, we know we had a recursion at the same level and we warn about it and fail the writing to the buffer. After the data has been committed to the buffer, we clear the bit. No atomics are needed. The only races are with interrupts and they reset the bitmask before returning anywy. [ Impact: detect same irq level trace recursion ] Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt; </pre>---<pre>rules/notand.cocci: // !x&amp;y combines boolean negation with bitwise and // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/notand.html // Options: -no_includes -include_headers diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index b421b0e..5870334 100644 --- a/tmp/8eROT6U7Ei.c +++ b/tmp/24GaFMMhuq.c @@ -1510,7 +1510,7 @@ static void trace_recursive_unlock(void) level = trace_irq_level(); - WARN_ON_ONCE(!current-&gt;trace_recursion &amp; (1 &lt;&lt; level)); + WARN_ON_ONCE(!(current-&gt;trace_recursion &amp; (1 &lt;&lt; level))); current-&gt;trace_recursion &amp;= ~(1 &lt;&lt; level); } </pre> coccinelle: myri10ge: fix compile error <pre>commit 7fe624f5607ed98de0034adf130e857474dffc2b Author: Andrew Gallatin &lt;gallatin@myri.com&gt; Date: Fri Apr 17 15:45:15 2009 -0700 myri10ge: fix compile error A compilation error snuck into 2d90b0aa3bc484189940444bcddcbe0ebbb53af5 due to an over-zealous indent script removing spaces around array initialization ellipsis. The attached patch fixes the myri10ge compilation in net-next. Signed-off-by: Andrew Gallatin &lt;gallatin@myri.com&gt; Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt; </pre>---<pre>rules/notand.cocci: // !x&amp;y combines boolean negation with bitwise and // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/notand.html // Options: -no_includes -include_headers diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 140794a..252d11d 100644 --- a/tmp/TKwOkwFlgx.c +++ b/tmp/4wVVVr8Mwb.c @@ -2815,7 +2815,7 @@ again: flags_next |= next_is_first * MXGEFW_FLAGS_FIRST; rdma_count |= -(chop | next_is_first); - rdma_count += chop &amp; !next_is_first; + rdma_count += !(next_is_first &amp; chop); } else if (likely(cum_len_next &gt;= 0)) { /* header ends */ int small; rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 140794a..aa91acb 100644 --- a/tmp/TKwOkwFlgx.c +++ b/tmp/fMPbMu7LPv.c @@ -3720,8 +3720,7 @@ static void myri10ge_probe_slices(struct myri10ge_priv *mgp) * slices. We give up on MSI-X if we can only get a single * vector. */ - mgp-&gt;msix_vectors = kzalloc(mgp-&gt;num_slices * - sizeof(*mgp-&gt;msix_vectors), GFP_KERNEL); + mgp-&gt;msix_vectors = kcalloc(mgp-&gt;num_slices, sizeof(*mgp-&gt;msix_vectors), GFP_KERNEL); if (mgp-&gt;msix_vectors == NULL) goto disable_msix; for (i = 0; i &lt; mgp-&gt;num_slices; i++) { </pre> coccinelle: ide: don't set REQ_SOFTBARRIER <pre>commit 55f3f399422a4a3f6cb84ea4096dfaddf8817399 Author: Tejun Heo &lt;tj@kernel.org&gt; Date: Sun Apr 19 07:00:41 2009 +0900 ide: don&#39;t set REQ_SOFTBARRIER ide doesn&#39;t have to worry about REQ_SOFTBARRIER. Don&#39;t set it. Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index c243880..5ea6df9 100644 --- a/tmp/t0G1XWP5hT.c +++ b/tmp/wZ059N4cYc.c @@ -395,12 +395,11 @@ static int ide_disk_get_capacity(ide_drive_t *drive) static void idedisk_prepare_flush(struct request_queue *q, struct request *rq) { ide_drive_t *drive = q-&gt;queuedata; - struct ide_cmd *cmd = kmalloc(sizeof(*cmd), GFP_ATOMIC); + struct ide_cmd *cmd = kzalloc(sizeof(*cmd), GFP_ATOMIC); /* FIXME: map struct ide_taskfile on rq-&gt;cmd[] */ BUG_ON(cmd == NULL); - memset(cmd, 0, sizeof(*cmd)); if (ata_id_flush_ext_enabled(drive-&gt;id) &amp;&amp; (drive-&gt;capacity64 &gt;= (1UL &lt;&lt; 28))) cmd-&gt;tf.command = ATA_CMD_FLUSH_EXT; </pre> coccinelle: x86, intr-remap: fix ack for interrupt remapping <pre>commit 5d0ae2db6deac4f15dac4f42f23bc56448fc8d4d Author: Weidong Han &lt;weidong.han@intel.com&gt; Date: Fri Apr 17 16:42:13 2009 +0800 x86, intr-remap: fix ack for interrupt remapping Shouldn&#39;t call ack_apic_edge() in ir_ack_apic_edge(), because ack_apic_edge() does more than just ack: it also does irq migration in the non-interrupt-remapping case. But there is no such need for interrupt-remapping case, as irq migration is done in the process context. Similarly, ir_ack_apic_level() shouldn&#39;t call ack_apic_level, and instead should do the local cpu&#39;s EOI + directed EOI to the io-apic. ack_x2APIC_irq() is not neccessary, because ack_APIC_irq() will use MSR write for x2apic, and uncached write for non-x2apic. [ Impact: simplify/standardize intr-remap IRQ acking, fix on !x2apic ] Signed-off-by: Suresh Siddha &lt;suresh.b.siddha@intel.com&gt; Signed-off-by: Weidong Han &lt;weidong.han@intel.com&gt; Acked-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt; Cc: iommu@lists.linux-foundation.org Cc: allen.m.kay@intel.com Cc: fenghua.yu@intel.com LKML-Reference: &lt;1239957736-6161-3-git-send-email-weidong.han@intel.com&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index ea22a86..8905ea5 100644 --- a/tmp/xqqYVM370u.c +++ b/tmp/coWQzlgGWN.c @@ -742,15 +742,13 @@ struct IO_APIC_route_entry **alloc_ioapic_entries(void) int apic; struct IO_APIC_route_entry **ioapic_entries; - ioapic_entries = kzalloc(sizeof(*ioapic_entries) * nr_ioapics, - GFP_ATOMIC); + ioapic_entries = kcalloc(nr_ioapics, sizeof(*ioapic_entries), GFP_ATOMIC); if (!ioapic_entries) return 0; for (apic = 0; apic &lt; nr_ioapics; apic++) { ioapic_entries[apic] = - kzalloc(sizeof(struct IO_APIC_route_entry) * - nr_ioapic_registers[apic], GFP_ATOMIC); + kcalloc(nr_ioapic_registers[apic], sizeof(struct IO_APIC_route_entry), GFP_ATOMIC); if (!ioapic_entries[apic]) goto nomem; } </pre> coccinelle: x86, intr-remap: enable interrupt remapping early <pre>commit 937582382c71b75b29fbb92615629494e1a05ac0 Author: Weidong Han &lt;weidong.han@intel.com&gt; Date: Fri Apr 17 16:42:14 2009 +0800 x86, intr-remap: enable interrupt remapping early Currently, when x2apic is not enabled, interrupt remapping will be enabled in init_dmars(), where it is too late to remap ioapic interrupts, that is, ioapic interrupts are really in compatibility mode, not remappable mode. This patch always enables interrupt remapping before ioapic setup, it guarantees all interrupts will be remapped when interrupt remapping is enabled. Thus it doesn&#39;t need to set the compatibility interrupt bit. [ Impact: refactor intr-remap init sequence, enable fuller remap mode ] Signed-off-by: Suresh Siddha &lt;suresh.b.siddha@intel.com&gt; Signed-off-by: Weidong Han &lt;weidong.han@intel.com&gt; Acked-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt; Cc: iommu@lists.linux-foundation.org Cc: allen.m.kay@intel.com Cc: fenghua.yu@intel.com LKML-Reference: &lt;1239957736-6161-4-git-send-email-weidong.han@intel.com&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/local.cocci: // local_irq_save should be matched by local_irq_restore in error-handling code // // Confidence: Moderate // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/local.html // Options: -no_includes -include_headers diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 0cf1eea..f869f95 100644 --- a/tmp/ZcamP3B0HO.c +++ b/tmp/cFUKo95B6E.c @@ -2036,6 +2036,7 @@ static int lapic_resume(struct sys_device *dev) ioapic_entries = alloc_ioapic_entries(); if (!ioapic_entries) { WARN(1, &quot;Alloc ioapic_entries in lapic resume failed.&quot;); + local_irq_restore(flags); return -ENOMEM; } @@ -2051,8 +2052,9 @@ static int lapic_resume(struct sys_device *dev) enable_x2apic(); } #else - if (!apic_pm_state.active) + if (!apic_pm_state.active){local_irq_restore(flags); return 0; + } local_irq_save(flags); if (x2apic) rules/kzalloc.cocci: // kzalloc should be used rather than kmalloc followed by memset 0 // kcalloc should be used rather than kzalloc of a product of values // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/kzalloc.html // Options: -no_includes -include_headers diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index 9ce8f07..a634429 100644 --- a/tmp/YjA1MJrlNB.c +++ b/tmp/V8QHS1ifQK.c @@ -1884,8 +1884,7 @@ static int __init init_dmars(void) goto error; } - deferred_flush = kzalloc(g_num_of_iommus * - sizeof(struct deferred_flush_tables), GFP_KERNEL); + deferred_flush = kcalloc(g_num_of_iommus, sizeof(struct deferred_flush_tables), GFP_KERNEL); if (!deferred_flush) { kfree(g_iommus); ret = -ENOMEM; @@ -2665,8 +2664,7 @@ static int iommu_suspend(struct sys_device *dev, pm_message_t state) unsigned long flag; for_each_active_iommu(iommu, drhd) { - iommu-&gt;iommu_state = kzalloc(sizeof(u32) * MAX_SR_DMAR_REGS, - GFP_ATOMIC); + iommu-&gt;iommu_state = kcalloc(MAX_SR_DMAR_REGS, sizeof(u32), GFP_ATOMIC); if (!iommu-&gt;iommu_state) goto nomem; } </pre> coccinelle: x86, intr-remap: fix x2apic/intr-remap resume <pre>commit 9a2755c3569e4db92bd9b1daadeddb4045b0cccd Author: Weidong Han &lt;weidong.han@intel.com&gt; Date: Fri Apr 17 16:42:16 2009 +0800 x86, intr-remap: fix x2apic/intr-remap resume Interrupt remapping was decoupled from x2apic. Shouldn&#39;t check x2apic before resume interrupt remapping. Otherwise, interrupt remapping won&#39;t be resumed when x2apic is not enabled. [ Impact: fix potential intr-remap resume hang on !x2apic ] Signed-off-by: Suresh Siddha &lt;suresh.b.siddha@intel.com&gt; Signed-off-by: Weidong Han &lt;weidong.han@intel.com&gt; Acked-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt; Cc: iommu@lists.linux-foundation.org Cc: allen.m.kay@intel.com Cc: fenghua.yu@intel.com LKML-Reference: &lt;1239957736-6161-6-git-send-email-weidong.han@intel.com&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>rules/local.cocci: // local_irq_save should be matched by local_irq_restore in error-handling code // // Confidence: Moderate // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/local.html // Options: -no_includes -include_headers diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 7b41a32..38ba679 100644 --- a/tmp/CU5rMfW67A.c +++ b/tmp/Qu9VW3vLnD.c @@ -2036,6 +2036,7 @@ static int lapic_resume(struct sys_device *dev) ioapic_entries = alloc_ioapic_entries(); if (!ioapic_entries) { WARN(1, &quot;Alloc ioapic_entries in lapic resume failed.&quot;); + local_irq_restore(flags); return -ENOMEM; } @@ -2053,8 +2054,9 @@ static int lapic_resume(struct sys_device *dev) if (x2apic) enable_x2apic(); #else - if (!apic_pm_state.active) + if (!apic_pm_state.active){local_irq_restore(flags); return 0; + } local_irq_save(flags); if (x2apic) </pre> checkpatch: x86: es7000, uv - use __cpuinit for kicking secondary cpus <pre>commit 667c5296cc76fefe0abcb79228952b28d9af45e3 Author: Cyrill Gorcunov &lt;gorcunov@openvz.org&gt; Date: Sun Apr 19 11:43:11 2009 +0400 x86: es7000, uv - use __cpuinit for kicking secondary cpus The caller already has __cpuinit attribute. [ Impact: save memory, address section mismatch warning ] Signed-off-by: Cyrill Gorcunov &lt;gorcunov@openvz.org&gt; Cc: Yinghai Lu &lt;yhlu.kernel@gmail.com&gt; Cc: Pavel Emelyanov &lt;xemul@openvz.org&gt; LKML-Reference: &lt;20090419074311.GA8670@lenovo&gt; Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>WARNING: line over 80 characters #38: FILE: arch/x86/kernel/apic/x2apic_uv_x.c:94: +static int __cpuinit uv_wakeup_secondary(int phys_apicid, unsigned long start_rip) total: 0 errors, 1 warnings, 16 lines checked </pre> coccinelle: tracing/core: Add current context on tracing recursion warning <pre>commit e057a5e5647a1c9d0d0054fbd298bfa04b3d1cb4 Author: Frederic Weisbecker &lt;fweisbec@gmail.com&gt; Date: Sun Apr 19 23:38:12 2009 +0200 tracing/core: Add current context on tracing recursion warning In case of tracing recursion detection, we only get the stacktrace. But the current context may be very useful to debug the issue. This patch adds the softirq/hardirq/nmi context with the warning using lockdep context display to have a familiar output. v2: Use printk_once() v3: drop {hardirq,softirq}_context which depend on lockdep, only keep what is part of current-&gt;trace_recursion, sufficient to debug the warning source. [ Impact: print context necessary to debug recursion ] Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt; </pre>---<pre>rules/notand.cocci: // !x&amp;y combines boolean negation with bitwise and // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/notand.html // Options: -no_includes -include_headers diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index bffde63..501b861 100644 --- a/tmp/pxsXqMpR4c.c +++ b/tmp/QIvkzu0YvD.c @@ -1517,7 +1517,7 @@ static void trace_recursive_unlock(void) level = trace_irq_level(); - WARN_ON_ONCE(!current-&gt;trace_recursion &amp; (1 &lt;&lt; level)); + WARN_ON_ONCE(!(current-&gt;trace_recursion &amp; (1 &lt;&lt; level))); current-&gt;trace_recursion &amp;= ~(1 &lt;&lt; level); } </pre> checkpatch: sh: pci: Split out new-style PCI core. <pre>commit 4c5107e44514a9bde74d0af77982705d602d9e39 Author: Paul Mundt &lt;lethal@linux-sh.org&gt; Date: Mon Apr 20 15:43:36 2009 +0900 sh: pci: Split out new-style PCI core. This splits off a &#39;pci-new.c&#39; which is aimed at gradually replacing the pci-auto backend and the arch/sh/drivers/pci/pci.c core respectively. Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt; </pre>---<pre>ERROR: spaces required around that &#39;=&#39; (ctx:VxV) #222: FILE: arch/sh/drivers/pci/pci-new.c:163: + for(idx=0; idx&lt;6; idx++) { ^ ERROR: spaces required around that &#39;&lt;&#39; (ctx:VxV) #222: FILE: arch/sh/drivers/pci/pci-new.c:163: + for(idx=0; idx&lt;6; idx++) { ^ ERROR: space required before the open parenthesis &#39;(&#39; #222: FILE: arch/sh/drivers/pci/pci-new.c:163: + for(idx=0; idx&lt;6; idx++) { WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable #307: FILE: arch/sh/drivers/pci/pci-new.c:248: +EXPORT_SYMBOL(board_pci_channels); total: 3 errors, 1 warnings, 279 lines checked </pre> checkpatch: sh: pci: Consolidate pcibios_align_resource() definitions. <pre>commit a3c0e0d0032d5bbfd7dc04827a257c717d432a5b Author: Paul Mundt &lt;lethal@linux-sh.org&gt; Date: Mon Apr 20 16:14:29 2009 +0900 sh: pci: Consolidate pcibios_align_resource() definitions. This introduces a saner pcibios_align_resource() that can be used regardless of whether pci-auto or pci-new are being used, and consolidates it in pci-lib.c. Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt; </pre>---<pre>ERROR: Macros with complex values should be enclosed in parenthesis #20: FILE: arch/sh/boards/mach-se/7751/pci.c:33: +#define xPCIBIOS_MIN_IO board_pci_channels-&gt;io_resource-&gt;start ERROR: Macros with complex values should be enclosed in parenthesis #21: FILE: arch/sh/boards/mach-se/7751/pci.c:34: +#define xPCIBIOS_MIN_MEM board_pci_channels-&gt;mem_resource-&gt;start ERROR: do not initialise externals to 0 or NULL #51: FILE: arch/sh/drivers/pci/pci-lib.c:8: +unsigned long PCIBIOS_MIN_MEM = 0; ERROR: code indent should use tabs where possible #71: FILE: arch/sh/drivers/pci/pci-lib.c:28: + * Put everything into 0x00-0xff region modulo 0x400.$ WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable #94: FILE: arch/sh/drivers/pci/pci-lib.c:64: +EXPORT_SYMBOL(pcibios_resource_to_bus); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable #95: FILE: arch/sh/drivers/pci/pci-lib.c:65: +EXPORT_SYMBOL(pcibios_bus_to_resource); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable #96: FILE: arch/sh/drivers/pci/pci-lib.c:66: +EXPORT_SYMBOL(PCIBIOS_MIN_IO); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable #97: FILE: arch/sh/drivers/pci/pci-lib.c:67: +EXPORT_SYMBOL(PCIBIOS_MIN_MEM); total: 4 errors, 4 warnings, 144 lines checked </pre> coccinelle: tracing/ring-buffer: Add unlock recursion protection on discard <pre>commit f3b9aae16219aaeca2dd5a9ca69f7a10faa063df Author: Frederic Weisbecker &lt;fweisbec@gmail.com&gt; Date: Sun Apr 19 23:39:33 2009 +0200 tracing/ring-buffer: Add unlock recursion protection on discard The pair of helpers trace_recursive_lock() and trace_recursive_unlock() have been introduced recently to provide generic tracing recursion protection. They are used in a symetric way: - trace_recursive_lock() on buffer reserve - trace_recursive_unlock() on buffer commit However sometimes, we don&#39;t commit but discard on entry to the buffer, ie: in case of filter checking. Then we must also unlock the recursion protection on discard time, otherwise the tracing gets definitely deactivated and a warning is raised spuriously, such as: 111.119821] ------------[ cut here ]------------ [ 111.119829] WARNING: at kernel/trace/ring_buffer.c:1498 ring_buffer_lock_reserve+0x1b7/0x1d0() [ 111.119835] Hardware name: AMILO Li 2727 [ 111.119839] Modules linked in: [ 111.119846] Pid: 5731, comm: Xorg Tainted: G W 2.6.30-rc1 #69 [ 111.119851] Call Trace: [ 111.119863] [&lt;ffffffff8025ce68&gt;] warn_slowpath+0xd8/0x130 [ 111.119873] [&lt;ffffffff8028a30f&gt;] ? __lock_acquire+0x19f/0x1ae0 [ 111.119882] [&lt;ffffffff8028a30f&gt;] ? __lock_acquire+0x19f/0x1ae0 [ 111.119891] [&lt;ffffffff802199b0&gt;] ? native_sched_clock+0x20/0x70 [ 111.119899] [&lt;ffffffff80286dee&gt;] ? put_lock_stats+0xe/0x30 [ 111.119906] [&lt;ffffffff80286eb8&gt;] ? lock_release_holdtime+0xa8/0x150 [ 111.119913] [&lt;ffffffff802c8ae7&gt;] ring_buffer_lock_reserve+0x1b7/0x1d0 [ 111.119921] [&lt;ffffffff802cd110&gt;] trace_buffer_lock_reserve+0x30/0x70 [ 111.119930] [&lt;ffffffff802ce000&gt;] trace_current_buffer_lock_reserve+0x20/0x30 [ 111.119939] [&lt;ffffffff802474e8&gt;] ftrace_raw_event_sched_switch+0x58/0x100 [ 111.119948] [&lt;ffffffff808103b7&gt;] __schedule+0x3a7/0x4cd [ 111.119957] [&lt;ffffffff80211b56&gt;] ? ftrace_call+0x5/0x2b [ 111.119964] [&lt;ffffffff80211b56&gt;] ? ftrace_call+0x5/0x2b [ 111.119971] [&lt;ffffffff80810c08&gt;] schedule+0x18/0x40 [ 111.119977] [&lt;ffffffff80810e09&gt;] preempt_schedule+0x39/0x60 [ 111.119985] [&lt;ffffffff80813bd3&gt;] _read_unlock+0x53/0x60 [ 111.119993] [&lt;ffffffff807259d2&gt;] sock_def_readable+0x72/0x80 [ 111.120002] [&lt;ffffffff807ad5ed&gt;] unix_stream_sendmsg+0x24d/0x3d0 [ 111.120011] [&lt;ffffffff807219a3&gt;] sock_aio_write+0x143/0x160 [ 111.120019] [&lt;ffffffff80211b56&gt;] ? ftrace_call+0x5/0x2b [ 111.120026] [&lt;ffffffff80721860&gt;] ? sock_aio_write+0x0/0x160 [ 111.120033] [&lt;ffffffff80721860&gt;] ? sock_aio_write+0x0/0x160 [ 111.120042] [&lt;ffffffff8031c283&gt;] do_sync_readv_writev+0xf3/0x140 [ 111.120049] [&lt;ffffffff80211b56&gt;] ? ftrace_call+0x5/0x2b [ 111.120057] [&lt;ffffffff80276ff0&gt;] ? autoremove_wake_function+0x0/0x40 [ 111.120067] [&lt;ffffffff8045d489&gt;] ? cap_file_permission+0x9/0x10 [ 111.120074] [&lt;ffffffff8045c1e6&gt;] ? security_file_permission+0x16/0x20 [ 111.120082] [&lt;ffffffff8031cab4&gt;] do_readv_writev+0xd4/0x1f0 [ 111.120089] [&lt;ffffffff80211b56&gt;] ? ftrace_call+0x5/0x2b [ 111.120097] [&lt;ffffffff80211b56&gt;] ? ftrace_call+0x5/0x2b [ 111.120105] [&lt;ffffffff8031cc18&gt;] vfs_writev+0x48/0x70 [ 111.120111] [&lt;ffffffff8031cd65&gt;] sys_writev+0x55/0xc0 [ 111.120119] [&lt;ffffffff80211e32&gt;] system_call_fastpath+0x16/0x1b [ 111.120125] ---[ end trace 15605f4e98d5ccb5 ]--- [ Impact: fix spurious warning triggering tracing shutdown ] Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt; </pre>---<pre>rules/notand.cocci: // !x&amp;y combines boolean negation with bitwise and // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/notand.html // Options: -no_includes -include_headers diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index e145969..5618d07 100644 --- a/tmp/PPiLVLOTFE.c +++ b/tmp/VP3tpT4bE8.c @@ -1517,7 +1517,7 @@ static void trace_recursive_unlock(void) level = trace_irq_level(); - WARN_ON_ONCE(!current-&gt;trace_recursion &amp; (1 &lt;&lt; level)); + WARN_ON_ONCE(!(current-&gt;trace_recursion &amp; (1 &lt;&lt; level))); current-&gt;trace_recursion &amp;= ~(1 &lt;&lt; level); } </pre> checkpatch: syncookies: remove last_synq_overflow from struct tcp_sock <pre>commit a0f82f64e26929776c58a5c93c2ecb38e3d82815 Author: Florian Westphal &lt;fw@strlen.de&gt; Date: Sun Apr 19 09:43:48 2009 +0000 syncookies: remove last_synq_overflow from struct tcp_sock last_synq_overflow eats 4 or 8 bytes in struct tcp_sock, even though it is only used when a listening sockets syn queue is full. We can (ab)use rx_opt.ts_recent_stamp to store the same information; it is not used otherwise as long as a socket is in listen state. Move linger2 around to avoid splitting struct mtu_probe across cacheline boundary on 32 bit arches. Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt; Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt; </pre>---<pre>ERROR: do not use assignment in if condition #89: FILE: net/ipv4/syncookies.c:270: + if (tcp_synq_no_recent_overflow(sk) || ERROR: do not use assignment in if condition #111: FILE: net/ipv6/syncookies.c:178: + if (tcp_synq_no_recent_overflow(sk) || total: 2 errors, 0 warnings, 73 lines checked </pre> checkpatch: sh: pci: New-style controller registration. <pre>commit e79066a659b893debe19010179d3f3f015d76d1c Author: Paul Mundt &lt;lethal@linux-sh.org&gt; Date: Mon Apr 20 18:29:22 2009 +0900 sh: pci: New-style controller registration. This moves off of the board_pci_channels[] approach for bus registration and over to a cleaner register_pci_controller(), all derived from the MIPS code. Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt; </pre>---<pre>WARNING: externs should be avoided in .c files #152: FILE: arch/sh/drivers/pci/pci-sh7780.c:18: +extern u8 pci_cache_line_size; total: 0 errors, 1 warnings, 271 lines checked </pre> checkpatch: sh: pci: Consolidate the remaining common bits. <pre>commit 3f8daeacd7ed7a502daf0998e2515cea4f467f21 Author: Paul Mundt &lt;lethal@linux-sh.org&gt; Date: Mon Apr 20 18:53:41 2009 +0900 sh: pci: Consolidate the remaining common bits. This moves the remaining common bits in to pci-lib. Thereby reducing pci.c/pci-new.c to simple bus fixups and controller registration. As more platforms are moved over, the old code will disappear completely and the pci-new bits will be rolled in to pci-lib, eventually replacing pci.c completely. Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt; </pre>---<pre>ERROR: spaces required around that &#39;=&#39; (ctx:VxV) #31: FILE: arch/sh/drivers/pci/pci-lib.c:81: + for (idx=0; idx &lt; PCI_NUM_RESOURCES; idx++) { ^ total: 1 errors, 0 warnings, 135 lines checked </pre> checkpatch: sh: pci: Tidy up the dreamcast PCI support. <pre>commit 3444f5ec49bc6cb901ffea38e085db1d76e1189c Author: Paul Mundt &lt;lethal@linux-sh.org&gt; Date: Mon Apr 20 20:22:05 2009 +0900 sh: pci: Tidy up the dreamcast PCI support. Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt; </pre>---<pre>ERROR: trailing statements should be on next line #78: FILE: arch/sh/drivers/pci/ops-dreamcast.c:58: + case 1: *val = inb(GAPSPCI_BBA_CONFIG+where); break; ERROR: trailing statements should be on next line #79: FILE: arch/sh/drivers/pci/ops-dreamcast.c:59: + case 2: *val = inw(GAPSPCI_BBA_CONFIG+where); break; ERROR: trailing statements should be on next line #80: FILE: arch/sh/drivers/pci/ops-dreamcast.c:60: + case 4: *val = inl(GAPSPCI_BBA_CONFIG+where); break; ERROR: space prohibited after that open parenthesis &#39;(&#39; #92: FILE: arch/sh/drivers/pci/ops-dreamcast.c:72: + case 1: outb(( u8)val, GAPSPCI_BBA_CONFIG+where); break; ERROR: trailing statements should be on next line #92: FILE: arch/sh/drivers/pci/ops-dreamcast.c:72: + case 1: outb(( u8)val, GAPSPCI_BBA_CONFIG+where); break; ERROR: trailing statements should be on next line #93: FILE: arch/sh/drivers/pci/ops-dreamcast.c:73: + case 2: outw((u16)val, GAPSPCI_BBA_CONFIG+where); break; ERROR: trailing statements should be on next line #94: FILE: arch/sh/drivers/pci/ops-dreamcast.c:74: + case 4: outl((u32)val, GAPSPCI_BBA_CONFIG+where); break; ERROR: spaces required around that &#39;=&#39; (ctx:VxV) #226: FILE: arch/sh/drivers/pci/pci-dreamcast.c:59: + for (i=0; i&lt;16; i++) ^ ERROR: spaces required around that &#39;&lt;&#39; (ctx:VxV) #226: FILE: arch/sh/drivers/pci/pci-dreamcast.c:59: + for (i=0; i&lt;16; i++) ^ ERROR: spaces required around that &#39;=&#39; (ctx:VxV) #234: FILE: arch/sh/drivers/pci/pci-dreamcast.c:67: + for (i=0; i&lt;1000000; i++) ^ ERROR: spaces required around that &#39;&lt;&#39; (ctx:VxV) #234: FILE: arch/sh/drivers/pci/pci-dreamcast.c:67: + for (i=0; i&lt;1000000; i++) ^ total: 11 errors, 0 warnings, 196 lines checked </pre> checkpatch: sh: pci: Rename ops-cayman -> fixups-cayman. <pre>commit a5b08047129f214af1899bd9088605c7adc21ed5 Author: Paul Mundt &lt;lethal@linux-sh.org&gt; Date: Mon Apr 20 20:41:45 2009 +0900 sh: pci: Rename ops-cayman -&gt; fixups-cayman. Now that ops-cayman.c only contains IRQ routing fixups, rename it. Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt; </pre>---<pre>ERROR: spaces required around that &#39;=&#39; (ctx:VxV) #60: FILE: arch/sh/drivers/pci/fixups-cayman.c:35: + int i=0; ^ ERROR: trailing statements should be on next line #68: FILE: arch/sh/drivers/pci/fixups-cayman.c:43: + if (i &gt; 3) panic(&quot;PCI path to root bus too long!\n&quot;); + if (i &gt; 3) panic(&quot;PCI path to root bus too long!\n&quot;); WARNING: line over 80 characters #85: FILE: arch/sh/drivers/pci/fixups-cayman.c:60: + panic(&quot;PCI expansion bus device found - not handled!\n&quot;); WARNING: line over 80 characters #92: FILE: arch/sh/drivers/pci/fixups-cayman.c:67: + /* &#39;pin&#39; was swizzled earlier wrt slot, don&#39;t do it again. */ total: 2 errors, 2 warnings, 82 lines checked </pre> checkpatch: sh: pci: Rewrite SH7751 PCI support to follow SH7780. <pre>commit 757e3c16f8bafa2a470aebf9b04671c5d4d18f49 Author: Paul Mundt &lt;lethal@linux-sh.org&gt; Date: Mon Apr 20 21:11:07 2009 +0900 sh: pci: Rewrite SH7751 PCI support to follow SH7780. This follows the similar sort of scheme that the refactored SH7780 code uses, using a 64MB CS3 mapping to handle the window0 case, and simply discarding window1. This vastly simplifies the code, and allows most of the board-specific setup to go die. Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt; </pre>---<pre>WARNING: printk() should include KERN_ facility level #401: FILE: arch/sh/drivers/pci/pci-sh7751.c:29: + printk(&quot;PCI: Area %d is not configured for SDRAM. BCR1=0x%lx\n&quot;, WARNING: printk() should include KERN_ facility level #412: FILE: arch/sh/drivers/pci/pci-sh7751.c:38: + printk(&quot;PCI: Area %d is not 32 bit SDRAM. BCR2=0x%lx\n&quot;, ERROR: do not use assignment in if condition #472: FILE: arch/sh/drivers/pci/pci-sh7751.c:95: + if ((ret = sh4_pci_check_direct(chan)) != 0) total: 1 errors, 2 warnings, 343 lines checked </pre> checkpatch: sh: pci: Rename SH7751 platform ops files to fixups. <pre>commit 84972ec0c206b73ffb74e5114b574186ce6166b8 Author: Paul Mundt &lt;lethal@linux-sh.org&gt; Date: Mon Apr 20 21:17:10 2009 +0900 sh: pci: Rename SH7751 platform ops files to fixups. None of these contain pci_ops, only IRQ routing bits, rename them accordingly. Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt; </pre>---<pre>WARNING: printk() should include KERN_ facility level #68: FILE: arch/sh/drivers/pci/fixups-landisk.c:29: + printk(&quot;PCI: Bad IRQ mapping request for slot %d pin %c\n&quot;, ERROR: trailing statements should be on next line #134: FILE: arch/sh/drivers/pci/fixups-snapgear.c:26: + case 8: /* the PCI bridge */ break; ERROR: trailing statements should be on next line #135: FILE: arch/sh/drivers/pci/fixups-snapgear.c:27: + case 11: irq = 8; break; /* USB */ ERROR: trailing statements should be on next line #136: FILE: arch/sh/drivers/pci/fixups-snapgear.c:28: + case 12: irq = 11; break; /* PCMCIA */ ERROR: trailing statements should be on next line #137: FILE: arch/sh/drivers/pci/fixups-snapgear.c:29: + case 13: irq = 5; break; /* eth0 */ ERROR: trailing statements should be on next line #138: FILE: arch/sh/drivers/pci/fixups-snapgear.c:30: + case 14: irq = 8; break; /* eth1 */ ERROR: trailing statements should be on next line #139: FILE: arch/sh/drivers/pci/fixups-snapgear.c:31: + case 15: irq = 11; break; /* safenet (unused) */ WARNING: printk() should include KERN_ facility level #142: FILE: arch/sh/drivers/pci/fixups-snapgear.c:34: + printk(&quot;PCI: Mapping SnapGear IRQ for slot %d, pin %c to irq %d\n&quot;, WARNING: printk() should include KERN_ facility level #186: FILE: arch/sh/drivers/pci/fixups-titan.c:34: + printk(&quot;PCI: Mapping TITAN IRQ for slot %d, pin %c to irq %d\n&quot;, total: 6 errors, 3 warnings, 151 lines checked </pre> checkpatch: sh: pci: Move the se7751 fixups in to arch/sh/drivers/pci/. <pre>commit 2d5efc190eb415dbff79ffab4f8ea731ab0288a9 Author: Paul Mundt &lt;lethal@linux-sh.org&gt; Date: Mon Apr 20 21:42:59 2009 +0900 sh: pci: Move the se7751 fixups in to arch/sh/drivers/pci/. The se7751 was still doing the PCI fixups in its own board directory, so we move it over to arch/sh/drivers/pci/ with the rest of the board fixups. It has bitrotted significantly over the years, so will still likely need a bit of work to bring back up to date. Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt; </pre>---<pre>ERROR: code indent should use tabs where possible #207: FILE: arch/sh/drivers/pci/fixups-se7751.c:11: + switch (slot) {$ ERROR: code indent should use tabs where possible #208: FILE: arch/sh/drivers/pci/fixups-se7751.c:12: + case 0: return 13;$ ERROR: code indent should use tabs where possible #209: FILE: arch/sh/drivers/pci/fixups-se7751.c:13: + case 1: return 13;^I/* AMD Ethernet controller */$ ERROR: code indent should use tabs where possible #210: FILE: arch/sh/drivers/pci/fixups-se7751.c:14: + case 2: return -1;$ ERROR: code indent should use tabs where possible #211: FILE: arch/sh/drivers/pci/fixups-se7751.c:15: + case 3: return -1;$ ERROR: code indent should use tabs where possible #212: FILE: arch/sh/drivers/pci/fixups-se7751.c:16: + case 4: return -1;$ ERROR: code indent should use tabs where possible #213: FILE: arch/sh/drivers/pci/fixups-se7751.c:17: + default:$ ERROR: code indent should use tabs where possible #214: FILE: arch/sh/drivers/pci/fixups-se7751.c:18: + printk(&quot;PCI: Bad IRQ mapping request for slot %d\n&quot;, slot);$ WARNING: printk() should include KERN_ facility level #214: FILE: arch/sh/drivers/pci/fixups-se7751.c:18: + printk(&quot;PCI: Bad IRQ mapping request for slot %d\n&quot;, slot); ERROR: code indent should use tabs where possible #215: FILE: arch/sh/drivers/pci/fixups-se7751.c:19: + return -1;$ ERROR: code indent should use tabs where possible #216: FILE: arch/sh/drivers/pci/fixups-se7751.c:20: + }$ ERROR: space required after that &#39;,&#39; (ctx:VxV) #226: FILE: arch/sh/drivers/pci/fixups-se7751.c:30: +#define PCIC_WRITE(x,v) writel((v), PCI_REG(x)) ^ WARNING: Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt #245: FILE: arch/sh/drivers/pci/fixups-se7751.c:49: + bcr1 = (*(volatile unsigned long*)(SH7751_BCR1)); WARNING: Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt #246: FILE: arch/sh/drivers/pci/fixups-se7751.c:50: + bcr2 = (*(volatile unsigned short*)(SH7751_BCR2)); WARNING: Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt #247: FILE: arch/sh/drivers/pci/fixups-se7751.c:51: + wcr1 = (*(volatile unsigned long*)(SH7751_WCR1)); WARNING: Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt #248: FILE: arch/sh/drivers/pci/fixups-se7751.c:52: + wcr2 = (*(volatile unsigned long*)(SH7751_WCR2)); WARNING: Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt #249: FILE: arch/sh/drivers/pci/fixups-se7751.c:53: + wcr3 = (*(volatile unsigned long*)(SH7751_WCR3)); WARNING: Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt #250: FILE: arch/sh/drivers/pci/fixups-se7751.c:54: + mcr = (*(volatile unsigned long*)(SH7751_MCR)); WARNING: Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt #253: FILE: arch/sh/drivers/pci/fixups-se7751.c:57: + (*(volatile unsigned long*)(SH7751_BCR1)) = bcr1; WARNING: line over 80 characters #270: FILE: arch/sh/drivers/pci/fixups-se7751.c:74: + PCIC_WRITE(SH7751_PCICONF1, 0xF39000C7); /* Bus Master, Mem &amp; I/O access */ WARNING: line over 80 characters #271: FILE: arch/sh/drivers/pci/fixups-se7751.c:75: + PCIC_WRITE(SH7751_PCICONF2, 0x00000000); /* PCI Class code &amp; Revision ID */ WARNING: line over 80 characters #272: FILE: arch/sh/drivers/pci/fixups-se7751.c:76: + PCIC_WRITE(SH7751_PCICONF4, 0xab000001); /* PCI I/O address (local regs) */ WARNING: line over 80 characters #273: FILE: arch/sh/drivers/pci/fixups-se7751.c:77: + PCIC_WRITE(SH7751_PCICONF5, 0x0c000000); /* PCI MEM address (local RAM) */ WARNING: line over 80 characters #274: FILE: arch/sh/drivers/pci/fixups-se7751.c:78: + PCIC_WRITE(SH7751_PCICONF6, 0xd0000000); /* PCI MEM address (unused) */ WARNING: line over 80 characters #275: FILE: arch/sh/drivers/pci/fixups-se7751.c:79: + PCIC_WRITE(SH7751_PCICONF11, 0x35051054); /* PCI Subsystem ID &amp; Vendor ID */ WARNING: line over 80 characters #276: FILE: arch/sh/drivers/pci/fixups-se7751.c:80: + PCIC_WRITE(SH7751_PCILSR0, 0x03f00000); /* MEM (full 64M exposed) */ WARNING: line over 80 characters #277: FILE: arch/sh/drivers/pci/fixups-se7751.c:81: + PCIC_WRITE(SH7751_PCILSR1, 0x00000000); /* MEM (unused) */ WARNING: line over 80 characters #278: FILE: arch/sh/drivers/pci/fixups-se7751.c:82: + PCIC_WRITE(SH7751_PCILAR0, 0x0c000000); /* MEM (direct map from PCI) */ WARNING: line over 80 characters #279: FILE: arch/sh/drivers/pci/fixups-se7751.c:83: + PCIC_WRITE(SH7751_PCILAR1, 0x00000000); /* MEM (unused) */ WARNING: line over 80 characters #301: FILE: arch/sh/drivers/pci/fixups-se7751.c:105: + PCIC_WRITE(SH7751_PCIIOBR, (chan-&gt;io_resource-&gt;start &amp; SH7751_PCIIOBR_MASK)); WARNING: printk() should include KERN_ facility level #304: FILE: arch/sh/drivers/pci/fixups-se7751.c:108: + printk(&quot;SH7751 PCI: Finished initialization of the PCI controller\n&quot;); total: 11 errors, 20 warnings, 121 lines checked </pre> checkpatch: sh: pci: Roll pci-lib in to pci-new. <pre>commit 35bcfffd86aac933205fbf8401e3e7e4dde68264 Author: Paul Mundt &lt;lethal@linux-sh.org&gt; Date: Mon Apr 20 21:51:19 2009 +0900 sh: pci: Roll pci-lib in to pci-new. Now that the pci-auto cruft is gone, pci-lib can go away. Roll it back in to pci-new.c where it originally split off from. Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt; </pre>---<pre>ERROR: do not initialise externals to 0 or NULL #277: FILE: arch/sh/drivers/pci/pci-new.c:24: +unsigned long PCIBIOS_MIN_MEM = 0; ERROR: code indent should use tabs where possible #324: FILE: arch/sh/drivers/pci/pci-new.c:173: + * Put everything into 0x00-0xff region modulo 0x400.$ ERROR: spaces required around that &#39;=&#39; (ctx:VxV) #377: FILE: arch/sh/drivers/pci/pci-new.c:226: + for (idx=0; idx &lt; PCI_NUM_RESOURCES; idx++) { ^ WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable #511: FILE: arch/sh/drivers/pci/pci-new.c:360: +EXPORT_SYMBOL(pcibios_resource_to_bus); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable #512: FILE: arch/sh/drivers/pci/pci-new.c:361: +EXPORT_SYMBOL(pcibios_bus_to_resource); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable #513: FILE: arch/sh/drivers/pci/pci-new.c:362: +EXPORT_SYMBOL(PCIBIOS_MIN_IO); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable #514: FILE: arch/sh/drivers/pci/pci-new.c:363: +EXPORT_SYMBOL(PCIBIOS_MIN_MEM); total: 3 errors, 4 warnings, 267 lines checked </pre> checkpatch: sh: pci: Rename pci-new.c to pci.c. <pre>commit cf242007a1eb29dcf93d1cb34713ec9b3f4a0e1b Author: Paul Mundt &lt;lethal@linux-sh.org&gt; Date: Mon Apr 20 21:53:33 2009 +0900 sh: pci: Rename pci-new.c to pci.c. pci-new.c is now in a state to replace the old pci.c, rename it accordingly. Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt; </pre>---<pre>ERROR: do not initialise externals to 0 or NULL #435: FILE: arch/sh/drivers/pci/pci.c:24: +unsigned long PCIBIOS_MIN_MEM = 0; ERROR: code indent should use tabs where possible #584: FILE: arch/sh/drivers/pci/pci.c:173: + * Put everything into 0x00-0xff region modulo 0x400.$ ERROR: spaces required around that &#39;=&#39; (ctx:VxV) #637: FILE: arch/sh/drivers/pci/pci.c:226: + for (idx=0; idx &lt; PCI_NUM_RESOURCES; idx++) { ^ WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable #771: FILE: arch/sh/drivers/pci/pci.c:360: +EXPORT_SYMBOL(pcibios_resource_to_bus); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable #772: FILE: arch/sh/drivers/pci/pci.c:361: +EXPORT_SYMBOL(pcibios_bus_to_resource); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable #773: FILE: arch/sh/drivers/pci/pci.c:362: +EXPORT_SYMBOL(PCIBIOS_MIN_IO); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable #774: FILE: arch/sh/drivers/pci/pci.c:363: +EXPORT_SYMBOL(PCIBIOS_MIN_MEM); total: 3 errors, 4 warnings, 375 lines checked </pre> checkpatch: perf_counter tools: add in basic glue from Git <pre>commit 0780060124011b94af55830939c86cc0916be0f5 Author: Ingo Molnar &lt;mingo@elte.hu&gt; Date: Mon Apr 20 15:00:56 2009 +0200 perf_counter tools: add in basic glue from Git First very raw version at having a central &#39;perf&#39; command and a list of subcommands: perf top perf stat perf record perf report ... This is done by picking up Git&#39;s collection of utility functions, and hacking them to build fine in this new environment. Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt; </pre>---<pre>ERROR: return is not a function, parentheses are not required #1724: FILE: Documentation/perf_counter/abspath.c:11: + return (!stat(path, &amp;st) &amp;&amp; S_ISDIR(st.st_mode)); WARNING: space prohibited between function name and open parenthesis &#39;(&#39; #1741: FILE: Documentation/perf_counter/abspath.c:28: + die (&quot;Too long path: %.*s&quot;, 60, path); WARNING: space prohibited between function name and open parenthesis &#39;(&#39; #1757: FILE: Documentation/perf_counter/abspath.c:44: + die (&quot;Could not get current working directory&quot;); WARNING: space prohibited between function name and open parenthesis &#39;(&#39; #1760: FILE: Documentation/perf_counter/abspath.c:47: + die (&quot;Could not switch to &#39;%s&#39;&quot;, buf); WARNING: space prohibited between function name and open parenthesis &#39;(&#39; #1763: FILE: Documentation/perf_counter/abspath.c:50: + die (&quot;Could not get current working directory&quot;); WARNING: space prohibited between function name and open parenthesis &#39;(&#39; #1768: FILE: Documentation/perf_counter/abspath.c:55: + die (&quot;Too long path name: &#39;%s/%s&#39;&quot;, WARNING: space prohibited between function name and open parenthesis &#39;(&#39; #1779: FILE: Documentation/perf_counter/abspath.c:66: + die (&quot;Invalid symlink: %s&quot;, buf); WARNING: space prohibited between function name and open parenthesis &#39;(&#39; #1791: FILE: Documentation/perf_counter/abspath.c:78: + die (&quot;Could not change back to &#39;%s&#39;&quot;, cwd); ERROR: &quot;(foo*)&quot; should be &quot;(foo *)&quot; #1866: FILE: Documentation/perf_counter/alias.c:30: + *argv = malloc(sizeof(char*) * size); ERROR: &quot;(foo*)&quot; should be &quot;(foo *)&quot; #1879: FILE: Documentation/perf_counter/alias.c:43: + *argv = realloc(*argv, sizeof(char*) * size); ERROR: do not initialise statics to 0 or NULL #1950: FILE: Documentation/perf_counter/builtin-help.c:31: +static int show_all = 0; ERROR: that open brace { should be on the previous line #1982: FILE: Documentation/perf_counter/builtin-help.c:63: + for (viewer = man_viewer_info_list; viewer; viewer = viewer-&gt;next) + { ERROR: &quot;foo* bar&quot; should be &quot;foo *bar&quot; #2036: FILE: Documentation/perf_counter/builtin-help.c:117: +static void exec_woman_emacs(const char* path, const char *page) ERROR: &quot;foo* bar&quot; should be &quot;foo *bar&quot; #2050: FILE: Documentation/perf_counter/builtin-help.c:131: +static void exec_man_konqueror(const char* path, const char *page) ERROR: &quot;foo* bar&quot; should be &quot;foo *bar&quot; #2078: FILE: Documentation/perf_counter/builtin-help.c:159: +static void exec_man_man(const char* path, const char *page) ERROR: return is not a function, parentheses are not required #2107: FILE: Documentation/perf_counter/builtin-help.c:188: + return (!strncasecmp(&quot;man&quot;, name, len) || ERROR: that open brace { should be on the previous line #2284: FILE: Documentation/perf_counter/builtin-help.c:365: + for (viewer = man_viewer_list; viewer; viewer = viewer-&gt;next) + { ERROR: code indent should use tabs where possible #2402: FILE: Documentation/perf_counter/builtin-top.c:14: + weight RIP kernel function$ ERROR: code indent should use tabs where possible #2403: FILE: Documentation/perf_counter/builtin-top.c:15: + ______ ________________ _______________$ ERROR: code indent should use tabs where possible #2405: FILE: Documentation/perf_counter/builtin-top.c:17: + 35.20 - ffffffff804ce74b : skb_copy_and_csum_dev$ ERROR: code indent should use tabs where possible #2406: FILE: Documentation/perf_counter/builtin-top.c:18: + 33.00 - ffffffff804cb740 : sock_alloc_send_skb$ ERROR: code indent should use tabs where possible #2407: FILE: Documentation/perf_counter/builtin-top.c:19: + 31.26 - ffffffff804ce808 : skb_push$ ERROR: code indent should use tabs where possible #2408: FILE: Documentation/perf_counter/builtin-top.c:20: + 22.43 - ffffffff80510004 : tcp_established_options$ ERROR: code indent should use tabs where possible #2409: FILE: Documentation/perf_counter/builtin-top.c:21: + 19.00 - ffffffff8027d250 : find_get_page$ ERROR: code indent should use tabs where possible #2410: FILE: Documentation/perf_counter/builtin-top.c:22: + 15.76 - ffffffff804e4fc9 : eth_type_trans$ ERROR: code indent should use tabs where possible #2411: FILE: Documentation/perf_counter/builtin-top.c:23: + 15.20 - ffffffff804d8baa : dst_release$ ERROR: code indent should use tabs where possible #2412: FILE: Documentation/perf_counter/builtin-top.c:24: + 14.86 - ffffffff804cf5d8 : skb_release_head_state$ ERROR: code indent should use tabs where possible #2413: FILE: Documentation/perf_counter/builtin-top.c:25: + 14.00 - ffffffff802217d5 : read_hpet$ ERROR: code indent should use tabs where possible #2414: FILE: Documentation/perf_counter/builtin-top.c:26: + 12.00 - ffffffff804ffb7f : __ip_local_out$ ERROR: code indent should use tabs where possible #2415: FILE: Documentation/perf_counter/builtin-top.c:27: + 11.97 - ffffffff804fc0c8 : ip_local_deliver_finish$ ERROR: code indent should use tabs where possible #2416: FILE: Documentation/perf_counter/builtin-top.c:28: + 8.54 - ffffffff805001a3 : ip_queue_xmit$ ERROR: code indent should use tabs where possible #2422: FILE: Documentation/perf_counter/builtin-top.c:34: + It summarizes the counter events of all tasks (and child tasks),$ ERROR: code indent should use tabs where possible #2423: FILE: Documentation/perf_counter/builtin-top.c:35: + covering all CPUs that the command (or workload) executes on.$ ERROR: code indent should use tabs where possible #2424: FILE: Documentation/perf_counter/builtin-top.c:36: + It only counts the per-task events of the workload started,$ ERROR: code indent should use tabs where possible #2425: FILE: Documentation/perf_counter/builtin-top.c:37: + independent of how many other tasks run on those CPUs.$ ERROR: code indent should use tabs where possible #2433: FILE: Documentation/perf_counter/builtin-top.c:45: + 163516953 instructions$ ERROR: code indent should use tabs where possible #2434: FILE: Documentation/perf_counter/builtin-top.c:46: + 2295 cache-misses$ ERROR: code indent should use tabs where possible #2435: FILE: Documentation/perf_counter/builtin-top.c:47: + 2855182 branch-misses$ ERROR: code indent should use tabs where possible #2498: FILE: Documentation/perf_counter/builtin-top.c:110: + struct timespec ts; \$ ERROR: code indent should use tabs where possible #2499: FILE: Documentation/perf_counter/builtin-top.c:111: + \$ ERROR: code indent should use tabs where possible #2500: FILE: Documentation/perf_counter/builtin-top.c:112: + clock_gettime(CLOCK_MONOTONIC, &amp;ts); \$ ERROR: code indent should use tabs where possible #2501: FILE: Documentation/perf_counter/builtin-top.c:113: + ts.tv_sec * 1000000000ULL + ts.tv_nsec; \$ ERROR: spaces required around that &#39;:&#39; (ctx:WxO) #2512: FILE: Documentation/perf_counter/builtin-top.c:124: +#define rmb() asm volatile(&quot;lfence&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxO) #2512: FILE: Documentation/perf_counter/builtin-top.c:124: +#define rmb() asm volatile(&quot;lfence&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxW) #2512: FILE: Documentation/perf_counter/builtin-top.c:124: +#define rmb() asm volatile(&quot;lfence&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:WxO) #2513: FILE: Documentation/perf_counter/builtin-top.c:125: +#define cpu_relax() asm volatile(&quot;rep; nop&quot; ::: &quot;memory&quot;); ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxO) #2513: FILE: Documentation/perf_counter/builtin-top.c:125: +#define cpu_relax() asm volatile(&quot;rep; nop&quot; ::: &quot;memory&quot;); ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxW) #2513: FILE: Documentation/perf_counter/builtin-top.c:125: +#define cpu_relax() asm volatile(&quot;rep; nop&quot; ::: &quot;memory&quot;); ^ ERROR: spaces required around that &#39;:&#39; (ctx:WxO) #2518: FILE: Documentation/perf_counter/builtin-top.c:130: +#define rmb() asm volatile(&quot;lfence&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxO) #2518: FILE: Documentation/perf_counter/builtin-top.c:130: +#define rmb() asm volatile(&quot;lfence&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxW) #2518: FILE: Documentation/perf_counter/builtin-top.c:130: +#define rmb() asm volatile(&quot;lfence&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:WxO) #2519: FILE: Documentation/perf_counter/builtin-top.c:131: +#define cpu_relax() asm volatile(&quot;rep; nop&quot; ::: &quot;memory&quot;); ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxO) #2519: FILE: Documentation/perf_counter/builtin-top.c:131: +#define cpu_relax() asm volatile(&quot;rep; nop&quot; ::: &quot;memory&quot;); ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxW) #2519: FILE: Documentation/perf_counter/builtin-top.c:131: +#define cpu_relax() asm volatile(&quot;rep; nop&quot; ::: &quot;memory&quot;); ^ ERROR: spaces required around that &#39;:&#39; (ctx:WxO) #2524: FILE: Documentation/perf_counter/builtin-top.c:136: +#define rmb() asm volatile (&quot;sync&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxO) #2524: FILE: Documentation/perf_counter/builtin-top.c:136: +#define rmb() asm volatile (&quot;sync&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxW) #2524: FILE: Documentation/perf_counter/builtin-top.c:136: +#define rmb() asm volatile (&quot;sync&quot; ::: &quot;memory&quot;) ^ ERROR: spaces required around that &#39;:&#39; (ctx:WxO) #2525: FILE: Documentation/perf_counter/builtin-top.c:137: +#define cpu_relax() asm volatile (&quot;&quot; ::: &quot;memory&quot;); ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxO) #2525: FILE: Documentation/perf_counter/builtin-top.c:137: +#define cpu_relax() asm volatile (&quot;&quot; ::: &quot;memory&quot;); ^ ERROR: spaces required around that &#39;:&#39; (ctx:OxW) #2525: FILE: Documentation/perf_counter/builtin-top.c:137: +#define cpu_relax() asm volatile (&quot;&quot; ::: &quot;memory&quot;); ^ ERROR: code indent should use tabs where possible #2536: FILE: Documentation/perf_counter/builtin-top.c:148: + struct perf_counter_hw_event *hw_event_uptr __user,$ ERROR: code indent should use tabs where possible #2537: FILE: Documentation/perf_counter/builtin-top.c:149: + pid_t pid,$ ERROR: code indent should use tabs where possible #2538: FILE: Documentation/perf_counter/builtin-top.c:150: + int cpu,$ ERROR: code indent should use tabs where possible #2539: FILE: Documentation/perf_counter/builtin-top.c:151: + int group_fd,$ ERROR: code indent should use tabs where possible #2540: FILE: Documentation/perf_counter/builtin-top.c:152: + unsigned long flags)$ ERROR: code indent should use tabs where possible #2542: FILE: Documentation/perf_counter/builtin-top.c:154: + return syscall($ WARNING: line over 80 characters #2543: FILE: Documentation/perf_counter/builtin-top.c:155: + __NR_perf_counter_open, hw_event_uptr, pid, cpu, group_fd, flags); ERROR: code indent should use tabs where possible #2543: FILE: Documentation/perf_counter/builtin-top.c:155: + __NR_perf_counter_open, hw_event_uptr, pid, cpu, group_fd, flags);$ ERROR: do not initialise statics to 0 or NULL #2551: FILE: Documentation/perf_counter/builtin-top.c:163: +static int run_perfstat = 0; ERROR: do not initialise statics to 0 or NULL #2552: FILE: Documentation/perf_counter/builtin-top.c:164: +static int system_wide = 0; ERROR: do not initialise statics to 0 or NULL #2554: FILE: Documentation/perf_counter/builtin-top.c:166: +static int nr_counters = 0; ERROR: do not initialise statics to 0 or NULL #2574: FILE: Documentation/perf_counter/builtin-top.c:186: +static int nr_cpus = 0; ERROR: do not initialise statics to 0 or NULL #2576: FILE: Documentation/perf_counter/builtin-top.c:188: +static unsigned int realtime_prio = 0; ERROR: do not initialise statics to 0 or NULL #2577: FILE: Documentation/perf_counter/builtin-top.c:189: +static int group = 0; ERROR: do not initialise statics to 0 or NULL #2580: FILE: Documentation/perf_counter/builtin-top.c:192: +static int use_mmap = 0; ERROR: do not initialise statics to 0 or NULL #2581: FILE: Documentation/perf_counter/builtin-top.c:193: +static int use_munmap = 0; WARNING: line over 80 characters #2640: FILE: Documentation/perf_counter/builtin-top.c:252: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_CPU_CYCLES), &quot;cpu-cycles&quot;, }, WARNING: line over 80 characters #2641: FILE: Documentation/perf_counter/builtin-top.c:253: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_CPU_CYCLES), &quot;cycles&quot;, }, WARNING: line over 80 characters #2642: FILE: Documentation/perf_counter/builtin-top.c:254: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_INSTRUCTIONS), &quot;instructions&quot;, }, WARNING: line over 80 characters #2643: FILE: Documentation/perf_counter/builtin-top.c:255: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_CACHE_REFERENCES), &quot;cache-references&quot;, }, WARNING: line over 80 characters #2644: FILE: Documentation/perf_counter/builtin-top.c:256: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_CACHE_MISSES), &quot;cache-misses&quot;, }, WARNING: line over 80 characters #2645: FILE: Documentation/perf_counter/builtin-top.c:257: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_BRANCH_INSTRUCTIONS), &quot;branch-instructions&quot;, }, WARNING: line over 80 characters #2646: FILE: Documentation/perf_counter/builtin-top.c:258: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_BRANCH_INSTRUCTIONS), &quot;branches&quot;, }, WARNING: line over 80 characters #2647: FILE: Documentation/perf_counter/builtin-top.c:259: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_BRANCH_MISSES), &quot;branch-misses&quot;, }, WARNING: line over 80 characters #2648: FILE: Documentation/perf_counter/builtin-top.c:260: + {EID(PERF_TYPE_HARDWARE, PERF_COUNT_BUS_CYCLES), &quot;bus-cycles&quot;, }, WARNING: line over 80 characters #2650: FILE: Documentation/perf_counter/builtin-top.c:262: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_CPU_CLOCK), &quot;cpu-clock&quot;, }, WARNING: line over 80 characters #2651: FILE: Documentation/perf_counter/builtin-top.c:263: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_TASK_CLOCK), &quot;task-clock&quot;, }, WARNING: line over 80 characters #2652: FILE: Documentation/perf_counter/builtin-top.c:264: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_PAGE_FAULTS), &quot;page-faults&quot;, }, WARNING: line over 80 characters #2653: FILE: Documentation/perf_counter/builtin-top.c:265: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_PAGE_FAULTS), &quot;faults&quot;, }, WARNING: line over 80 characters #2654: FILE: Documentation/perf_counter/builtin-top.c:266: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_PAGE_FAULTS_MIN), &quot;minor-faults&quot;, }, WARNING: line over 80 characters #2655: FILE: Documentation/perf_counter/builtin-top.c:267: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_PAGE_FAULTS_MAJ), &quot;major-faults&quot;, }, WARNING: line over 80 characters #2656: FILE: Documentation/perf_counter/builtin-top.c:268: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_CONTEXT_SWITCHES), &quot;context-switches&quot;, }, WARNING: line over 80 characters #2657: FILE: Documentation/perf_counter/builtin-top.c:269: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_CONTEXT_SWITCHES), &quot;cs&quot;, }, WARNING: line over 80 characters #2658: FILE: Documentation/perf_counter/builtin-top.c:270: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_CPU_MIGRATIONS), &quot;cpu-migrations&quot;, }, WARNING: line over 80 characters #2659: FILE: Documentation/perf_counter/builtin-top.c:271: + {EID(PERF_TYPE_SOFTWARE, PERF_COUNT_CPU_MIGRATIONS), &quot;migrations&quot;, }, WARNING: line over 80 characters #2716: FILE: Documentation/perf_counter/builtin-top.c:328: + &quot;KernelTop Options (up to %d event types can be specified at once):\n\n&quot;, WARNING: line over 80 characters #2723: FILE: Documentation/perf_counter/builtin-top.c:335: + &quot; -a # system-wide collection (for perfstat)\n\n&quot; WARNING: line over 80 characters #2725: FILE: Documentation/perf_counter/builtin-top.c:337: + &quot; -C CPU --cpu=CPU # CPU (-1 for all) [default: -1]\n&quot; WARNING: line over 80 characters #2726: FILE: Documentation/perf_counter/builtin-top.c:338: + &quot; -p PID --pid=PID # PID of sampled task (-1 for all) [default: -1]\n\n&quot; WARNING: line over 80 characters #2728: FILE: Documentation/perf_counter/builtin-top.c:340: + &quot; -d delay --delay=&lt;seconds&gt; # sampling/display delay [default: 2]\n&quot; WARNING: line over 80 characters #2729: FILE: Documentation/perf_counter/builtin-top.c:341: + &quot; -f CNT --filter=CNT # min-event-count filter [default: 100]\n\n&quot; WARNING: line over 80 characters #2730: FILE: Documentation/perf_counter/builtin-top.c:342: + &quot; -r prio --realtime=&lt;prio&gt; # event acquisition runs with SCHED_FIFO policy\n&quot; WARNING: line over 80 characters #2731: FILE: Documentation/perf_counter/builtin-top.c:343: + &quot; -s symbol --symbol=&lt;symbol&gt; # function to be showed annotated one-shot\n&quot; WARNING: line over 80 characters #2732: FILE: Documentation/perf_counter/builtin-top.c:344: + &quot; -x path --vmlinux=&lt;path&gt; # the vmlinux binary, required for -s use\n&quot; WARNING: line over 80 characters #2734: FILE: Documentation/perf_counter/builtin-top.c:346: + &quot; -D --dump_symtab # dump symbol table to stderr on startup\n&quot; ERROR: space prohibited before that &#39;++&#39; (ctx:WxB) #2843: FILE: Documentation/perf_counter/builtin-top.c:455: + for (cpu = 0; cpu &lt; nr_cpus; cpu ++) { ^ WARNING: line over 80 characters #2844: FILE: Documentation/perf_counter/builtin-top.c:456: + fd[cpu][counter] = sys_perf_counter_open(&amp;hw_event, -1, cpu, -1, 0); WARNING: line over 80 characters #2846: FILE: Documentation/perf_counter/builtin-top.c:458: + printf(&quot;perfstat error: syscall returned with %d (%s)\n&quot;, WARNING: line over 80 characters #2847: FILE: Documentation/perf_counter/builtin-top.c:459: + fd[cpu][counter], strerror(errno)); WARNING: line over 80 characters #2857: FILE: Documentation/perf_counter/builtin-top.c:469: + printf(&quot;perfstat error: syscall returned with %d (%s)\n&quot;, ERROR: do not use assignment in if condition #2890: FILE: Documentation/perf_counter/builtin-top.c:502: + if ((pid = fork()) &lt; 0) ERROR: space prohibited before that &#39;++&#39; (ctx:WxB) #2917: FILE: Documentation/perf_counter/builtin-top.c:529: + for (cpu = 0; cpu &lt; nr_cpus; cpu ++) { ^ WARNING: line over 80 characters #2939: FILE: Documentation/perf_counter/builtin-top.c:551: + ((double)count[0] * count[1] / count[2] + 0.5); WARNING: line over 80 characters #2943: FILE: Documentation/perf_counter/builtin-top.c:555: + if (event_id[counter] == EID(PERF_TYPE_SOFTWARE, PERF_COUNT_CPU_CLOCK) || WARNING: line over 80 characters #2944: FILE: Documentation/perf_counter/builtin-top.c:556: + event_id[counter] == EID(PERF_TYPE_SOFTWARE, PERF_COUNT_TASK_CLOCK)) { ERROR: Invalid UTF-8, patch and commit message should be encoded in UTF-8 #3019: FILE: Documentation/perf_counter/builtin-top.c:631: +static const char CONSOLE_CLEAR[] = &quot;&#27;[H&#27;[2J&quot;; ^ WARNING: line over 80 characters #3041: FILE: Documentation/perf_counter/builtin-top.c:653: +&quot;------------------------------------------------------------------------------\n&quot;); ERROR: space prohibited after that open parenthesis &#39;(&#39; #3042: FILE: Documentation/perf_counter/builtin-top.c:654: + printf( &quot; KernelTop:%8.0f irqs/sec kernel:%4.1f%% [%s, &quot;, WARNING: line over 80 characters #3044: FILE: Documentation/perf_counter/builtin-top.c:656: + 100.0 - (100.0*((events_per_sec-kevents_per_sec)/events_per_sec)), ERROR: space prohibited after that open parenthesis &#39;(&#39; #3057: FILE: Documentation/perf_counter/builtin-top.c:669: + printf( &quot;], &quot;); WARNING: line over 80 characters #3073: FILE: Documentation/perf_counter/builtin-top.c:685: + printf(&quot;------------------------------------------------------------------------------\n\n&quot;); WARNING: line over 80 characters #3081: FILE: Documentation/perf_counter/builtin-top.c:693: + &quot; ______ ______ _____ ________________ _______________\n\n&quot; ERROR: code indent should use tabs where possible #3081: FILE: Documentation/perf_counter/builtin-top.c:693: +^I ^I &quot; ______ ______ _____ ________________ _______________\n\n&quot;$ WARNING: line over 80 characters #3089: FILE: Documentation/perf_counter/builtin-top.c:701: + pcnt = 100.0 - (100.0*((sum_kevents-tmp[i].count[0])/sum_kevents)); WARNING: line over 80 characters #3106: FILE: Documentation/perf_counter/builtin-top.c:718: + sym_table[i].count[count] = zero ? 0 : sym_table[i].count[count] * 7 / 8; ERROR: do not initialise statics to 0 or NULL #3134: FILE: Documentation/perf_counter/builtin-top.c:746: + static int filter_match = 0; WARNING: line over 80 characters #3167: FILE: Documentation/perf_counter/builtin-top.c:779: + if (!strncmp(&quot;init_module&quot;, sym, 11) || !strncmp(&quot;cleanup_module&quot;, sym, 14)) WARNING: line over 80 characters #3219: FILE: Documentation/perf_counter/builtin-top.c:831: + qsort(sym_table, sym_table_count, sizeof(sym_table[0]), compare_addr); ERROR: space required before the open parenthesis &#39;(&#39; #3227: FILE: Documentation/perf_counter/builtin-top.c:839: + } while(dups); WARNING: line over 80 characters #3237: FILE: Documentation/perf_counter/builtin-top.c:849: + printf(&quot;Could not open /proc/kallsyms - no CONFIG_KALLSYMS_ALL=y?\n&quot;); ERROR: spaces required around that &#39;=&#39; (ctx:VxV) #3258: FILE: Documentation/perf_counter/builtin-top.c:870: + for (count=0; count &lt; sym_table_count; count ++) { ^ ERROR: space prohibited before that &#39;++&#39; (ctx:WxB) #3258: FILE: Documentation/perf_counter/builtin-top.c:870: + for (count=0; count &lt; sym_table_count; count ++) { ^ WARNING: line over 80 characters #3285: FILE: Documentation/perf_counter/builtin-top.c:897: + sprintf(command, &quot;objdump --start-address=0x%016lx --stop-address=0x%016lx -dS %s&quot;, filter_start, filter_end, filename); ERROR: spaces required around that &#39;&gt;&#39; (ctx:VxV) #3314: FILE: Documentation/perf_counter/builtin-top.c:926: + if (strlen(src-&gt;line)&gt;8 &amp;&amp; src-&gt;line[8] == &#39;:&#39;) ^ ERROR: spaces required around that &#39;&gt;&#39; (ctx:VxV) #3316: FILE: Documentation/perf_counter/builtin-top.c:928: + if (strlen(src-&gt;line)&gt;8 &amp;&amp; src-&gt;line[16] == &#39;:&#39;) ^ ERROR: space prohibited before that &#39;++&#39; (ctx:WxO) #3383: FILE: Documentation/perf_counter/builtin-top.c:995: + line_queue_count ++; ^ ERROR: space prohibited before that &#39;--&#39; (ctx:WxO) #3391: FILE: Documentation/perf_counter/builtin-top.c:1003: + line_queue_count --; ^ ERROR: space prohibited after that open square bracket &#39;[&#39; #3419: FILE: Documentation/perf_counter/builtin-top.c:1031: + left = sym_table[ left_idx].addr; ERROR: space prohibited after that open square bracket &#39;[&#39; #3421: FILE: Documentation/perf_counter/builtin-top.c:1033: + right = sym_table[ right_idx].addr; WARNING: line over 80 characters #3424: FILE: Documentation/perf_counter/builtin-top.c:1036: + printf(&quot;%016lx...\n%016lx...\n%016lx\n&quot;, left, middle, right); ERROR: trailing statements should be on next line #3453: FILE: Documentation/perf_counter/builtin-top.c:1065: + else events--; WARNING: line over 80 characters #3500: FILE: Documentation/perf_counter/builtin-top.c:1112: + int c = getopt_long(argc, argv, &quot;+:ac:C:d:De:f:g:hln:m:p:r:s:Sx:zMU&quot;, ERROR: trailing statements should be on next line #3506: FILE: Documentation/perf_counter/builtin-top.c:1118: + case &#39;a&#39;: system_wide = 1; break; ERROR: trailing statements should be on next line #3507: FILE: Documentation/perf_counter/builtin-top.c:1119: + case &#39;c&#39;: default_interval = atoi(optarg); break; ERROR: trailing statements should be on next line #3516: FILE: Documentation/perf_counter/builtin-top.c:1128: + case &#39;d&#39;: delay_secs = atoi(optarg); break; ERROR: trailing statements should be on next line #3517: FILE: Documentation/perf_counter/builtin-top.c:1129: + case &#39;D&#39;: dump_symtab = 1; break; WARNING: line over 80 characters #3519: FILE: Documentation/perf_counter/builtin-top.c:1131: + case &#39;e&#39;: error = parse_events(optarg); break; ERROR: trailing statements should be on next line #3519: FILE: Documentation/perf_counter/builtin-top.c:1131: + case &#39;e&#39;: error = parse_events(optarg); break; ERROR: trailing statements should be on next line #3521: FILE: Documentation/perf_counter/builtin-top.c:1133: + case &#39;f&#39;: count_filter = atoi(optarg); break; ERROR: trailing statements should be on next line #3522: FILE: Documentation/perf_counter/builtin-top.c:1134: + case &#39;g&#39;: group = atoi(optarg); break; ERROR: trailing statements should be on next line #3523: FILE: Documentation/perf_counter/builtin-top.c:1135: + case &#39;h&#39;: display_help(); break; ERROR: trailing statements should be on next line #3524: FILE: Documentation/perf_counter/builtin-top.c:1136: + case &#39;l&#39;: scale = 1; break; ERROR: trailing statements should be on next line #3525: FILE: Documentation/perf_counter/builtin-top.c:1137: + case &#39;n&#39;: nmi = atoi(optarg); break; ERROR: trailing statements should be on next line #3534: FILE: Documentation/perf_counter/builtin-top.c:1146: + case &#39;r&#39;: realtime_prio = atoi(optarg); break; ERROR: trailing statements should be on next line #3535: FILE: Documentation/perf_counter/builtin-top.c:1147: + case &#39;s&#39;: sym_filter = strdup(optarg); break; ERROR: trailing statements should be on next line #3536: FILE: Documentation/perf_counter/builtin-top.c:1148: + case &#39;S&#39;: run_perfstat = 1; break; ERROR: trailing statements should be on next line #3537: FILE: Documentation/perf_counter/builtin-top.c:1149: + case &#39;x&#39;: vmlinux = strdup(optarg); break; ERROR: trailing statements should be on next line #3538: FILE: Documentation/perf_counter/builtin-top.c:1150: + case &#39;z&#39;: zero = 1; break; ERROR: trailing statements should be on next line #3539: FILE: Documentation/perf_counter/builtin-top.c:1151: + case &#39;m&#39;: mmap_pages = atoi(optarg); break; ERROR: trailing statements should be on next line #3540: FILE: Documentation/perf_counter/builtin-top.c:1152: + case &#39;M&#39;: use_mmap = 1; break; ERROR: trailing statements should be on next line #3541: FILE: Documentation/perf_counter/builtin-top.c:1153: + case &#39;U&#39;: use_munmap = 1; break; ERROR: trailing statements should be on next line #3542: FILE: Documentation/perf_counter/builtin-top.c:1154: + default: error = 1; break; WARNING: do not add new typedefs #3636: FILE: Documentation/perf_counter/builtin-top.c:1248: + typedef union event_union { WARNING: line over 80 characters #3658: FILE: Documentation/perf_counter/builtin-top.c:1270: + cpy = min(md-&gt;mask + 1 - (offset &amp; md-&gt;mask), len); ERROR: switch and case should be at the same indent #3674: FILE: Documentation/perf_counter/builtin-top.c:1286: + switch (event-&gt;header.type) { + case PERF_EVENT_MMAP: + case PERF_EVENT_MUNMAP: WARNING: %Ld/%Lu are not-standard C, use %lld/%llu #3677: FILE: Documentation/perf_counter/builtin-top.c:1289: + printf(&quot;%s: %Lu %Lu %Lu %s\n&quot;, WARNING: line over 80 characters #3678: FILE: Documentation/perf_counter/builtin-top.c:1290: + event-&gt;header.type == PERF_EVENT_MMAP WARNING: line over 80 characters #3731: FILE: Documentation/perf_counter/builtin-top.c:1343: + hw_event.record_type = PERF_RECORD_IP | PERF_RECORD_TID; WARNING: line over 80 characters #3736: FILE: Documentation/perf_counter/builtin-top.c:1348: + fd[i][counter] = sys_perf_counter_open(&amp;hw_event, tid, cpu, group_fd, 0); WARNING: line over 80 characters #3739: FILE: Documentation/perf_counter/builtin-top.c:1351: + printf(&quot;kerneltop error: syscall returned with %d (%s)\n&quot;, WARNING: line over 80 characters #3761: FILE: Documentation/perf_counter/builtin-top.c:1373: + mmap_array[i][counter].base = mmap(NULL, (mmap_pages+1)*page_size, WARNING: line over 80 characters #3762: FILE: Documentation/perf_counter/builtin-top.c:1374: + PROT_READ, MAP_SHARED, fd[i][counter], 0); WARNING: line over 80 characters #3764: FILE: Documentation/perf_counter/builtin-top.c:1376: + printf(&quot;kerneltop error: failed to mmap with %d (%s)\n&quot;, WARNING: line over 80 characters #3861: FILE: Documentation/perf_counter/cache.h:32: +extern int perf_config_set_multivar(const char *, const char *, const char *, int); WARNING: line over 80 characters #3864: FILE: Documentation/perf_counter/cache.h:35: +extern int check_repository_format_version(const char *var, const char *value, void *cb); WARNING: line over 80 characters #3885: FILE: Documentation/perf_counter/cache.h:56: +extern int write_or_whine(int fd, const void *buf, size_t count, const char *msg); WARNING: line over 80 characters #3886: FILE: Documentation/perf_counter/cache.h:57: +extern int write_or_whine_pipe(int fd, const void *buf, size_t count, const char *msg); ERROR: space required before the open parenthesis &#39;(&#39; #3919: FILE: Documentation/perf_counter/cache.h:90: + } while(0) ERROR: do not initialise externals to 0 or NULL #3962: FILE: Documentation/perf_counter/config.c:20: +const char *config_exclusive_filename = NULL; ERROR: do not use assignment in if condition #3970: FILE: Documentation/perf_counter/config.c:28: + if ((f = config_file) != NULL) { ERROR: else should follow close brace &#39;}&#39; #4209: FILE: Documentation/perf_counter/config.c:267: + } + else if (!strcasecmp(end, &quot;m&quot;)) { ERROR: else should follow close brace &#39;}&#39; #4213: FILE: Documentation/perf_counter/config.c:271: + } + else if (!strcasecmp(end, &quot;g&quot;)) { WARNING: line over 80 characters #4277: FILE: Documentation/perf_counter/config.c:335: + if (!strcasecmp(value, &quot;true&quot;) || !strcasecmp(value, &quot;yes&quot;) || !strcasecmp(value, &quot;on&quot;)) WARNING: line over 80 characters #4279: FILE: Documentation/perf_counter/config.c:337: + if (!strcasecmp(value, &quot;false&quot;) || !strcasecmp(value, &quot;no&quot;) || !strcasecmp(value, &quot;off&quot;)) WARNING: line over 80 characters #4364: FILE: Documentation/perf_counter/config.c:422: + return perf_config_from_file(fn, config_exclusive_filename, data); ERROR: &quot;foo* bar&quot; should be &quot;foo *bar&quot; #4400: FILE: Documentation/perf_counter/config.c:458: + char* key; ERROR: &quot;foo* bar&quot; should be &quot;foo *bar&quot; #4402: FILE: Documentation/perf_counter/config.c:460: + regex_t* value_regex; ERROR: &quot;foo* bar&quot; should be &quot;foo *bar&quot; #4409: FILE: Documentation/perf_counter/config.c:467: +static int matches(const char* key, const char* value) ERROR: &quot;foo* bar&quot; should be &quot;foo *bar&quot; #4417: FILE: Documentation/perf_counter/config.c:475: +static int store_aux(const char* key, const char* value, void *cb) WARNING: line over 80 characters #4471: FILE: Documentation/perf_counter/config.c:529: + store.offset[store.seen] = ftell(config_file); ERROR: &quot;foo* bar&quot; should be &quot;foo *bar&quot; #4486: FILE: Documentation/perf_counter/config.c:544: +static int store_write_section(int fd, const char* key) ERROR: &quot;foo* bar&quot; should be &quot;foo *bar&quot; #4511: FILE: Documentation/perf_counter/config.c:569: +static int store_write_pair(int fd, const char* key, const char* value) ERROR: &quot;foo* bar&quot; should be &quot;foo *bar&quot; #4559: FILE: Documentation/perf_counter/config.c:617: +static ssize_t find_beginning_of_line(const char* contents, size_t size, ERROR: &quot;foo* bar&quot; should be &quot;foo *bar&quot; #4560: FILE: Documentation/perf_counter/config.c:618: + size_t offset_, int* found_bracket) ERROR: switch and case should be at the same indent #4568: FILE: Documentation/perf_counter/config.c:626: + switch (contents[offset]) { + case &#39;=&#39;: equal_offset = offset; break; + case &#39;]&#39;: bracket_offset = offset; break; ERROR: trailing statements should be on next line #4569: FILE: Documentation/perf_counter/config.c:627: + case &#39;=&#39;: equal_offset = offset; break; ERROR: trailing statements should be on next line #4570: FILE: Documentation/perf_counter/config.c:628: + case &#39;]&#39;: bracket_offset = offset; break; ERROR: &quot;foo* bar&quot; should be &quot;foo *bar&quot; #4585: FILE: Documentation/perf_counter/config.c:643: +int perf_config_set(const char* key, const char* value) ERROR: &quot;foo* bar&quot; should be &quot;foo *bar&quot; #4613: FILE: Documentation/perf_counter/config.c:671: +int perf_config_set_multivar(const char* key, const char* value, ERROR: &quot;foo* bar&quot; should be &quot;foo *bar&quot; #4614: FILE: Documentation/perf_counter/config.c:672: + const char* value_regex, int multi_replace) ERROR: &quot;foo* bar&quot; should be &quot;foo *bar&quot; #4619: FILE: Documentation/perf_counter/config.c:677: + char* config_filename; ERROR: &quot;foo* bar&quot; should be &quot;foo *bar&quot; #4620: FILE: Documentation/perf_counter/config.c:678: + const char* last_dot = strrchr(key, &#39;.&#39;); WARNING: line over 80 characters #4652: FILE: Documentation/perf_counter/config.c:710: + if (!iskeychar(c) || (i == store.baselen+1 &amp;&amp; !isalpha(c))) { ERROR: space prohibited after that open parenthesis &#39;(&#39; #4673: FILE: Documentation/perf_counter/config.c:731: + if ( in_fd &lt; 0 ) { ERROR: space prohibited before that close parenthesis &#39;)&#39; #4673: FILE: Documentation/perf_counter/config.c:731: + if ( in_fd &lt; 0 ) { ERROR: space prohibited after that open parenthesis &#39;(&#39; #4676: FILE: Documentation/perf_counter/config.c:734: + if ( ENOENT != errno ) { ERROR: space prohibited before that close parenthesis &#39;)&#39; #4676: FILE: Documentation/perf_counter/config.c:734: + if ( ENOENT != errno ) { ERROR: &quot;(foo*)&quot; should be &quot;(foo *)&quot; #4688: FILE: Documentation/perf_counter/config.c:746: + store.key = (char*)key; ERROR: &quot;foo* bar&quot; should be &quot;foo *bar&quot; #4694: FILE: Documentation/perf_counter/config.c:752: + char* contents; ERROR: &quot;(foo*)&quot; should be &quot;(foo *)&quot; #4707: FILE: Documentation/perf_counter/config.c:765: + store.value_regex = (regex_t*)malloc(sizeof(regex_t)); WARNING: space prohibited between function name and open parenthesis &#39;(&#39; #4817: FILE: Documentation/perf_counter/config.c:875: +static int section_name_match (const char *buf, const char *name) ERROR: do not use assignment in if condition #4861: FILE: Documentation/perf_counter/config.c:919: + if (!(config_file = fopen(config_filename, &quot;rb&quot;))) { WARNING: space prohibited between function name and open parenthesis &#39;(&#39; #4873: FILE: Documentation/perf_counter/config.c:931: + if (section_name_match (&amp;buf[i+1], old_name)) { WARNING: braces {} are not necessary for single statement blocks #4880: FILE: Documentation/perf_counter/config.c:938: + if (!store_write_section(out_fd, new_name)) { + goto out; + } WARNING: braces {} are not necessary for single statement blocks #4890: FILE: Documentation/perf_counter/config.c:948: + if (write_in_full(out_fd, buf, length) != length) { + goto out; + } WARNING: externs should be avoided in .c files #4952: FILE: Documentation/perf_counter/exec_cmd.c:6: +extern char **environ; ERROR: do not use assignment in if condition #4972: FILE: Documentation/perf_counter/exec_cmd.c:26: + if (!prefix &amp;&amp; WARNING: braces {} are not necessary for single statement blocks #5026: FILE: Documentation/perf_counter/exec_cmd.c:80: + if (env &amp;&amp; *env) { + return env; + } ERROR: open brace &#39;{&#39; following function declarations go on the next line #5079: FILE: Documentation/perf_counter/exec_cmd.c:133: +int execv_perf_cmd(const char **argv) { ERROR: space required after that &#39;,&#39; (ctx:VxV) #5090: FILE: Documentation/perf_counter/exec_cmd.c:144: +int execl_perf_cmd(const char *cmd,...) ^ ERROR: do not use assignment in if condition #5179: FILE: Documentation/perf_counter/help.c:13: + if (col_string &amp;&amp; (n_cols = atoi(col_string)) &gt; 0) ERROR: do not use assignment in if condition #5371: FILE: Documentation/perf_counter/help.c:205: + if ((colon = strchr(path, PATH_SEP))) ERROR: space required after that &#39;,&#39; (ctx:VxV) #5436: FILE: Documentation/perf_counter/help.c:270: + autocorrect = perf_config_int(var,value); ^ WARNING: space prohibited between function name and open parenthesis &#39;(&#39; #5493: FILE: Documentation/perf_counter/help.c:327: + die (&quot;Uh oh. Your system reports no Git commands at all.&quot;); WARNING: line over 80 characters #5515: FILE: Documentation/perf_counter/help.c:349: + fprintf(stderr, &quot;perf: &#39;%s&#39; is not a perf-command. See &#39;perf --help&#39;.\n&quot;, cmd); ERROR: spaces required around that &#39;:&#39; (ctx:VxW) #5519: FILE: Documentation/perf_counter/help.c:353: + n &lt; 2 ? &quot;this&quot;: &quot;one of these&quot;); ^ ERROR: space required before the open parenthesis &#39;(&#39; #5553: FILE: Documentation/perf_counter/help.h:15: + while(num--) WARNING: line over 80 characters #5763: FILE: Documentation/perf_counter/parse-options.c:86: + return get_arg(p, opt, flags, (const char **)opt-&gt;value); WARNING: line over 80 characters #5790: FILE: Documentation/perf_counter/parse-options.c:113: + return opterror(opt,