From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Lists linaro-kernel <linaro-kernel@lists.linaro.org>,
Patch Tracking <patches@linaro.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Daniel Lezcano <daniel.lezcano@linaro.org>
Subject: Re: [PATCH V2 13/16] cpuidle: free all state kobjects from cpuidle_free_state_kobj()
Date: Thu, 21 Nov 2013 02:05:06 +0100 [thread overview]
Message-ID: <7256587.cI3URDaS0R@vostro.rjw.lan> (raw)
In-Reply-To: <CAKohpokQh_Awj2tzhFbqzv8u4zQ2WV0QZP0Sq1tqVQBYemW+gA@mail.gmail.com>
On Wednesday, November 20, 2013 01:33:53 PM Viresh Kumar wrote:
> Fixing Rafael's email id..
>
> On 20 November 2013 13:33, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> > On 3 October 2013 21:26, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> >> Loop for states is currently present on callers side and so is replicated at
> >> several places. It would be better to move that inside cpuidle_free_state_kobj()
> >> instead.
> >>
> >> This patch does it.
> >>
> >> Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> >> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> >> ---
> >> drivers/cpuidle/sysfs.c | 23 ++++++++++++-----------
> >> 1 file changed, 12 insertions(+), 11 deletions(-)
> >
> > Hi Rafael,
> >
> > You missed applying this one?
I might. Care to resend?
> >> diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
> >> index e918b6d..ade31a9 100644
> >> --- a/drivers/cpuidle/sysfs.c
> >> +++ b/drivers/cpuidle/sysfs.c
> >> @@ -378,12 +378,17 @@ static struct kobj_type ktype_state_cpuidle = {
> >> .release = cpuidle_state_sysfs_release,
> >> };
> >>
> >> -static inline void cpuidle_free_state_kobj(struct cpuidle_device *device, int i)
> >> +static inline void cpuidle_free_state_kobj(struct cpuidle_device *device,
> >> + int count)
> >> {
> >> - kobject_put(&device->kobjs[i]->kobj);
> >> - wait_for_completion(&device->kobjs[i]->kobj_unregister);
> >> - kfree(device->kobjs[i]);
> >> - device->kobjs[i] = NULL;
> >> + int i;
> >> +
> >> + for (i = 0; i < count; i++) {
> >> + kobject_put(&device->kobjs[i]->kobj);
> >> + wait_for_completion(&device->kobjs[i]->kobj_unregister);
> >> + kfree(device->kobjs[i]);
> >> + device->kobjs[i] = NULL;
> >> + }
> >> }
> >>
> >> /**
> >> @@ -419,8 +424,7 @@ static int cpuidle_add_state_sysfs(struct cpuidle_device *device)
> >> return 0;
> >>
> >> error_state:
> >> - for (i = i - 1; i >= 0; i--)
> >> - cpuidle_free_state_kobj(device, i);
> >> + cpuidle_free_state_kobj(device, i);
> >> return ret;
> >> }
> >>
> >> @@ -430,10 +434,7 @@ error_state:
> >> */
> >> static void cpuidle_remove_state_sysfs(struct cpuidle_device *device)
> >> {
> >> - int i;
> >> -
> >> - for (i = 0; i < device->state_count; i++)
> >> - cpuidle_free_state_kobj(device, i);
> >> + cpuidle_free_state_kobj(device, device->state_count);
> >> }
> >>
> >> #ifdef CONFIG_CPU_IDLE_MULTIPLE_DRIVERS
> >> --
> >> 1.7.12.rc2.18.g61b472e
> >>
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
next prev parent reply other threads:[~2013-11-21 0:52 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-03 15:56 [PATCH V2 00/16] CPUIdle: Minor cleanups for 3.13 Viresh Kumar
2013-10-03 15:56 ` [PATCH V2 01/16] cpuidle: fix indentation of cpumask Viresh Kumar
2013-10-03 15:56 ` [PATCH V2 02/16] cpuidle: Fix comments in cpuidle core Viresh Kumar
2013-10-03 15:56 ` [PATCH V2 03/16] cpuidle: make __cpuidle_get_cpu_driver() inline Viresh Kumar
2013-10-03 20:14 ` Paul Walmsley
2013-10-03 15:56 ` [PATCH V2 04/16] cpuidle: make __cpuidle_device_init() return void Viresh Kumar
2013-10-03 15:56 ` [PATCH V2 05/16] cpuidle: make __cpuidle_driver_init() " Viresh Kumar
2013-10-03 15:56 ` [PATCH V2 06/16] cpuidle: rearrange code in __cpuidle_driver_init() Viresh Kumar
2013-10-03 15:56 ` [PATCH V2 07/16] cpuidle: rearrange __cpuidle_register_device() to keep minimal exit points Viresh Kumar
2013-10-03 15:56 ` [PATCH V2 08/16] cpuidle: merge two if() statements for checking error cases Viresh Kumar
2013-10-03 15:56 ` [PATCH V2 09/16] cpuidle: reduce code duplication inside cpuidle_idle_call() Viresh Kumar
2013-10-03 15:56 ` [PATCH V2 10/16] cpuidle: replace multiline statements with single line in cpuidle_idle_call() Viresh Kumar
2013-10-03 15:56 ` [PATCH V2 11/16] cpuidle: call cpuidle_get_driver() from after taking cpuidle_driver_lock Viresh Kumar
2013-10-03 15:56 ` [PATCH V2 12/16] cpuidle: use drv instead of cpuidle_driver in show_current_driver() Viresh Kumar
2013-10-03 15:56 ` [PATCH V2 13/16] cpuidle: free all state kobjects from cpuidle_free_state_kobj() Viresh Kumar
2013-11-20 8:03 ` Viresh Kumar
2013-11-20 8:03 ` Viresh Kumar
2013-11-21 1:05 ` Rafael J. Wysocki [this message]
2013-11-21 3:24 ` Viresh Kumar
2013-10-03 15:56 ` [PATCH V2 14/16] cpuidle: don't calculate time-diff if entered_state < 0 Viresh Kumar
2013-11-20 8:04 ` Viresh Kumar
2013-11-21 1:06 ` Rafael J. Wysocki
2013-10-03 15:56 ` [PATCH V2 15/16] cpuidle: don't call poll_idle_init() for every cpu Viresh Kumar
2013-10-03 15:56 ` [PATCH V2 16/16] cpuidle: remove cpuidle_unregister_governor() Viresh Kumar
2013-10-03 21:07 ` [PATCH V2 00/16] CPUIdle: Minor cleanups for 3.13 Kevin Hilman
2013-10-04 5:23 ` Viresh Kumar
2013-10-23 5:41 ` Viresh Kumar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7256587.cI3URDaS0R@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=daniel.lezcano@linaro.org \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=patches@linaro.org \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®