lkml.org 
[lkml]   [2011]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] dma: Initialize uninitialized variable
Date
Uninitialized variable results in random debug output.
Fix by initializing to 0.

This commit fixes the following warning:

drivers/dma/pch_dma.c: In function pdc_desc_get:
drivers/dma/pch_dma.c:406: warning: i may be used uninitialized in this function

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
drivers/dma/pch_dma.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/pch_dma.c b/drivers/dma/pch_dma.c
index 8d8fef1..6eebc62 100644
--- a/drivers/dma/pch_dma.c
+++ b/drivers/dma/pch_dma.c
@@ -403,7 +403,7 @@ static struct pch_dma_desc *pdc_desc_get(struct pch_dma_chan *pd_chan)
{
struct pch_dma_desc *desc, *_d;
struct pch_dma_desc *ret = NULL;
- int i;
+ int i = 0;

spin_lock(&pd_chan->lock);
list_for_each_entry_safe(desc, _d, &pd_chan->free_list, desc_node) {
--
1.7.1


\
 
 \ /
  Last update: 2011-05-26 08:51    [W:0.034 / U:15.624 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site