From: Randy Dunlap <rdunlap@infradead.org>
To: Colin Ian King <colin.i.king@gmail.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H . Peter Anvin" <hpa@zytor.com>,
linux-perf-users@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] perf/x86/rapl: replace 0 with NULL to initialize pointers
Date: Tue, 25 Jan 2022 12:29:06 -0800 [thread overview]
Message-ID: <d1d154c1-dfdb-9899-8d40-4ff50de80df1@infradead.org> (raw)
In-Reply-To: <20220125201403.670011-1-colin.i.king@gmail.com>
On 1/25/22 12:14, Colin Ian King wrote:
> Pointers should be initialized with NULL rather than zero. Fix these.
> Cleans up sparse warning:
>
> arch/x86/events/rapl.c:540:59: warning: Using plain integer as NULL pointer
also was
Reported-by: kernel test robot <lkp@intel.com>
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
> arch/x86/events/rapl.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/events/rapl.c b/arch/x86/events/rapl.c
> index 77e3a47af5ad..7d70690fded5 100644
> --- a/arch/x86/events/rapl.c
> +++ b/arch/x86/events/rapl.c
> @@ -537,11 +537,11 @@ static struct perf_msr intel_rapl_spr_msrs[] = {
> * - want to use same event codes across both architectures
> */
> static struct perf_msr amd_rapl_msrs[] = {
> - [PERF_RAPL_PP0] = { 0, &rapl_events_cores_group, 0, false, 0 },
> + [PERF_RAPL_PP0] = { 0, &rapl_events_cores_group, NULL, false, 0 },
> [PERF_RAPL_PKG] = { MSR_AMD_PKG_ENERGY_STATUS, &rapl_events_pkg_group, test_msr, false, RAPL_MSR_MASK },
> - [PERF_RAPL_RAM] = { 0, &rapl_events_ram_group, 0, false, 0 },
> - [PERF_RAPL_PP1] = { 0, &rapl_events_gpu_group, 0, false, 0 },
> - [PERF_RAPL_PSYS] = { 0, &rapl_events_psys_group, 0, false, 0 },
> + [PERF_RAPL_RAM] = { 0, &rapl_events_ram_group, NULL, false, 0 },
> + [PERF_RAPL_PP1] = { 0, &rapl_events_gpu_group, NULL, false, 0 },
> + [PERF_RAPL_PSYS] = { 0, &rapl_events_psys_group, NULL, false, 0 },
> };
>
> static int rapl_cpu_offline(unsigned int cpu)
--
~Randy
next prev parent reply other threads:[~2022-01-25 20:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-25 20:14 [PATCH][next] perf/x86/rapl: replace 0 with NULL to initialize pointers Colin Ian King
2022-01-25 20:29 ` Randy Dunlap [this message]
2022-01-25 21:32 ` Peter Zijlstra
2022-01-26 11:33 ` Dan Carpenter
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=d1d154c1-dfdb-9899-8d40-4ff50de80df1@infradead.org \
--to=rdunlap@infradead.org \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=bp@alien8.de \
--cc=colin.i.king@gmail.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jolsa@redhat.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@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;
as well as URLs for NNTP newsgroup(s).