Re: [PATCH] clocksource/drivers: fix uninitialized variable use in timer_of_init

2017-06-22 Thread Daniel Lezcano
On 21/06/2017 23:49, Arnd Bergmann wrote:
> If none of the flags are set, 'ret' is uninitialized as pointed out
> by gcc:
> 
> drivers/clocksource/timer-of.c: In function 'timer_of_init':
> drivers/clocksource/timer-of.c:160:9: error: 'ret' may be used uninitialized 
> in this function [-Werror=maybe-uninitialized]
> 
> Since calling the function without any of the flags is an error,
> set the return value to -EINVAL for that case.
> 
> Fixes: dc11bae78529 ("clocksource/drivers: Add timer-of common init routine")
> Signed-off-by: Arnd Bergmann 
> ---

Thanks for the fix!



-- 
  Linaro.org │ Open source software for ARM SoCs

Follow Linaro:   Facebook |
 Twitter |
 Blog



Re: [PATCH] clocksource/drivers: fix uninitialized variable use in timer_of_init

2017-06-22 Thread Daniel Lezcano
On 21/06/2017 23:49, Arnd Bergmann wrote:
> If none of the flags are set, 'ret' is uninitialized as pointed out
> by gcc:
> 
> drivers/clocksource/timer-of.c: In function 'timer_of_init':
> drivers/clocksource/timer-of.c:160:9: error: 'ret' may be used uninitialized 
> in this function [-Werror=maybe-uninitialized]
> 
> Since calling the function without any of the flags is an error,
> set the return value to -EINVAL for that case.
> 
> Fixes: dc11bae78529 ("clocksource/drivers: Add timer-of common init routine")
> Signed-off-by: Arnd Bergmann 
> ---

Thanks for the fix!



-- 
  Linaro.org │ Open source software for ARM SoCs

Follow Linaro:   Facebook |
 Twitter |
 Blog



[PATCH] clocksource/drivers: fix uninitialized variable use in timer_of_init

2017-06-21 Thread Arnd Bergmann
If none of the flags are set, 'ret' is uninitialized as pointed out
by gcc:

drivers/clocksource/timer-of.c: In function 'timer_of_init':
drivers/clocksource/timer-of.c:160:9: error: 'ret' may be used uninitialized in 
this function [-Werror=maybe-uninitialized]

Since calling the function without any of the flags is an error,
set the return value to -EINVAL for that case.

Fixes: dc11bae78529 ("clocksource/drivers: Add timer-of common init routine")
Signed-off-by: Arnd Bergmann 
---
 drivers/clocksource/timer-of.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/timer-of.c b/drivers/clocksource/timer-of.c
index be1dbee11c20..af75cbdcfc06 100644
--- a/drivers/clocksource/timer-of.c
+++ b/drivers/clocksource/timer-of.c
@@ -130,7 +130,7 @@ static __init int timer_base_init(struct device_node *np,
 
 int __init timer_of_init(struct device_node *np, struct timer_of *to)
 {
-   int ret;
+   int ret = -EINVAL;
int flags = 0;
 
if (to->flags & TIMER_OF_BASE) {
-- 
2.9.0



[PATCH] clocksource/drivers: fix uninitialized variable use in timer_of_init

2017-06-21 Thread Arnd Bergmann
If none of the flags are set, 'ret' is uninitialized as pointed out
by gcc:

drivers/clocksource/timer-of.c: In function 'timer_of_init':
drivers/clocksource/timer-of.c:160:9: error: 'ret' may be used uninitialized in 
this function [-Werror=maybe-uninitialized]

Since calling the function without any of the flags is an error,
set the return value to -EINVAL for that case.

Fixes: dc11bae78529 ("clocksource/drivers: Add timer-of common init routine")
Signed-off-by: Arnd Bergmann 
---
 drivers/clocksource/timer-of.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/timer-of.c b/drivers/clocksource/timer-of.c
index be1dbee11c20..af75cbdcfc06 100644
--- a/drivers/clocksource/timer-of.c
+++ b/drivers/clocksource/timer-of.c
@@ -130,7 +130,7 @@ static __init int timer_base_init(struct device_node *np,
 
 int __init timer_of_init(struct device_node *np, struct timer_of *to)
 {
-   int ret;
+   int ret = -EINVAL;
int flags = 0;
 
if (to->flags & TIMER_OF_BASE) {
-- 
2.9.0