Skip to contentSkip to conversation

mfd: rc5t583: Fix warning messages

PATCH Applied Venu Byravarasu 2 participants 2 messages Aug 23, 2012 – Sep 19, 2012 Multifunction devices (MFD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: rc5t583: Fix warning messages

Two variables named master_int and sleepseq_val, were just declared without initialization. Pointers to these variables were passed to mfd read function. After that these variables were used for some of the logical operations.

Though logically there is nothing wrong, compiler is complaining that the variables may be used uninitialized.

Hence fixing these warning messages by initializing them.

---
 drivers/mfd/rc5t583-irq.c |    2 +-
 drivers/mfd/rc5t583.c     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/rc5t583-irq.c +1 -1
index fa6f80f..fe00cdd 100644
@@ -255,7 +255,7 @@ static irqreturn_t rc5t583_irq(int irq, void *data)
 {
 	struct rc5t583 *rc5t583 = data;
 	uint8_t int_sts[RC5T583_MAX_INTERRUPT_MASK_REGS];
-	uint8_t master_int;
+	uint8_t master_int = 0;
 	int i;
 	int ret;
 	unsigned int rtc_int_sts = 0;
drivers/mfd/rc5t583.c +1 -1
index cdc1df7..ce7c1c9 100644
@@ -85,7 +85,7 @@ static int __rc5t583_set_ext_pwrreq1_control(struct device *dev,
 	int id, int ext_pwr, int slots)
 {
 	int ret;
-	uint8_t sleepseq_val;
+	uint8_t sleepseq_val = 0;
 	unsigned int en_bit;
 	unsigned int slot_bit;
 
Signature · 1 line
1.7.1.1
Applied
#1 lore raw

Hi Venu,

Quoted 8 lines · Venu Byravarasu

Two variables named master_int and sleepseq_val, were just declared without initialization. Pointers to these variables were passed to mfd read function. After that these variables were used for some of the logical operations.

Though logically there is nothing wrong, compiler is complaining that the variables may be used uninitialized.

Quoted 7 lines

Hence fixing these warning messages by initializing them.

---
 drivers/mfd/rc5t583-irq.c |    2 +-
 drivers/mfd/rc5t583.c     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

Cheers,
Samuel.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/