All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH drivers/perf 0/4] Fix ERRORs reported by checkpatch
@ 2021-03-25  7:16 Tian Tao
  2021-03-25  7:16 ` [PATCH drivers/perf 1/4] drivers/perf: fixing coding style issues Tian Tao
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Tian Tao @ 2021-03-25  7:16 UTC (permalink / raw)
  To: will, mark.rutland; +Cc: linux-arm-kernel

Fix ERRORs that need to care which reported by checkpatch. 

Tian Tao (4):
  drivers/perf: fixing coding style issues
  drivers/perf: fixing coding style issues
  drivers/perf: fixing coding style issues
  drivers/perf: fixing coding style issues

 drivers/perf/arm-cci.c          |  4 ++--
 drivers/perf/arm-cmn.c          |  2 +-
 drivers/perf/arm_pmu.c          |  2 +-
 drivers/perf/arm_pmu_platform.c | 10 ++++++----
 4 files changed, 10 insertions(+), 8 deletions(-)

-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH drivers/perf 1/4] drivers/perf: fixing coding style issues
  2021-03-25  7:16 [PATCH drivers/perf 0/4] Fix ERRORs reported by checkpatch Tian Tao
@ 2021-03-25  7:16 ` Tian Tao
  2021-03-25  7:16 ` [PATCH drivers/perf 2/4] " Tian Tao
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Tian Tao @ 2021-03-25  7:16 UTC (permalink / raw)
  To: will, mark.rutland; +Cc: linux-arm-kernel

  no functional changes.

  Fix checkpatch error:
  ERROR: need consistent spacing around '-' (ctx:WxV)
  #40: FILE: arm-cci.c:40:
  +#define CCI_PMU_CNTR_MASK	    ((1ULL << 32) -1)

  ERROR: space required before the open parenthesis '('
  #809: FILE: arm-cci.c:809:
  + for(idx = 0; idx <= CCI_PMU_CNTR_LAST(cci_pmu); idx++)

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Signed-off-by: Junhao He <hejunhao2@hisilicon.com>
Signed-off-by: Qi Liu <liuqi115@huawei.com>
---
 drivers/perf/arm-cci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/perf/arm-cci.c b/drivers/perf/arm-cci.c
index f81e2ec..18ee364 100644
--- a/drivers/perf/arm-cci.c
+++ b/drivers/perf/arm-cci.c
@@ -37,7 +37,7 @@
 
 #define CCI_PMU_CNTR_SIZE(model)	((model)->cntr_size)
 #define CCI_PMU_CNTR_BASE(model, idx)	((idx) * CCI_PMU_CNTR_SIZE(model))
-#define CCI_PMU_CNTR_MASK		((1ULL << 32) -1)
+#define CCI_PMU_CNTR_MASK		((1ULL << 32) - 1)
 #define CCI_PMU_CNTR_LAST(cci_pmu)	(cci_pmu->num_cntrs - 1)
 
 #define CCI_PMU_MAX_HW_CNTRS(model) \
@@ -806,7 +806,7 @@ static int pmu_get_event_idx(struct cci_pmu_hw_events *hw, struct perf_event *ev
 		return cci_pmu->model->get_event_idx(cci_pmu, hw, cci_event);
 
 	/* Generic code to find an unused idx from the mask */
-	for(idx = 0; idx <= CCI_PMU_CNTR_LAST(cci_pmu); idx++)
+	for (idx = 0; idx <= CCI_PMU_CNTR_LAST(cci_pmu); idx++)
 		if (!test_and_set_bit(idx, hw->used_mask))
 			return idx;
 
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH drivers/perf 2/4] drivers/perf: fixing coding style issues
  2021-03-25  7:16 [PATCH drivers/perf 0/4] Fix ERRORs reported by checkpatch Tian Tao
  2021-03-25  7:16 ` [PATCH drivers/perf 1/4] drivers/perf: fixing coding style issues Tian Tao
