lkml.org 
[lkml]   [2013]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 9/9] cpuidle: remove state_count field from struct cpuidle_device
On 12/20/2013 07:47 PM, Bartlomiej Zolnierkiewicz wrote:
> dev->state_count is now always equal to drv->state_count so
> it can be removed.
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>

> ---
> drivers/cpuidle/cpuidle.c | 3 ---
> drivers/cpuidle/sysfs.c | 5 +++--
> include/linux/cpuidle.h | 1 -
> 3 files changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
> index a55e68f..e3d2052 100644
> --- a/drivers/cpuidle/cpuidle.c
> +++ b/drivers/cpuidle/cpuidle.c
> @@ -252,9 +252,6 @@ int cpuidle_enable_device(struct cpuidle_device *dev)
> if (!dev->registered)
> return -EINVAL;
>
> - if (!dev->state_count)
> - dev->state_count = drv->state_count;
> -
> ret = cpuidle_add_device_sysfs(dev);
> if (ret)
> return ret;
> diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
> index e918b6d..dcaae4c 100644
> --- a/drivers/cpuidle/sysfs.c
> +++ b/drivers/cpuidle/sysfs.c
> @@ -398,7 +398,7 @@ static int cpuidle_add_state_sysfs(struct cpuidle_device *device)
> struct cpuidle_driver *drv = cpuidle_get_cpu_driver(device);
>
> /* state statistics */
> - for (i = 0; i < device->state_count; i++) {
> + for (i = 0; i < drv->state_count; i++) {
> kobj = kzalloc(sizeof(struct cpuidle_state_kobj), GFP_KERNEL);
> if (!kobj)
> goto error_state;
> @@ -430,9 +430,10 @@ error_state:
> */
> static void cpuidle_remove_state_sysfs(struct cpuidle_device *device)
> {
> + struct cpuidle_driver *drv = cpuidle_get_cpu_driver(device);
> int i;
>
> - for (i = 0; i < device->state_count; i++)
> + for (i = 0; i < drv->state_count; i++)
> cpuidle_free_state_kobj(device, i);
> }
>
> diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
> index 50fcbb0..d133817 100644
> --- a/include/linux/cpuidle.h
> +++ b/include/linux/cpuidle.h
> @@ -69,7 +69,6 @@ struct cpuidle_device {
> unsigned int cpu;
>
> int last_residency;
> - int state_count;
> struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX];
> struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX];
> struct cpuidle_driver_kobj *kobj_driver;
>


--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2013-12-20 22:41    [W:0.208 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site