Linux-Samsung-soc Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] PM / devfreq: exynos-bus: Add error log when get event fails
@ 2019-12-23 19:19 ` Yangtao Li
  2019-12-24  4:07   ` Chanwoo Choi
  0 siblings, 1 reply; 4+ messages in thread
From: Yangtao Li @ 2019-12-23 19:19 UTC (permalink / raw)
  To: cw00.choi, myungjoo.ham, kyungmin.park, kgene, krzk
  Cc: linux-pm, linux-samsung-soc, linux-arm-kernel, linux-kernel, Yangtao Li

Adding an error log makes it easier to trace the function's error path.
Because the error code may be rewritten on return, print error code here.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 drivers/devfreq/exynos-bus.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
index 948e9340f91c..634d63fd00ea 100644
--- a/drivers/devfreq/exynos-bus.c
+++ b/drivers/devfreq/exynos-bus.c
@@ -126,6 +126,8 @@ static int exynos_bus_get_dev_status(struct device *dev,
 
 	ret = exynos_bus_get_event(bus, &edata);
 	if (ret < 0) {
+		dev_err(dev, "failed to get event from devfreq-event devices %d\n",
+			ret);
 		stat->total_time = stat->busy_time = 0;
 		goto err;
 	}
-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] PM / devfreq: exynos-bus: Add error log when get event fails
  2019-12-23 19:19 ` [PATCH] PM / devfreq: exynos-bus: Add error log when get event fails Yangtao Li
@ 2019-12-24  4:07   ` Chanwoo Choi
  2019-12-24 14:51     ` Frank Lee
  0 siblings, 1 reply; 4+ messages in thread
From: Chanwoo Choi @ 2019-12-24  4:07 UTC (permalink / raw)
  To: Yangtao Li, myungjoo.ham, kyungmin.park, kgene, krzk
  Cc: linux-pm, linux-samsung-soc, linux-arm-kernel, linux-kernel

Hi,

I think that you better to use 'devfreq-event' instead of just 'event'
as following:

PM / devfreq: exynos-bus: Add error log when fail to get devfreq-event

On 12/24/19 4:19 AM, Yangtao Li wrote:
> Adding an error log makes it easier to trace the function's error path.
> Because the error code may be rewritten on return, print error code here.
> 
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> ---
>  drivers/devfreq/exynos-bus.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
> index 948e9340f91c..634d63fd00ea 100644
> --- a/drivers/devfreq/exynos-bus.c
> +++ b/drivers/devfreq/exynos-bus.c
> @@ -126,6 +126,8 @@ static int exynos_bus_get_dev_status(struct device *dev,
>  
>  	ret = exynos_bus_get_event(bus, &edata);
>  	if (ret < 0) {
> +		dev_err(dev, "failed to get event from devfreq-event devices %d\n",
> +			ret);

Better to make it under 80 char as following:

diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
index f5d4c369c7fb..10f4fa1a0363 100644
--- a/drivers/devfreq/exynos-bus.c
+++ b/drivers/devfreq/exynos-bus.c
@@ -126,7 +126,8 @@ static int exynos_bus_get_dev_status(struct device *dev,
 
        ret = exynos_bus_get_event(bus, &edata);
        if (ret < 0) {
-               dev_err(dev, "failed to get event from devfreq-event devices %d\n",
+               dev_err(dev,
+                       "failed to get event from devfreq-event devices %d\n",
                        ret);
                stat->total_time = stat->busy_time = 0;
                goto err;


>  		stat->total_time = stat->busy_time = 0;
>  		goto err;
>  	}
> 


-- 
Best Regards,
Chanwoo Choi
Samsung Electronics

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] PM / devfreq: exynos-bus: Add error log when get event fails
  2019-12-24  4:07   ` Chanwoo Choi
@ 2019-12-24 14:51     ` Frank Lee
  2019-12-26  1:28       ` Chanwoo Choi
  0 siblings, 1 reply; 4+ messages in thread
From: Frank Lee @ 2019-12-24 14:51 UTC (permalink / raw)
  To: Chanwoo Choi
  Cc: MyungJoo Ham, Kyungmin Park, Kukjin Kim, Krzysztof Kozlowski,
	Linux PM, linux-samsung-soc, Linux ARM,
	Linux Kernel Mailing List

