Skip to content

Commit 618e77d

Browse files
jdreaverIngo Molnar
authored and
Ingo Molnar
committed
perf/x86/rapl: Fix "Using plain integer as NULL pointer" Sparse warning
Change 0 to NULL when initializing the test field of perf_msr structs to avoid the following sparse warnings: make C=2 arch/x86/events/rapl.o CHECK arch/x86/events/rapl.c ... arch/x86/events/rapl.c:540:59: warning: Using plain integer as NULL pointer arch/x86/events/rapl.c:542:59: warning: Using plain integer as NULL pointer arch/x86/events/rapl.c:543:59: warning: Using plain integer as NULL pointer arch/x86/events/rapl.c:544:59: warning: Using plain integer as NULL pointer Signed-off-by: David Reaver <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent bcc6ec3 commit 618e77d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/x86/events/rapl.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -533,11 +533,11 @@ static struct perf_msr intel_rapl_spr_msrs[] = {
533533
* - want to use same event codes across both architectures
534534
*/
535535
static struct perf_msr amd_rapl_msrs[] = {
536-
[PERF_RAPL_PP0] = { 0, &rapl_events_cores_group, 0, false, 0 },
536+
[PERF_RAPL_PP0] = { 0, &rapl_events_cores_group, NULL, false, 0 },
537537
[PERF_RAPL_PKG] = { MSR_AMD_PKG_ENERGY_STATUS, &rapl_events_pkg_group, test_msr, false, RAPL_MSR_MASK },
538-
[PERF_RAPL_RAM] = { 0, &rapl_events_ram_group, 0, false, 0 },
539-
[PERF_RAPL_PP1] = { 0, &rapl_events_gpu_group, 0, false, 0 },
540-
[PERF_RAPL_PSYS] = { 0, &rapl_events_psys_group, 0, false, 0 },
538+
[PERF_RAPL_RAM] = { 0, &rapl_events_ram_group, NULL, false, 0 },
539+
[PERF_RAPL_PP1] = { 0, &rapl_events_gpu_group, NULL, false, 0 },
540+
[PERF_RAPL_PSYS] = { 0, &rapl_events_psys_group, NULL, false, 0 },
541541
};
542542

543543
static int rapl_cpu_offline(unsigned int cpu)

0 commit comments

Comments
 (0)