Skip to contentSkip to conversation

intel_telemetry_pltdrv: silence an unintialized variable warning

PATCH In review Dan Carpenter 2 participants 2 messages Apr 15, 2016 – Apr 18, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 intel_telemetry_pltdrv: silence an unintialized variable warning

Presumably "pss_period" and "ioss_period" can't both be zero, but this function is never called so we can't infer that using static analysis alone.

Let's silence the warning by setting "ret" to zero.

drivers/platform/x86/intel_telemetry_pltdrv.c +1 -1
index 397119f..781bd10 100644
@@ -659,7 +659,7 @@ static int telemetry_plt_update_events(struct telemetry_evtconfig pss_evtconfig,
 static int telemetry_plt_set_sampling_period(u8 pss_period, u8 ioss_period)
 {
 	u32 telem_ctrl = 0;
-	int ret;
+	int ret = 0;
 
 	mutex_lock(&(telm_conf->telem_lock));
 	if (ioss_period) {
#1 lore raw

Looks good...thanks Dan.

Quoted 31 lines

-----Original Message-----
From: Dan Carpenter [mailto:[email protected]]
Sent: Friday, April 15, 2016 8:16 PM
To: Chakravarty, Souvik K <[email protected]>
Cc: Darren Hart <[email protected]>; platform-driver- [email protected]; [email protected]; kernel- [email protected]
Subject: [patch] intel_telemetry_pltdrv: silence an unintialized variable warning

Presumably "pss_period" and "ioss_period" can't both be zero, but this function is never called so we can't infer that using static analysis alone.

Let's silence the warning by setting "ret" to zero.

drivers/platform/x86/intel_telemetry_pltdrv.c +0 -0
index 397119f..781bd10 100644
@@ -659,7 +659,7 @@ static int telemetry_plt_update_events(struct

telemetry_evtconfig pss_evtconfig, static int telemetry_plt_set_sampling_period(u8 pss_period, u8 ioss_period) {

drivers/platform/x86/intel_telemetry_pltdrv.c +1 -1
 	u32 telem_ctrl = 0;
-	int ret;
+	int ret = 0;
 
 	mutex_lock(&(telm_conf->telem_lock));
 	if (ioss_period) {