[3/3] PM / devfreq: tegra: remove unneeded variable
diff mbox series

Message ID 20190216151826.11584-4-tiny.windzz@gmail.com
State Deferred
Headers show
Series
  • PM / devfreq: do some cleanup
Related show

Commit Message

Frank Lee Feb. 16, 2019, 3:18 p.m. UTC
This variable is not used after initialization, so
remove it. And in order to unify the code style,
move the location where the dev_get_drvdata is called
by the way.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 drivers/devfreq/tegra-devfreq.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Chanwoo Choi Feb. 18, 2019, 12:38 a.m. UTC | #1
On 19. 2. 17. 오전 12:18, Yangtao Li wrote:
> This variable is not used after initialization, so
> remove it. And in order to unify the code style,
> move the location where the dev_get_drvdata is called
> by the way.
> 
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> ---
>  drivers/devfreq/tegra-devfreq.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/devfreq/tegra-devfreq.c b/drivers/devfreq/tegra-devfreq.c
> index c59d2eee5d30..c89ba7b834ff 100644
> --- a/drivers/devfreq/tegra-devfreq.c
> +++ b/drivers/devfreq/tegra-devfreq.c
> @@ -573,10 +573,7 @@ static int tegra_governor_get_target(struct devfreq *devfreq,
>  static int tegra_governor_event_handler(struct devfreq *devfreq,
>  					unsigned int event, void *data)
>  {
> -	struct tegra_devfreq *tegra;
> -	int ret = 0;
> -
> -	tegra = dev_get_drvdata(devfreq->dev.parent);
> +	struct tegra_devfreq *tegra = dev_get_drvdata(devfreq->dev.parent);
>  
>  	switch (event) {
>  	case DEVFREQ_GOV_START:
> @@ -600,7 +597,7 @@ static int tegra_governor_event_handler(struct devfreq *devfreq,
>  		break;
>  	}
>  
> -	return ret;
> +	return 0;
>  }
>  
>  static struct devfreq_governor tegra_devfreq_governor = {
> 

Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Jon Hunter Feb. 18, 2019, 9:55 a.m. UTC | #2
On 18/02/2019 00:38, Chanwoo Choi wrote:
> On 19. 2. 17. 오전 12:18, Yangtao Li wrote:
>> This variable is not used after initialization, so
>> remove it. And in order to unify the code style,
>> move the location where the dev_get_drvdata is called
>> by the way.
>>
>> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
>> ---
>>  drivers/devfreq/tegra-devfreq.c | 7 ++-----
>>  1 file changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/devfreq/tegra-devfreq.c b/drivers/devfreq/tegra-devfreq.c
>> index c59d2eee5d30..c89ba7b834ff 100644
>> --- a/drivers/devfreq/tegra-devfreq.c
>> +++ b/drivers/devfreq/tegra-devfreq.c
>> @@ -573,10 +573,7 @@ static int tegra_governor_get_target(struct devfreq *devfreq,
>>  static int tegra_governor_event_handler(struct devfreq *devfreq,
>>  					unsigned int event, void *data)
>>  {
>> -	struct tegra_devfreq *tegra;
>> -	int ret = 0;
>> -
>> -	tegra = dev_get_drvdata(devfreq->dev.parent);
>> +	struct tegra_devfreq *tegra = dev_get_drvdata(devfreq->dev.parent);
>>  
>>  	switch (event) {
>>  	case DEVFREQ_GOV_START:
>> @@ -600,7 +597,7 @@ static int tegra_governor_event_handler(struct devfreq *devfreq,
>>  		break;
>>  	}
>>  
>> -	return ret;
>> +	return 0;
>>  }
>>  
>>  static struct devfreq_governor tegra_devfreq_governor = {
>>
> 
> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
> 

Acked-by: Jon Hunter <jonathanh@nvidia.com>

Thanks!
Jon
MyungJoo Ham Feb. 20, 2019, 2:25 p.m. UTC | #3
On Mon, Feb 18, 2019 at 6:58 PM Jon Hunter <jonathanh@nvidia.com> wrote:
>
>
> On 18/02/2019 00:38, Chanwoo Choi wrote:
> > On 19. 2. 17. 오전 12:18, Yangtao Li wrote:
> >> This variable is not used after initialization, so
> >> remove it. And in order to unify the code style,
> >> move the location where the dev_get_drvdata is called
> >> by the way.
> >>
> >> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> >> ---
> >>  drivers/devfreq/tegra-devfreq.c | 7 ++-----
> >>  1 file changed, 2 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/drivers/devfreq/tegra-devfreq.c b/drivers/devfreq/tegra-devfreq.c
> >> index c59d2eee5d30..c89ba7b834ff 100644
> >> --- a/drivers/devfreq/tegra-devfreq.c
> >> +++ b/drivers/devfreq/tegra-devfreq.c
> >> @@ -573,10 +573,7 @@ static int tegra_governor_get_target(struct devfreq *devfreq,
> >>  static int tegra_governor_event_handler(struct devfreq *devfreq,
> >>                                      unsigned int event, void *data)
> >>  {
> >> -    struct tegra_devfreq *tegra;
> >> -    int ret = 0;
> >> -
> >> -    tegra = dev_get_drvdata(devfreq->dev.parent);
> >> +    struct tegra_devfreq *tegra = dev_get_drvdata(devfreq->dev.parent);
> >>
> >>      switch (event) {
> >>      case DEVFREQ_GOV_START:
> >> @@ -600,7 +597,7 @@ static int tegra_governor_event_handler(struct devfreq *devfreq,
> >>              break;
> >>      }
> >>
> >> -    return ret;
> >> +    return 0;
> >>  }
> >>
> >>  static struct devfreq_governor tegra_devfreq_governor = {
> >>
> >
> > Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
> >
>
> Acked-by: Jon Hunter <jonathanh@nvidia.com>
>
> Thanks!
> Jon

Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>

Merged. Thanks!

>
> --
> nvpublic

Patch
diff mbox series

diff --git a/drivers/devfreq/tegra-devfreq.c b/drivers/devfreq/tegra-devfreq.c
index c59d2eee5d30..c89ba7b834ff 100644
--- a/drivers/devfreq/tegra-devfreq.c
+++ b/drivers/devfreq/tegra-devfreq.c
@@ -573,10 +573,7 @@  static int tegra_governor_get_target(struct devfreq *devfreq,
 static int tegra_governor_event_handler(struct devfreq *devfreq,
 					unsigned int event, void *data)
 {
-	struct tegra_devfreq *tegra;
-	int ret = 0;
-
-	tegra = dev_get_drvdata(devfreq->dev.parent);
+	struct tegra_devfreq *tegra = dev_get_drvdata(devfreq->dev.parent);
 
 	switch (event) {
 	case DEVFREQ_GOV_START:
@@ -600,7 +597,7 @@  static int tegra_governor_event_handler(struct devfreq *devfreq,
 		break;
 	}
 
-	return ret;
+	return 0;
 }
 
 static struct devfreq_governor tegra_devfreq_governor = {