linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thara Gopinath <thara.gopinath@linaro.org>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Kevin Hilman <khilman@kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>
Subject: Re: [PATCH V3 2/2] PM / Domains: Extend generic power domain debugfs.
Date: Tue, 11 Jul 2017 17:30:26 -0400	[thread overview]
Message-ID: <59654372.3090300@linaro.org> (raw)
In-Reply-To: <CAPDyKFoFhegBOEbw6YHJK+AG7dmPFh9nY-pt+7q27ZSN-JkejA@mail.gmail.com>

On 07/11/2017 05:06 AM, Ulf Hansson wrote:
> On 23 June 2017 at 18:32, Thara Gopinath <thara.gopinath@linaro.org> wrote:
>> This patch extends the existing generic power domain debugfs.
>> Changes involve the following
>> - Introduce a unique debugfs entry for each generic power domain with the
>>   following attributes
>>         - current_state - Displays current state of the domain.
>>         - devices - Displays the devices associated with this domain.
>>         - sub_domains - Displays the sub power domains.
>>         - active_time - Displays the time the domain was in active state
>>                         in ms.
>>         - total_idle_time - Displays the time the domain was in any of the idle
>>                         states in ms.
>>         - idle_states - Displays the various idle states and the time
>>                         spent in each idle state in ms.
>>
>> Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
>> ---
>>  drivers/base/power/domain.c | 205 ++++++++++++++++++++++++++++++++++++++++++--
>>  1 file changed, 197 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
>> index 40768cc..a10f789 100644
>> --- a/drivers/base/power/domain.c
>> +++ b/drivers/base/power/domain.c
>> @@ -2328,21 +2328,191 @@ static int pm_genpd_summary_show(struct seq_file *s, void *data)
>>         return ret;
>>  }
>>
>> -static int pm_genpd_summary_open(struct inode *inode, struct file *file)
>> +static int pm_genpd_status_show(struct seq_file *s, void *data)
> 
> Naming rules for static functions in genpd should have genpd_* as
> prefix and not pm_genpd_* as those are for exported APIs.
> 
> There still some static functions that doesn't follow that rule, but
> please don't add more. Following applies to all new functions adding
> in this change.
> 
>>  {
>> -       return single_open(file, pm_genpd_summary_show, NULL);
>> +       static const char * const status_lookup[] = {
>> +               [GPD_STATE_ACTIVE] = "on",
>> +               [GPD_STATE_POWER_OFF] = "off"
>> +       };
>> +
>> +       struct generic_pm_domain *genpd = s->private;
>> +       int ret = 0;
>> +
>> +       ret = genpd_lock_interruptible(genpd);
>> +       if (ret)
>> +               return -ERESTARTSYS;
>> +
>> +       if (WARN_ON_ONCE(genpd->status >= ARRAY_SIZE(status_lookup)))
>> +               goto exit;
>> +
>> +       if (genpd->status == GPD_STATE_POWER_OFF)
>> +               seq_printf(s, "%s-%u\n", status_lookup[genpd->status],
>> +                       genpd->state_idx);
>> +       else
>> +               seq_printf(s, "%s\n", status_lookup[genpd->status]);
>> +exit:
>> +       genpd_unlock(genpd);
>> +       return ret;
>>  }
>>
> 
> [...]
> 
> Fixing the nitpick above, then you may add my ack.

Thanks Ulf for the review. I will fix the above and resend
the series with your ack.

-- 
Regards
Thara

      reply	other threads:[~2017-07-11 21:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-23 16:32 [PATCH V3 0/2] PM / Domains: Expand generic power domain debugfs Thara Gopinath
2017-06-23 16:32 ` [PATCH V3 1/2] PM / Domains: Add time accounting to various genpd states Thara Gopinath
2017-07-11  9:06   ` Ulf Hansson
2017-06-23 16:32 ` [PATCH V3 2/2] PM / Domains: Extend generic power domain debugfs Thara Gopinath
2017-07-11  9:06   ` Ulf Hansson
2017-07-11 21:30     ` Thara Gopinath [this message]

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=59654372.3090300@linaro.org \
    --to=thara.gopinath@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=khilman@kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=ulf.hansson@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;
as well as URLs for NNTP newsgroup(s).