Message ID | 1474361863-2319-2-git-send-email-axel.lin@ingics.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
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. Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
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. Axel -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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.
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;
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(-)