Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org
Subject: Re: [bug report] perf: Add driver for Arm NI-700 interconnect PMU
Date: Wed, 11 Sep 2024 13:25:43 +0100	[thread overview]
Message-ID: <ef16c75c-839a-496b-9100-c8476022df3d@arm.com> (raw)
In-Reply-To: <3ef9d6a4-bb08-4496-9d20-4781fa4c8e8a@stanley.mountain>

On 2024-09-11 8:35 am, Dan Carpenter wrote:
> Hello Robin Murphy,
> 
> Commit 4d5a7680f2b4 ("perf: Add driver for Arm NI-700 interconnect
> PMU") from Sep 4, 2024 (linux-next), leads to the following Smatch
> static checker warning:
> 
> drivers/perf/arm-ni.c:726 arm_ni_pmu_online_cpu() warn: 'cd' was set to NULL
> drivers/perf/arm-ni.c:738 arm_ni_pmu_offline_cpu() warn: 'cd' was set to NULL
> 
> drivers/perf/arm-ni.c
>      719 static int arm_ni_pmu_online_cpu(unsigned int cpu, struct hlist_node *cpuhp_node)
>      720 {
>      721         struct arm_ni_cd *cd;
>      722         int node;
>      723
>      724         cd = hlist_entry_safe(cpuhp_node, struct arm_ni_cd, cpuhp_node);
>      725         node = dev_to_node(cd_to_ni(cd)->dev);
> 
> There isn't any point in using the _safe() version of hlist_entry() unless we're
> going to check for NULL.

Hmm, this was just following the same pattern as every other PMU driver, 
which dates all the way back to the original multi-instance 
implementation[1]. Seems like one for a tree-wide cleanup if anyone's 
sufficiently bothered.

Thanks,
Robin.

[1] 
https://lore.kernel.org/all/1471024183-12666-1-git-send-email-bigeasy@linutronix.de/

> 
> --> 726         if (cpu_to_node(cd->cpu) != node && cpu_to_node(cpu) == node)
>      727                 arm_ni_pmu_migrate(cd, cpu);
>      728         return 0;
>      729 }
> 
> regards,
> dan carpenter


      reply	other threads:[~2024-09-11 12:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-11  7:35 [bug report] perf: Add driver for Arm NI-700 interconnect PMU Dan Carpenter
2024-09-11 12:25 ` Robin Murphy [this message]

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=ef16c75c-839a-496b-9100-c8476022df3d@arm.com \
    --to=robin.murphy@arm.com \
    --cc=dan.carpenter@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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