linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mfd: rc5t583: Fix warning messages
@ 2012-08-23  6:51 Venu Byravarasu
  2012-09-19 16:02 ` Samuel Ortiz
  0 siblings, 1 reply; 2+ messages in thread
From: Venu Byravarasu @ 2012-08-23  6:51 UTC (permalink / raw)
  To: sameo; +Cc: linux-kernel, 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.

Hence fixing these warning messages by initializing them.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
---
 drivers/mfd/rc5t583-irq.c |    2 +-
 drivers/mfd/rc5t583.c     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/rc5t583-irq.c b/drivers/mfd/rc5t583-irq.c
index fa6f80f..fe00cdd 100644
--- a/drivers/mfd/rc5t583-irq.c
+++ b/drivers/mfd/rc5t583-irq.c
@@ -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;
diff --git a/drivers/mfd/rc5t583.c b/drivers/mfd/rc5t583.c
index cdc1df7..ce7c1c9 100644
--- a/drivers/mfd/rc5t583.c
+++ b/drivers/mfd/rc5t583.c
@@ -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;
 
-- 
1.7.1.1


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

* Re: [PATCH] mfd: rc5t583: Fix warning messages
  2012-08-23  6:51 [PATCH] mfd: rc5t583: Fix warning messages Venu Byravarasu
@ 2012-09-19 16:02 ` Samuel Ortiz
  0 siblings, 0 replies; 2+ messages in thread
From: Samuel Ortiz @ 2012-09-19 16:02 UTC (permalink / raw)
  To: Venu Byravarasu; +Cc: linux-kernel

Hi Venu,

On Thu, Aug 23, 2012 at 12:21:16PM +0530, Venu Byravarasu wrote:
> 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.
> 
> Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
> ---
>  drivers/mfd/rc5t583-irq.c |    2 +-
>  drivers/mfd/rc5t583.c     |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
Applied, thanks.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

end of thread, other threads:[~2012-09-19 16:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-23  6:51 [PATCH] mfd: rc5t583: Fix warning messages Venu Byravarasu
2012-09-19 16:02 ` Samuel Ortiz

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).