@ 2021-03-25  7:16 ` Tian Tao
  2021-03-25  7:16 ` [PATCH drivers/perf 3/4] " Tian Tao
  2021-03-25  7:16 ` [PATCH drivers/perf 4/4] " Tian Tao
  3 siblings, 0 replies; 8+ messages in thread
From: Tian Tao @ 2021-03-25  7:16 UTC (permalink / raw)
  To: will, mark.rutland; +Cc: linux-arm-kernel

  no functional changes.

  Fix checkpatch error:
  ERROR: space required after that ',' (ctx:VxV)
  #34: FILE: arm-cmn.c:34:
  +#define CMN_CHILD_NODE_ADDR	    GENMASK(27,0)

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Signed-off-by: Junhao He <hejunhao2@hisilicon.com>
Signed-off-by: Qi Liu <liuqi115@huawei.com>
---
 drivers/perf/arm-cmn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
index 1328159f..c30ea59 100644
--- a/drivers/perf/arm-cmn.c
+++ b/drivers/perf/arm-cmn.c
@@ -31,7 +31,7 @@
 #define CMN_CI_CHILD_COUNT		GENMASK_ULL(15, 0)
 #define CMN_CI_CHILD_PTR_OFFSET		GENMASK_ULL(31, 16)
 
-#define CMN_CHILD_NODE_ADDR		GENMASK(27,0)
+#define CMN_CHILD_NODE_ADDR		GENMASK(27, 0)
 #define CMN_CHILD_NODE_EXTERNAL		BIT(31)
 
 #define CMN_ADDR_NODE_PTR		GENMASK(27, 14)
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH drivers/perf 3/4] drivers/perf: fixing coding style issues
  2021-03-25  7:16 [PATCH drivers/perf 0/4] Fix ERRORs reported by checkpatch Tian Tao
  2021-03-25  7:16 ` [PATCH drivers/perf 1/4] drivers/perf: fixing coding style issues Tian Tao
  2021-03-25  7:16 ` [PATCH drivers/perf 2/4] " Tian Tao
@ 2021-03-25  7:16 ` Tian Tao
  2021-03-25  7:16 ` [PATCH drivers/perf 4/4] " Tian Tao
  3 siblings, 0 replies; 8+ messages in thread
From: Tian Tao @ 2021-03-25  7:16 UTC (permalink / raw)
  To: will, mark.rutland; +Cc: linux-arm-kernel

  no functional changes.

  Fix checkpatch error:
  ERROR: spaces required around that '=' (ctx:VxW)
  #700: FILE: arm_pmu.c:700:
  +	    has_nmi= true;
	           ^
Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Signed-off-by: Junhao He <hejunhao2@hisilicon.com>
Signed-off-by: Qi Liu <liuqi115@huawei.com>
---
 drivers/perf/arm_pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
index 2d10d84..c6dab8d8 100644
--- a/drivers/perf/arm_pmu.c
+++ b/drivers/perf/arm_pmu.c
@@ -697,7 +697,7 @@ int armpmu_request_irq(int irq, int cpu)
 						 &cpu_armpmu);
 			irq_ops = &percpu_pmuirq_ops;
 		} else {
-			has_nmi= true;
+			has_nmi = true;
 			irq_ops = &percpu_pmunmi_ops;
 		}
 	} else {
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH drivers/perf 4/4] drivers/perf: fixing coding style issues
  2021-03-25  7:16 [PATCH drivers/perf 0/4] Fix ERRORs reported by checkpatch Tian Tao
                   ` (2 preceding siblings ...)
  2021-03-25  7:16 ` [PATCH drivers/perf 3/4] " Tian Tao
@ 2021-03-25  7:16 ` Tian Tao
  2021-03-25 12:30   ` Robin Murphy
  3 siblings, 1 reply; 8+ messages in thread
From: Tian Tao @ 2021-03-25  7:16 UTC (permalink / raw)
  To: will, mark.rutland; +Cc: linux-arm-kernel

  no functional changes.

  Fix checkpatch error:
  ERROR: do not use assignment in if condition
  #210: FILE: arm_pmu_platform.c:210:
  + if (node && (of_id = of_match_node(of_table, pdev->dev.of_node))) {

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Signed-off-by: Junhao He <hejunhao2@hisilicon.com>
Signed-off-by: Qi Liu <liuqi115@huawei.com>
---
 drivers/perf/arm_pmu_platform.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/perf/arm_pmu_platform.c b/drivers/perf/arm_pmu_platform.c
index 933bd84..11b47c6 100644
--- a/drivers/perf/arm_pmu_platform.c
+++ b/drivers/perf/arm_pmu_platform.c
@@ -191,7 +191,7 @@ int arm_pmu_device_probe(struct platform_device *pdev,
 			 const struct of_device_id *of_table,
 			 const struct pmu_probe_info *probe_table)
 {
-	const struct of_device_id *of_id;
+	const struct of_device_id *of_id = NULL;
 	armpmu_init_fn init_fn;
 	struct device_node *node = pdev->dev.of_node;
 	struct arm_pmu *pmu;
@@ -207,11 +207,13 @@ int arm_pmu_device_probe(struct platform_device *pdev,
 	if (ret)
 		goto out_free;
 
-	if (node && (of_id = of_match_node(of_table, pdev->dev.of_node))) {
+	if (node)
+		of_id = of_match_node(of_table, node);
+
+	if (of_id) {
 		init_fn = of_id->data;
 
-		pmu->secure_access = of_property_read_bool(pdev->dev.of_node,
-							   "secure-reg-access");
+		pmu->secure_access = of_property_read_bool(node, "secure-reg-access");
 
 		/* arm64 systems boot only as non-secure */
 		if (IS_ENABLED(CONFIG_ARM64) && pmu->secure_access) {
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH drivers/perf 4/4] drivers/perf: fixing coding style issues
  2021-03-25  7:16 ` [PATCH drivers/perf 4/4] " Tian Tao
