diff mbox

[2/2] cpufreq: exynos: Initialise return variable

Message ID 1358932932-14094-2-git-send-email-sachin.kamat@linaro.org
State Accepted
Headers show

Commit Message

Sachin Kamat Jan. 23, 2013, 9:22 a.m. UTC
'ret' is undefined when the function returns from the first
'if' condition. Without this patch we get the following warning:

drivers/cpufreq/exynos-cpufreq.c: In function ‘exynos_target’:
drivers/cpufreq/exynos-cpufreq.c:182:2: warning:
‘ret’ may be used uninitialized in this function [-Wuninitialized]

Suggested-by: Jonghwan Choi <jhbird.choi@samsung.com>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/cpufreq/exynos-cpufreq.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Kukjin Kim Jan. 25, 2013, 6:26 p.m. UTC | #1
Sachin Kamat wrote:
> 
> 'ret' is undefined when the function returns from the first
> 'if' condition. Without this patch we get the following warning:
> 
> drivers/cpufreq/exynos-cpufreq.c: In function ‘exynos_target’:
> drivers/cpufreq/exynos-cpufreq.c:182:2: warning:
> ‘ret’ may be used uninitialized in this function [-Wuninitialized]
> 
> Suggested-by: Jonghwan Choi <jhbird.choi@samsung.com>

I modified above to 'Reported-by' because checkpatch complains like following...

WARNING: Non-standard signature: Suggested-by:
#10:
Suggested-by: Jonghwan Choi <jhbird.choi@samsung.com>

> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
>  drivers/cpufreq/exynos-cpufreq.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
Applied, thanks.

- Kukjin
Rafael J. Wysocki Jan. 25, 2013, 7:58 p.m. UTC | #2
On Friday, January 25, 2013 10:26:41 AM Kukjin Kim wrote:
> Sachin Kamat wrote:
> > 
> > 'ret' is undefined when the function returns from the first
> > 'if' condition. Without this patch we get the following warning:
> > 
> > drivers/cpufreq/exynos-cpufreq.c: In function ‘exynos_target’:
> > drivers/cpufreq/exynos-cpufreq.c:182:2: warning:
> > ‘ret’ may be used uninitialized in this function [-Wuninitialized]
> > 
> > Suggested-by: Jonghwan Choi <jhbird.choi@samsung.com>
> 
> I modified above to 'Reported-by' because checkpatch complains like following...
> 
> WARNING: Non-standard signature: Suggested-by:
> #10:
> Suggested-by: Jonghwan Choi <jhbird.choi@samsung.com>

This tag has been used already, though, and I think it makes sense (more than
Reported-by in this case).  I think it may be regarded as standard regardless
of what checkpatch has to say about that. :-)

Thanks,
Rafael
Kukjin Kim Feb. 1, 2013, 1:11 a.m. UTC | #3
Rafael J. Wysocki wrote:
> 
> On Friday, January 25, 2013 10:26:41 AM Kukjin Kim wrote:
> > Sachin Kamat wrote:
> > >
> > > 'ret' is undefined when the function returns from the first
> > > 'if' condition. Without this patch we get the following warning:
> > >
> > > drivers/cpufreq/exynos-cpufreq.c: In function ‘exynos_target’:
> > > drivers/cpufreq/exynos-cpufreq.c:182:2: warning:
> > > ‘ret’ may be used uninitialized in this function [-Wuninitialized]
> > >
> > > Suggested-by: Jonghwan Choi <jhbird.choi@samsung.com>
> >
> > I modified above to 'Reported-by' because checkpatch complains like
> following...
> >
> > WARNING: Non-standard signature: Suggested-by:
> > #10:
> > Suggested-by: Jonghwan Choi <jhbird.choi@samsung.com>
> 
> This tag has been used already, though, and I think it makes sense (more
> than  

Yes, agreed.

> Reported-by in this case).  I think it may be regarded as standard regardless
> of what checkpatch has to say about that. :-)
> 
I see. Let me keep the 'Reported-by' here.
Thanks for your opinion.

- Kukjin
diff mbox

Patch

diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c
index 88401ba..4268e46 100644
--- a/drivers/cpufreq/exynos-cpufreq.c
+++ b/drivers/cpufreq/exynos-cpufreq.c
@@ -159,7 +159,7 @@  static int exynos_target(struct cpufreq_policy *policy,
 {
 	struct cpufreq_frequency_table *freq_table = exynos_info->freq_table;
 	unsigned int index;
-	int ret;
+	int ret = 0;
 
 	mutex_lock(&cpufreq_lock);