On Tue, Dec 24, 2019 at 12:00 PM Chanwoo Choi <cw00.choi@samsung.com> wrote:
>
> Hi,
>
> I think that you better to use 'devfreq-event' instead of just 'event'
> as following:
>
> PM / devfreq: exynos-bus: Add error log when fail to get devfreq-event
>
> On 12/24/19 4:19 AM, Yangtao Li wrote:
> > Adding an error log makes it easier to trace the function's error path.
> > Because the error code may be rewritten on return, print error code here.
> >
> > Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> > ---
> >  drivers/devfreq/exynos-bus.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
> > index 948e9340f91c..634d63fd00ea 100644
> > --- a/drivers/devfreq/exynos-bus.c
> > +++ b/drivers/devfreq/exynos-bus.c
> > @@ -126,6 +126,8 @@ static int exynos_bus_get_dev_status(struct device *dev,
> >
> >       ret = exynos_bus_get_event(bus, &edata);
> >       if (ret < 0) {
> > +             dev_err(dev, "failed to get event from devfreq-event devices %d\n",
> > +                     ret);

Emmm, it looks a bit strange to me...
V2 has been sent.

Yours,
Yangtao


>
> Better to make it under 80 char as following:
>
> diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
> index f5d4c369c7fb..10f4fa1a0363 100644
> --- a/drivers/devfreq/exynos-bus.c
> +++ b/drivers/devfreq/exynos-bus.c
> @@ -126,7 +126,8 @@ static int exynos_bus_get_dev_status(struct device *dev,
>
>         ret = exynos_bus_get_event(bus, &edata);
>         if (ret < 0) {
> -               dev_err(dev, "failed to get event from devfreq-event devices %d\n",
> +               dev_err(dev,
> +                       "failed to get event from devfreq-event devices %d\n",
>                         ret);
>                 stat->total_time = stat->busy_time = 0;
>                 goto err;
>
>
> >               stat->total_time = stat->busy_time = 0;
> >               goto err;
> >       }
> >
>
>
> --
> Best Regards,
> Chanwoo Choi
> Samsung Electronics

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] PM / devfreq: exynos-bus: Add error log when get event fails
  2019-12-24 14:51     ` Frank Lee
@ 2019-12-26  1:28       ` Chanwoo Choi
  0 siblings, 0 replies; 4+ messages in thread
From: Chanwoo Choi @ 2019-12-26  1:28 UTC (permalink / raw)
  To: Frank Lee
  Cc: MyungJoo Ham, Kyungmin Park, Kukjin Kim, Krzysztof Kozlowski,
	Linux PM, linux-samsung-soc, Linux ARM,
	Linux Kernel Mailing List

On 12/24/19 11:51 PM, Frank Lee wrote:
> On Tue, Dec 24, 2019 at 12:00 PM Chanwoo Choi <cw00.choi@samsung.com> wrote:
>>
>> Hi,
>>
>> I think that you better to use 'devfreq-event' instead of just 'event'
>> as following:
>>
>> PM / devfreq: exynos-bus: Add error log when fail to get devfreq-event
>>
>> On 12/24/19 4:19 AM, Yangtao Li wrote:
>>> Adding an error log makes it easier to trace the function's error path.
>>> Because the error code may be rewritten on return, print error code here.
>>>
>>> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
>>> ---
>>>  drivers/devfreq/exynos-bus.c | 2 ++
>>>  1 file changed, 2 insertions(+)
>>>
>>> diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
>>> index 948e9340f91c..634d63fd00ea 100644
>>> --- a/drivers/devfreq/exynos-bus.c
>>> +++ b/drivers/devfreq/exynos-bus.c
>>> @@ -126,6 +126,8 @@ static int exynos_bus_get_dev_status(struct device *dev,
>>>
>>>       ret = exynos_bus_get_event(bus, &edata);
>>>       if (ret < 0) {
>>> +             dev_err(dev, "failed to get event from devfreq-event devices %d\n",
>>> +                     ret);
> 
> Emmm, it looks a bit strange to me...

If don't show the error value, it is possible to make it
until 81 char. I edit it as following and applied it with
modified patch title.

diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
index 1259a0da7db7..8fa8eb541373 100644
--- a/drivers/devfreq/exynos-bus.c
+++ b/drivers/devfreq/exynos-bus.c
@@ -126,6 +126,7 @@ static int exynos_bus_get_dev_status(struct device *dev,

        ret = exynos_bus_get_event(bus, &edata);
        if (ret < 0) {
+               dev_err(dev, "failed to get event from devfreq-event devices\n");
                stat->total_time = stat->busy_time = 0;
                goto err;
        }

> V2 has been sent.
> 
> Yours,
> Yangtao
> 
> 
>>
>> Better to make it under 80 char as following:
>>
>> diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
>> index f5d4c369c7fb..10f4fa1a0363 100644
>> --- a/drivers/devfreq/exynos-bus.c
>> +++ b/drivers/devfreq/exynos-bus.c
>> @@ -126,7 +126,8 @@ static int exynos_bus_get_dev_status(struct device *dev,
>>
>>         ret = exynos_bus_get_event(bus, &edata);
>>         if (ret < 0) {
>> -               dev_err(dev, "failed to get event from devfreq-event devices %d\n",
>> +               dev_err(dev,
>> +                       "failed to get event from devfreq-event devices %d\n",
>>                         ret);
>>                 stat->total_time = stat->busy_time = 0;
>>                 goto err;
>>
>>
>>>               stat->total_time = stat->busy_time = 0;
>>>               goto err;
>>>       }
>>>
>>
>>
>> --
>> Best Regards,
>> Chanwoo Choi
>> Samsung Electronics
> 
> 


-- 
Best Regards,
Chanwoo Choi
Samsung Electronics

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20191223191928epcas1p128d39bb875b8654d61ae21364e466ec7@epcas1p1.samsung.com>
2019-12-23 19:19 ` [PATCH] PM / devfreq: exynos-bus: Add error log when get event fails Yangtao Li
2019-12-24  4:07   ` Chanwoo Choi
2019-12-24 14:51     ` Frank Lee
2019-12-26  1:28       ` Chanwoo Choi

Linux-Samsung-soc Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-samsung-soc/0 linux-samsung-soc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-samsung-soc linux-samsung-soc/ https://lore.kernel.org/linux-samsung-soc \
		linux-samsung-soc@vger.kernel.org
	public-inbox-index linux-samsung-soc

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-samsung-soc


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git