lkml.org 
[lkml]   [2015]   [Sep]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] PM / devfreq: Fix incorrect type issue.

> time_in_state in struct devfreq is defined as unsigned long, so
> devm_kzalloc should use sizeof(unsigned long) as argument instead
> of sizeof(unsigned int), otherwise it will cause unexpected result
> in 64bit system.
>
> Signed-off-by: Xiaolong Ye <yexl@marvell.com>
> Signed-off-by: Kevin Liu <kliu5@marvell.com>

Thanks!

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


Which SoC are you working with?
Are you going to upstream your 64bit devfreq driver soon?


Cheers,
MyungJoo

> ---
> drivers/devfreq/devfreq.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> index ca1b362..ac9845a 100644
> --- a/drivers/devfreq/devfreq.c
> +++ b/drivers/devfreq/devfreq.c
> @@ -482,7 +482,7 @@ struct devfreq *devfreq_add_device(struct device *dev,
> devfreq->profile->max_state *
> devfreq->profile->max_state,
> GFP_KERNEL);
> - devfreq->time_in_state = devm_kzalloc(dev, sizeof(unsigned int) *
> + devfreq->time_in_state = devm_kzalloc(dev, sizeof(unsigned long) *
> devfreq->profile->max_state,
> GFP_KERNEL);
> devfreq->last_stat_updated = jiffies;
> --
> 1.7.9.5
\
 
 \ /
  Last update: 2015-09-11 07:21    [W:1.797 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site