2020-05-08 04:06:40

by Kaige Li

[permalink] [raw]
Subject: [PATCH] perf/core: Do not initialise statics to 0 and add space before '{'

Fix the following checkpatch errors:

ERROR: do not initialise statics to 0
#10616: FILE: ./kernel/events/core.c:10616:
+ static int hw_context_taken = 0;

ERROR: space required before the open brace '{'
#11070: FILE: ./kernel/events/core.c:11070:
+ } else if (is_write_backward(event)){

Signed-off-by: Kaige Li <[email protected]>
---
kernel/events/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 80cf996..8d47d30 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -10618,7 +10618,7 @@ int perf_pmu_register(struct pmu *pmu, const char *name, int type)

skip_type:
if (pmu->task_ctx_nr == perf_hw_context) {
- static int hw_context_taken = 0;
+ static int hw_context_taken;

/*
* Other than systems with heterogeneous CPUs, it never makes
@@ -11072,7 +11072,7 @@ perf_event_alloc(struct perf_event_attr *attr, int cpu,
if (overflow_handler) {
event->overflow_handler = overflow_handler;
event->overflow_handler_context = context;
- } else if (is_write_backward(event)){
+ } else if (is_write_backward(event)) {
event->overflow_handler = perf_event_output_backward;
event->overflow_handler_context = NULL;
} else {
--
2.1.0


2020-05-08 08:28:24

by Peter Zijlstra

[permalink] [raw]
Subject: Re: [PATCH] perf/core: Do not initialise statics to 0 and add space before '{'

On Fri, May 08, 2020 at 12:04:23PM +0800, Kaige Li wrote:
> Fix the following checkpatch errors:
>
> ERROR: do not initialise statics to 0
> #10616: FILE: ./kernel/events/core.c:10616:
> + static int hw_context_taken = 0;
>
> ERROR: space required before the open brace '{'
> #11070: FILE: ./kernel/events/core.c:11070:
> + } else if (is_write_backward(event)){

Checkpatch can sod off. Please don't ever submit pure checkpatch patches
to anything I maintain.

2020-05-08 09:42:35

by Kaige Li

[permalink] [raw]
Subject: Re: [PATCH] perf/core: Do not initialise statics to 0 and add space before '{'


Ok, I will pay attation. thank you.


On 05/08/2020 04:25 PM, Peter Zijlstra wrote:
> Checkpatch can sod off. Please don't ever submit pure checkpatch patches
> to anything I maintain