diff mbox series

[1/3] PM / devfreq: fix indentation in devfreq_add_device()

Message ID 20190119160454.23151-1-tiny.windzz@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show
Series [1/3] PM / devfreq: fix indentation in devfreq_add_device() | expand

Commit Message

Yangtao Li Jan. 19, 2019, 4:04 p.m. UTC
To beautify the code format.

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

Comments

Chanwoo Choi Jan. 21, 2019, 1:58 a.m. UTC | #1
Hi,

On 19. 1. 20. 오전 1:04, Yangtao Li wrote:
> To beautify the code format.
> 
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> ---
>  drivers/devfreq/devfreq.c | 17 ++++++++---------
>  1 file changed, 8 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> index 0ae3de76833b..076b1c2f40a4 100644
> --- a/drivers/devfreq/devfreq.c
> +++ b/drivers/devfreq/devfreq.c
> @@ -683,16 +683,15 @@ struct devfreq *devfreq_add_device(struct device *dev,
>  		goto err_out;
>  	}
>  
> -	devfreq->trans_table =
> -		devm_kzalloc(&devfreq->dev,
> -			     array3_size(sizeof(unsigned int),
> -					 devfreq->profile->max_state,
> -					 devfreq->profile->max_state),
> -			     GFP_KERNEL);
> +	devfreq->trans_table = devm_kzalloc(&devfreq->dev,
> +					    array3_size(sizeof(unsigned int),
> +					    devfreq->profile->max_state,
> +					    devfreq->profile->max_state),
> +					    GFP_KERNEL);
>  	devfreq->time_in_state = devm_kcalloc(&devfreq->dev,
> -						devfreq->profile->max_state,
> -						sizeof(unsigned long),
> -						GFP_KERNEL);
> +					      devfreq->profile->max_state,
> +					      sizeof(unsigned long),
> +					      GFP_KERNEL);
>  	devfreq->last_stat_updated = jiffies;
>  
>  	srcu_init_notifier_head(&devfreq->transition_notifier_list);
> 

Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Joe Perches Jan. 21, 2019, 4:39 p.m. UTC | #2
On Mon, 2019-01-21 at 10:58 +0900, Chanwoo Choi wrote:
> On 19. 1. 20. 오전 1:04, Yangtao Li wrote:
> > To beautify the code format.

I believe half of the changes are actually _less_ beautiful.

> > diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
[]
> > @@ -683,16 +683,15 @@ struct devfreq *devfreq_add_device(struct device *dev,
> >  		goto err_out;
> >  	}
> >  
> > -	devfreq->trans_table =
> > -		devm_kzalloc(&devfreq->dev,
> > -			     array3_size(sizeof(unsigned int),
> > -					 devfreq->profile->max_state,
> > -					 devfreq->profile->max_state),
> > -			     GFP_KERNEL);
> > +	devfreq->trans_table = devm_kzalloc(&devfreq->dev,
> > +					    array3_size(sizeof(unsigned int),
> > +					    devfreq->profile->max_state,
> > +					    devfreq->profile->max_state),
> > +					    GFP_KERNEL);

I think this bit is worse because the array3_size arguments
are no longer aligned.

> >  	devfreq->time_in_state = devm_kcalloc(&devfreq->dev,
> > -						devfreq->profile->max_state,
> > -						sizeof(unsigned long),
> > -						GFP_KERNEL);
> > +					      devfreq->profile->max_state,
> > +					      sizeof(unsigned long),
> > +					      GFP_KERNEL);

and this bit is better.
diff mbox series

Patch

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 0ae3de76833b..076b1c2f40a4 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -683,16 +683,15 @@  struct devfreq *devfreq_add_device(struct device *dev,
 		goto err_out;
 	}
 
-	devfreq->trans_table =
-		devm_kzalloc(&devfreq->dev,
-			     array3_size(sizeof(unsigned int),
-					 devfreq->profile->max_state,
-					 devfreq->profile->max_state),
-			     GFP_KERNEL);
+	devfreq->trans_table = devm_kzalloc(&devfreq->dev,
+					    array3_size(sizeof(unsigned int),
+					    devfreq->profile->max_state,
+					    devfreq->profile->max_state),
+					    GFP_KERNEL);
 	devfreq->time_in_state = devm_kcalloc(&devfreq->dev,
-						devfreq->profile->max_state,
-						sizeof(unsigned long),
-						GFP_KERNEL);
+					      devfreq->profile->max_state,
+					      sizeof(unsigned long),
+					      GFP_KERNEL);
 	devfreq->last_stat_updated = jiffies;
 
 	srcu_init_notifier_head(&devfreq->transition_notifier_list);