lkml.org 
[lkml]   [2014]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] misc: ioc4: fix variable may be used uninitialized warning
Fix the following build warning:
drivers/misc/ioc4.c: In function ‘ioc4_probe’:
drivers/misc/ioc4.c:194:16: warning: ‘start’ may be used uninitialized
in this function [-Wmaybe-uninitialized]
period = (end - start) /
^
drivers/misc/ioc4.c:148:11: note: ‘start’ was declared here
uint64_t start, end, period;
^

As far as I can tell 'start' cannot really be used uninitialized
here, but for the sanity of gcc output explicitly initialize it.
Same goes for the 'end' variable.

Signed-off-by: Richard Leitner <dev@g0hl1n.net>
---
Used gcc version was 4.9.1 (Debian 4.9.1-19)
P.S.: I know I'm too late for 3.18 but hopefully it still helps.
---
drivers/misc/ioc4.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/ioc4.c b/drivers/misc/ioc4.c
index 3336ddc..7ec2733 100644
--- a/drivers/misc/ioc4.c
+++ b/drivers/misc/ioc4.c
@@ -145,7 +145,7 @@ ioc4_clock_calibrate(struct ioc4_driver_data *idd)
union ioc4_int_out int_out;
union ioc4_gpcr gpcr;
unsigned int state, last_state = 1;
- uint64_t start, end, period;
+ uint64_t start = 0, end = 0, period;
unsigned int count = 0;

/* Enable output */
--
2.1.3


\
 
 \ /
  Last update: 2014-12-08 14:01    [W:0.044 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site