Linux-PM Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] cpufreq: remove redundant assignment to ret
@ 2019-08-13 12:21 Colin King
  2019-08-19  6:58 ` Viresh Kumar
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2019-08-13 12:21 UTC (permalink / raw)
  To: Rafael J . Wysocki, Viresh Kumar, linux-pm; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Variable ret is initialized to a value that is never read and it is
re-assigned later. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/cpufreq/cpufreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index c28ebf2810f1..26d82e0a2de5 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2140,7 +2140,7 @@ int cpufreq_driver_target(struct cpufreq_policy *policy,
 			  unsigned int target_freq,
 			  unsigned int relation)
 {
-	int ret = -EINVAL;
+	int ret;
 
 	down_write(&policy->rwsem);
 
-- 
2.20.1


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

* Re: [PATCH] cpufreq: remove redundant assignment to ret
  2019-08-13 12:21 [PATCH] cpufreq: remove redundant assignment to ret Colin King
@ 2019-08-19  6:58 ` Viresh Kumar
  2019-08-26  9:20   ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Viresh Kumar @ 2019-08-19  6:58 UTC (permalink / raw)
  To: Colin King; +Cc: Rafael J . Wysocki, linux-pm, kernel-janitors, linux-kernel

On 13-08-19, 13:21, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Variable ret is initialized to a value that is never read and it is
> re-assigned later. The initialization is redundant and can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/cpufreq/cpufreq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index c28ebf2810f1..26d82e0a2de5 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -2140,7 +2140,7 @@ int cpufreq_driver_target(struct cpufreq_policy *policy,
>  			  unsigned int target_freq,
>  			  unsigned int relation)
>  {
> -	int ret = -EINVAL;
> +	int ret;
>  
>  	down_write(&policy->rwsem);
>  

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

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

* Re: [PATCH] cpufreq: remove redundant assignment to ret
  2019-08-19  6:58 ` Viresh Kumar
@ 2019-08-26  9:20   ` Rafael J. Wysocki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2019-08-26  9:20 UTC (permalink / raw)
  To: Viresh Kumar, Colin King; +Cc: linux-pm, kernel-janitors, linux-kernel

On Monday, August 19, 2019 8:58:14 AM CEST Viresh Kumar wrote:
> On 13-08-19, 13:21, Colin King wrote:
> > From: Colin Ian King <colin.king@canonical.com>
> > 
> > Variable ret is initialized to a value that is never read and it is
> > re-assigned later. The initialization is redundant and can be removed.
> > 
> > Addresses-Coverity: ("Unused value")
> > Signed-off-by: Colin Ian King <colin.king@canonical.com>
> > ---
> >  drivers/cpufreq/cpufreq.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> > index c28ebf2810f1..26d82e0a2de5 100644
> > --- a/drivers/cpufreq/cpufreq.c
> > +++ b/drivers/cpufreq/cpufreq.c
> > @@ -2140,7 +2140,7 @@ int cpufreq_driver_target(struct cpufreq_policy *policy,
> >  			  unsigned int target_freq,
> >  			  unsigned int relation)
> >  {
> > -	int ret = -EINVAL;
> > +	int ret;
> >  
> >  	down_write(&policy->rwsem);
> >  
> 
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> 
> 

Patch applied, thanks!





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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-13 12:21 [PATCH] cpufreq: remove redundant assignment to ret Colin King
2019-08-19  6:58 ` Viresh Kumar
2019-08-26  9:20   ` Rafael J. Wysocki

Linux-PM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-pm/0 linux-pm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-pm linux-pm/ https://lore.kernel.org/linux-pm \
		linux-pm@vger.kernel.org linux-pm@archiver.kernel.org
	public-inbox-index linux-pm


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-pm


AGPL code for this site: git clone https://public-inbox.org/ public-inbox