From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Lezcano Subject: Re: [PATCH v2 9/9] cpuidle: remove state_count field from struct cpuidle_device Date: Fri, 20 Dec 2013 22:27:19 +0100 Message-ID: <52B4B637.4090105@linaro.org> References: <1387565251-7051-1-git-send-email-b.zolnierkie@samsung.com> <1387565251-7051-10-git-send-email-b.zolnierkie@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mail-we0-f179.google.com ([74.125.82.179]:59291 "EHLO mail-we0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750938Ab3LTV1T (ORCPT ); Fri, 20 Dec 2013 16:27:19 -0500 Received: by mail-we0-f179.google.com with SMTP id q59so2958147wes.24 for ; Fri, 20 Dec 2013 13:27:18 -0800 (PST) In-Reply-To: <1387565251-7051-10-git-send-email-b.zolnierkie@samsung.com> Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: Bartlomiej Zolnierkiewicz , rjw@rjwysocki.net Cc: lenb@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kyungmin.park@samsung.com 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 > Signed-off-by: Kyungmin Park Acked-by: Daniel Lezcano > --- > 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 =3D drv->state_count; > - > ret =3D 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 =3D cpuidle_get_cpu_driver(device); > > /* state statistics */ > - for (i =3D 0; i < device->state_count; i++) { > + for (i =3D 0; i < drv->state_count; i++) { > kobj =3D 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 *devic= e) > { > + struct cpuidle_driver *drv =3D cpuidle_get_cpu_driver(device); > int i; > > - for (i =3D 0; i < device->state_count; i++) > + for (i =3D 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; > --=20 Linaro.org =E2=94=82 Open source software fo= r ARM SoCs =46ollow Linaro: Facebook | Twitter | Blog