All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arch/x86: use 'NULL' insteadof '0' as null pointer
@ 2022-04-17 15:41 liqiong
  2022-04-19  7:37 ` Peter Zijlstra
  0 siblings, 1 reply; 3+ messages in thread
From: liqiong @ 2022-04-17 15:41 UTC (permalink / raw)
  To: Thomas Gleixner, Dave Hansen, x86; +Cc: linux-kernel, yuzhe, renyu, liqiong

Sparse warns: "Using plain integer as NULL pointer".
Use 'NULL' as null pointer.

Signed-off-by: liqiong <liqiong@nfschina.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)
-- 
2.25.1


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

* Re: [PATCH] arch/x86: use 'NULL' insteadof '0' as null pointer
  2022-04-17 15:41 [PATCH] arch/x86: use 'NULL' insteadof '0' as null pointer liqiong
@ 2022-04-19  7:37 ` Peter Zijlstra
  2022-04-19  7:42   ` liqiong
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Zijlstra @ 2022-04-19  7:37 UTC (permalink / raw)
  To: liqiong; +Cc: Thomas Gleixner, Dave Hansen, x86, linux-kernel, yuzhe, renyu

On Sun, Apr 17, 2022 at 11:41:48PM +0800, liqiong wrote:
> Sparse warns: "Using plain integer as NULL pointer".

What's wrong with that?

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

* Re: [PATCH] arch/x86: use 'NULL' insteadof '0' as null pointer
  2022-04-19  7:37 ` Peter Zijlstra
@ 2022-04-19  7:42   ` liqiong
  0 siblings, 0 replies; 3+ messages in thread
From: liqiong @ 2022-04-19  7:42 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Thomas Gleixner, Dave Hansen, x86, linux-kernel, yuzhe, renyu



在 2022年04月19日 15:37, Peter Zijlstra 写道:
> On Sun, Apr 17, 2022 at 11:41:48PM +0800, liqiong wrote:
>> Sparse warns: "Using plain integer as NULL pointer".
> What's wrong with that?

Just a sparse warning.




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

end of thread, other threads:[~2022-04-19  7:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-17 15:41 [PATCH] arch/x86: use 'NULL' insteadof '0' as null pointer liqiong
2022-04-19  7:37 ` Peter Zijlstra
2022-04-19  7:42   ` liqiong

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.