@ 2021-03-25 12:30   ` Robin Murphy
  2021-03-26  0:49     ` tiantao (H)
  0 siblings, 1 reply; 8+ messages in thread
From: Robin Murphy @ 2021-03-25 12:30 UTC (permalink / raw)
  To: Tian Tao, will, mark.rutland; +Cc: linux-arm-kernel

On 2021-03-25 07:16, Tian Tao wrote:
>    no functional changes.
> 
>    Fix checkpatch error:
>    ERROR: do not use assignment in if condition
>    #210: FILE: arm_pmu_platform.c:210:
>    + if (node && (of_id = of_match_node(of_table, pdev->dev.of_node))) {
> 
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
> Signed-off-by: Junhao He <hejunhao2@hisilicon.com>
> Signed-off-by: Qi Liu <liuqi115@huawei.com>
> ---
>   drivers/perf/arm_pmu_platform.c | 10 ++++++----
>   1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/perf/arm_pmu_platform.c b/drivers/perf/arm_pmu_platform.c
> index 933bd84..11b47c6 100644
> --- a/drivers/perf/arm_pmu_platform.c
> +++ b/drivers/perf/arm_pmu_platform.c
> @@ -191,7 +191,7 @@ int arm_pmu_device_probe(struct platform_device *pdev,
>   			 const struct of_device_id *of_table,
>   			 const struct pmu_probe_info *probe_table)
>   {
> -	const struct of_device_id *of_id;
> +	const struct of_device_id *of_id = NULL;
>   	armpmu_init_fn init_fn;
>   	struct device_node *node = pdev->dev.of_node;
>   	struct arm_pmu *pmu;
> @@ -207,11 +207,13 @@ int arm_pmu_device_probe(struct platform_device *pdev,
>   	if (ret)
>   		goto out_free;
>   
> -	if (node && (of_id = of_match_node(of_table, pdev->dev.of_node))) {
> +	if (node)
> +		of_id = of_match_node(of_table, node);

Looks like you could probably refactor the whole thing to use 
of_device_get_match_data() and make it even cleaner.

Robin.

> +
> +	if (of_id) {
>   		init_fn = of_id->data;
>   
> -		pmu->secure_access = of_property_read_bool(pdev->dev.of_node,
> -							   "secure-reg-access");
> +		pmu->secure_access = of_property_read_bool(node, "secure-reg-access");
>   
>   		/* arm64 systems boot only as non-secure */
>   		if (IS_ENABLED(CONFIG_ARM64) && pmu->secure_access) {
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH drivers/perf 4/4] drivers/perf: fixing coding style issues
  2021-03-25 12:30   ` Robin Murphy
@ 2021-03-26  0:49     ` tiantao (H)
  2021-03-29 14:30       ` Mark Rutland
  0 siblings, 1 reply; 8+ messages in thread
From: tiantao (H) @ 2021-03-26  0:49 UTC (permalink / raw)
  To: Robin Murphy, Tian Tao, will, mark.rutland; +Cc: linux-arm-kernel


在 2021/3/25 20:30, Robin Murphy 写道:
> On 2021-03-25 07:16, Tian Tao wrote:
>>    no functional changes.
>>
>>    Fix checkpatch error:
>>    ERROR: do not use assignment in if condition
>>    #210: FILE: arm_pmu_platform.c:210:
>>    + if (node && (of_id = of_match_node(of_table, pdev->dev.of_node))) {
>>
>> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
>> Signed-off-by: Junhao He <hejunhao2@hisilicon.com>
>> Signed-off-by: Qi Liu <liuqi115@huawei.com>
>> ---
>>   drivers/perf/arm_pmu_platform.c | 10 ++++++----
>>   1 file changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/perf/arm_pmu_platform.c 
>> b/drivers/perf/arm_pmu_platform.c
>> index 933bd84..11b47c6 100644
>> --- a/drivers/perf/arm_pmu_platform.c
>> +++ b/drivers/perf/arm_pmu_platform.c
>> @@ -191,7 +191,7 @@ int arm_pmu_device_probe(struct platform_device 
>> *pdev,
>>                const struct of_device_id *of_table,
>>                const struct pmu_probe_info *probe_table)
>>   {
>> -    const struct of_device_id *of_id;
>> +    const struct of_device_id *of_id = NULL;
>>       armpmu_init_fn init_fn;
>>       struct device_node *node = pdev->dev.of_node;
>>       struct arm_pmu *pmu;
>> @@ -207,11 +207,13 @@ int arm_pmu_device_probe(struct platform_device 
>> *pdev,
>>       if (ret)
>>           goto out_free;
>>   -    if (node && (of_id = of_match_node(of_table, 
>> pdev->dev.of_node))) {
>> +    if (node)
>> +        of_id = of_match_node(of_table, node);
>
> Looks like you could probably refactor the whole thing to use 
> of_device_get_match_data() and make it even cleaner.
Thanks for your suggestion, I'm waiting for the other three patch review 
suggestions, after that I'm deciding whether to send a patchset or send 
a patch alone to fix this problem.
>
> Robin.
>
>> +
>> +    if (of_id) {
>>           init_fn = of_id->data;
>>   -        pmu->secure_access = of_property_read_bool(pdev->dev.of_node,
>> -                               "secure-reg-access");
>> +        pmu->secure_access = of_property_read_bool(node, 
>> "secure-reg-access");
>>             /* arm64 systems boot only as non-secure */
>>           if (IS_ENABLED(CONFIG_ARM64) && pmu->secure_access) {
>>
> .
>


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH drivers/perf 4/4] drivers/perf: fixing coding style issues
  2021-03-26  0:49     ` tiantao (H)
@ 2021-03-29 14:30       ` Mark Rutland
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Rutland @ 2021-03-29 14:30 UTC (permalink / raw)
  To: tiantao (H), will; +Cc: Robin Murphy, Tian Tao, linux-arm-kernel

On Fri, Mar 26, 2021 at 08:49:33AM +0800, tiantao (H) wrote:
> 
> 在 2021/3/25 20:30, Robin Murphy 写道:
> > On 2021-03-25 07:16, Tian Tao wrote:
> > >    no functional changes.
> > > 
> > >    Fix checkpatch error:
> > >    ERROR: do not use assignment in if condition
> > >    #210: FILE: arm_pmu_platform.c:210:
> > >    + if (node && (of_id = of_match_node(of_table, pdev->dev.of_node))) {
> > > 
> > > Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
> > > Signed-off-by: Junhao He <hejunhao2@hisilicon.com>
> > > Signed-off-by: Qi Liu <liuqi115@huawei.com>
> > > ---
> > >   drivers/perf/arm_pmu_platform.c | 10 ++++++----
> > >   1 file changed, 6 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/drivers/perf/arm_pmu_platform.c
> > > b/drivers/perf/arm_pmu_platform.c
> > > index 933bd84..11b47c6 100644
> > > --- a/drivers/perf/arm_pmu_platform.c
> > > +++ b/drivers/perf/arm_pmu_platform.c
> > > @@ -191,7 +191,7 @@ int arm_pmu_device_probe(struct platform_device
> > > *pdev,
> > >                const struct of_device_id *of_table,
> > >                const struct pmu_probe_info *probe_table)
> > >   {
> > > -    const struct of_device_id *of_id;
> > > +    const struct of_device_id *of_id = NULL;
> > >       armpmu_init_fn init_fn;
> > >       struct device_node *node = pdev->dev.of_node;
> > >       struct arm_pmu *pmu;
> > > @@ -207,11 +207,13 @@ int arm_pmu_device_probe(struct
> > > platform_device *pdev,
> > >       if (ret)
> > >           goto out_free;
> > >   -    if (node && (of_id = of_match_node(of_table,
> > > pdev->dev.of_node))) {
> > > +    if (node)
> > > +        of_id = of_match_node(of_table, node);
> > 
> > Looks like you could probably refactor the whole thing to use
> > of_device_get_match_data() and make it even cleaner.
> Thanks for your suggestion, I'm waiting for the other three patch review
> suggestions, after that I'm deciding whether to send a patchset or send a
> patch alone to fix this problem.

FWIW, patches 1-3 all look sound to me given that they're trivial
whitespace fixes. So for patches 1-3:

Acked-by: Mark Rutland <mark.rutland@arm.com>

I'll leave it to Will to decide whether to pick those now or to wait for
a respin of the whole series.

Thanks,
Mark.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-03-29 22:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-25  7:16 [PATCH drivers/perf 0/4] Fix ERRORs reported by checkpatch Tian Tao
2021-03-25  7:16 ` [PATCH drivers/perf 1/4] drivers/perf: fixing coding style issues Tian Tao
2021-03-25  7:16 ` [PATCH drivers/perf 2/4] " Tian Tao
2021-03-25  7:16 ` [PATCH drivers/perf 3/4] " Tian Tao
2021-03-25  7:16 ` [PATCH drivers/perf 4/4] " Tian Tao
2021-03-25 12:30   ` Robin Murphy
2021-03-26  0:49     ` tiantao (H)
2021-03-29 14:30       ` Mark Rutland

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.