From: Chanwoo Choi <cw00.choi@samsung.com>
To: Axel Lin <axel.lin@ingics.com>
Cc: "Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
MyungJoo Ham <myungjoo.ham@samsung.com>,
Kyungmin Park <kyungmin.park@samsung.com>,
linux-pm@vger.kernel.org,
"linux-samsung-soc@vger.kernel.org"
<linux-samsung-soc@vger.kernel.org>
Subject: Re: [PATCH 2/2] PM / devfreq: exynos-nocp: Remove redundant code to reset load_count/total_count
Date: Tue, 20 Sep 2016 18:43:48 +0900 [thread overview]
Message-ID: <57E104D4.5070604@samsung.com> (raw)
In-Reply-To: <CAFRkauDTy2Nnv-wihOVNKaBSHy7H9EiXXKXGHuWfCLQU08xJeg@mail.gmail.com>
On 2016년 09월 20일 18:38, Axel Lin wrote:
> 2016-09-20 17:34 GMT+08:00 Chanwoo Choi <cw00.choi@samsung.com>:
>> Hi,
>>
>> On 2016년 09월 20일 17:57, Axel Lin wrote:
>>> This is done by devfreq_event_get_event() so remove the redundant code in
>>> exynos_nocp_get_event().
>>>
>>> Signed-off-by: Axel Lin <axel.lin@ingics.com>
>>> ---
>>> drivers/devfreq/event/exynos-nocp.c | 3 ---
>>> 1 file changed, 3 deletions(-)
>>>
>>> diff --git a/drivers/devfreq/event/exynos-nocp.c b/drivers/devfreq/event/exynos-nocp.c
>>> index a584140..49e712a 100644
>>> --- a/drivers/devfreq/event/exynos-nocp.c
>>> +++ b/drivers/devfreq/event/exynos-nocp.c
>>> @@ -176,9 +176,6 @@ static int exynos_nocp_get_event(struct devfreq_event_dev *edev,
>>> return 0;
>>>
>>> out:
>>> - edata->load_count = 0;
>>> - edata->total_count = 0;
>>> -
>>> dev_err(nocp->dev, "Failed to read the counter of NoC probe device\n");
>>>
>>> return ret;
>>>
>>
>> As you said, devfreq_event_get_event() initializes both load_count and total_count
>> before calling edev->desc->ops->get_event(). Looks good to me.
>
> Actually, the point is if edev->desc->ops->get_event() fails,
> the code in devfreq_event_get_event() will reset
> edata->total_count and edata->load_count to 0.
You're right. devfreq_event_get_event() initializes the data
when before calling edev->desc->ops->get_event() or fail happen.
--
Best Regards,
Chanwoo Choi
next prev parent reply other threads:[~2016-09-20 9:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20160920085823epcas1p1f0fed4f248efcccccbce71438c03a9a1@epcas1p1.samsung.com>
2016-09-20 8:57 ` [PATCH 1/2] PM / devfreq: exynos-nocp: Select REGMAP_MMIO Axel Lin
2016-09-20 8:57 ` [PATCH 2/2] PM / devfreq: exynos-nocp: Remove redundant code to reset load_count/total_count Axel Lin
2016-09-20 9:34 ` Chanwoo Choi
2016-09-20 9:38 ` Axel Lin
2016-09-20 9:43 ` Chanwoo Choi [this message]
2016-09-20 9:30 ` [PATCH 1/2] PM / devfreq: exynos-nocp: Select REGMAP_MMIO Chanwoo Choi
2016-09-30 14:11 ` MyungJoo Ham
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=57E104D4.5070604@samsung.com \
--to=cw00.choi@samsung.com \
--cc=axel.lin@ingics.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-pm@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
--cc=rafael.j.wysocki@intel.com \
/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