From: "tiantao (H)" <tiantao6@huawei.com>
To: Robin Murphy <robin.murphy@arm.com>,
Tian Tao <tiantao6@hisilicon.com>, <will@kernel.org>,
<mark.rutland@arm.com>
Cc: <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH drivers/perf 4/4] drivers/perf: fixing coding style issues
Date: Fri, 26 Mar 2021 08:49:33 +0800 [thread overview]
Message-ID: <14371ed6-d3e0-30d9-c612-d5872381c13a@huawei.com> (raw)
In-Reply-To: <7d90b0dc-15db-c967-4ba9-3da728d6133b@arm.com>
在 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
next prev parent reply other threads:[~2021-03-26 0:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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) [this message]
2021-03-29 14:30 ` Mark Rutland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=14371ed6-d3e0-30d9-c612-d5872381c13a@huawei.com \
--to=tiantao6@huawei.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=robin.murphy@arm.com \
--cc=tiantao6@hisilicon.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox