* [PATCH v2] power: Replace printks with dev_* and pr_* routines
@ 2013-11-19 18:46 Shuah Khan
2013-11-19 18:53 ` Joe Perches
0 siblings, 1 reply; 6+ messages in thread
From: Shuah Khan @ 2013-11-19 18:46 UTC (permalink / raw)
To: len.brown, pavel, gregkh, rjw, joe
Cc: Shuah Khan, linux-pm, linux-kernel, shuahkhan
Replaced printks with dev_* and pr_* routines. Replacing printk in
__suspend_report_result() will require passing in struct device *
pointer from calling routines and this will require changes to
external interface suspend_report_result() which is used by several
drivers. Hence, this one instance is replaced by pr_err().
Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
---
drivers/base/power/main.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 9f098a8..3f42c43 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -349,8 +349,8 @@ static void pm_dev_dbg(struct device *dev, pm_message_t state, char *info)
static void pm_dev_err(struct device *dev, pm_message_t state, char *info,
int error)
{
- printk(KERN_ERR "PM: Device %s failed to %s%s: error %d\n",
- dev_name(dev), pm_verb(state.event), info, error);
+ dev_err(dev, "PM: failed to %s%s: error %d\n",
+ pm_verb(state.event), info, error);
}
static void dpm_show_time(ktime_t starttime, pm_message_t state, char *info)
@@ -1308,9 +1308,8 @@ int dpm_prepare(pm_message_t state)
error = 0;
continue;
}
- printk(KERN_INFO "PM: Device %s not prepared "
- "for power transition: code %d\n",
- dev_name(dev), error);
+ dev_info("PM: not prepared for power transition: ",
+ "code %d\n", error);
put_device(dev);
break;
}
@@ -1347,7 +1346,7 @@ EXPORT_SYMBOL_GPL(dpm_suspend_start);
void __suspend_report_result(const char *function, void *fn, int ret)
{
if (ret)
- printk(KERN_ERR "%s(): %pF returns %d\n", function, fn, ret);
+ pr_err("%s(): %pF returns %d\n", function, fn, ret);
}
EXPORT_SYMBOL_GPL(__suspend_report_result);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] power: Replace printks with dev_* and pr_* routines
2013-11-19 18:46 [PATCH v2] power: Replace printks with dev_* and pr_* routines Shuah Khan
@ 2013-11-19 18:53 ` Joe Perches
2013-11-19 18:57 ` Shuah Khan
0 siblings, 1 reply; 6+ messages in thread
From: Joe Perches @ 2013-11-19 18:53 UTC (permalink / raw)
To: Shuah Khan
Cc: len.brown, pavel, gregkh, rjw, linux-pm, linux-kernel, shuahkhan
On Tue, 2013-11-19 at 11:46 -0700, Shuah Khan wrote:
> Replaced printks with dev_* and pr_* routines. Replacing printk in
> __suspend_report_result() will require passing in struct device *
> pointer from calling routines and this will require changes to
> external interface suspend_report_result() which is used by several
> drivers. Hence, this one instance is replaced by pr_err().
[]
> diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
[]
> @@ -1308,9 +1308,8 @@ int dpm_prepare(pm_message_t state)
> error = 0;
> continue;
> }
> - printk(KERN_INFO "PM: Device %s not prepared "
> - "for power transition: code %d\n",
> - dev_name(dev), error);
> + dev_info("PM: not prepared for power transition: ",
> + "code %d\n", error);
Shuah, you have to make sure the files modified by
your patches compile successfully before sending
patches like this.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] power: Replace printks with dev_* and pr_* routines
2013-11-19 18:53 ` Joe Perches
@ 2013-11-19 18:57 ` Shuah Khan
2013-11-19 19:07 ` Joe Perches
2013-11-19 22:59 ` Greg KH
0 siblings, 2 replies; 6+ messages in thread
From: Shuah Khan @ 2013-11-19 18:57 UTC (permalink / raw)
To: Joe Perches
Cc: len.brown, pavel, gregkh, rjw, linux-pm, linux-kernel, shuahkhan,
Shuah Khan
On 11/19/2013 11:53 AM, Joe Perches wrote:
> On Tue, 2013-11-19 at 11:46 -0700, Shuah Khan wrote:
>> Replaced printks with dev_* and pr_* routines. Replacing printk in
>> __suspend_report_result() will require passing in struct device *
>> pointer from calling routines and this will require changes to
>> external interface suspend_report_result() which is used by several
>> drivers. Hence, this one instance is replaced by pr_err().
> []
>> diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
> []
>> @@ -1308,9 +1308,8 @@ int dpm_prepare(pm_message_t state)
>> error = 0;
>> continue;
>> }
>> - printk(KERN_INFO "PM: Device %s not prepared "
>> - "for power transition: code %d\n",
>> - dev_name(dev), error);
>> + dev_info("PM: not prepared for power transition: ",
>> + "code %d\n", error);
>
> Shuah, you have to make sure the files modified by
> your patches compile successfully before sending
> patches like this.
>
>
Oops. I did compile. Missed the warning. Sorry about that.
-- Shuah
--
Shuah Khan
Senior Linux Kernel Developer - Open Source Group
Samsung Research America(Silicon Valley)
shuah.kh@samsung.com | (970) 672-0658
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] power: Replace printks with dev_* and pr_* routines
2013-11-19 18:57 ` Shuah Khan
@ 2013-11-19 19:07 ` Joe Perches
2013-11-19 20:00 ` Shuah Khan
2013-11-19 22:59 ` Greg KH
1 sibling, 1 reply; 6+ messages in thread
From: Joe Perches @ 2013-11-19 19:07 UTC (permalink / raw)
To: shuah.kh; +Cc: len.brown, pavel, gregkh, rjw, linux-pm, linux-kernel, shuahkhan
On Tue, 2013-11-19 at 11:57 -0700, Shuah Khan wrote:
> On 11/19/2013 11:53 AM, Joe Perches wrote:
> > On Tue, 2013-11-19 at 11:46 -0700, Shuah Khan wrote:
> >> Replaced printks with dev_* and pr_* routines. Replacing printk in
> >> __suspend_report_result() will require passing in struct device *
> >> pointer from calling routines and this will require changes to
> >> external interface suspend_report_result() which is used by several
> >> drivers. Hence, this one instance is replaced by pr_err().
> > []
> >> diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
> > []
> >> @@ -1308,9 +1308,8 @@ int dpm_prepare(pm_message_t state)
> >> error = 0;
> >> continue;
> >> }
> >> - printk(KERN_INFO "PM: Device %s not prepared "
> >> - "for power transition: code %d\n",
> >> - dev_name(dev), error);
> >> + dev_info("PM: not prepared for power transition: ",
> >> + "code %d\n", error);
> >
> > Shuah, you have to make sure the files modified by
> > your patches compile successfully before sending
> > patches like this.
> Oops. I did compile. Missed the warning. Sorry about that.
btw:
When you're doing patches like this, not bugfixes,
not something that's going to be applied to current
or stable, please make them against -next and not
against Linus' tree.
Also, I would make the larger change that modifies
all the drivers like I suggested. What you've done
I think is a half-measure and is incomplete.
cheers, Joe
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] power: Replace printks with dev_* and pr_* routines
2013-11-19 19:07 ` Joe Perches
@ 2013-11-19 20:00 ` Shuah Khan
0 siblings, 0 replies; 6+ messages in thread
From: Shuah Khan @ 2013-11-19 20:00 UTC (permalink / raw)
To: Joe Perches
Cc: len.brown, pavel, gregkh, rjw, linux-pm, linux-kernel, shuahkhan,
Shuah Khan
On 11/19/2013 12:07 PM, Joe Perches wrote:
> On Tue, 2013-11-19 at 11:57 -0700, Shuah Khan wrote:
>> On 11/19/2013 11:53 AM, Joe Perches wrote:
>>> On Tue, 2013-11-19 at 11:46 -0700, Shuah Khan wrote:
>>>> Replaced printks with dev_* and pr_* routines. Replacing printk in
>>>> __suspend_report_result() will require passing in struct device *
>>>> pointer from calling routines and this will require changes to
>>>> external interface suspend_report_result() which is used by several
>>>> drivers. Hence, this one instance is replaced by pr_err().
>>> []
>>>> diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
>>> []
>>>> @@ -1308,9 +1308,8 @@ int dpm_prepare(pm_message_t state)
>>>> error = 0;
>>>> continue;
>>>> }
>>>> - printk(KERN_INFO "PM: Device %s not prepared "
>>>> - "for power transition: code %d\n",
>>>> - dev_name(dev), error);
>>>> + dev_info("PM: not prepared for power transition: ",
>>>> + "code %d\n", error);
>>>
>>> Shuah, you have to make sure the files modified by
>>> your patches compile successfully before sending
>>> patches like this.
>> Oops. I did compile. Missed the warning. Sorry about that.
>
> btw:
>
> When you're doing patches like this, not bugfixes,
> not something that's going to be applied to current
> or stable, please make them against -next and not
> against Linus' tree.
ok. Makes sense changes like this don't need to be rushed. They could
use soak time in linux-next.
>
> Also, I would make the larger change that modifies
> all the drivers like I suggested. What you've done
> I think is a half-measure and is incomplete.
>
I was a bit reluctant to change all the drivers since the original
message didn't include device information. However, adding device
information would make this message more useful.
I will re-do the patch to make the larger change.
-- Shuah
--
Shuah Khan
Senior Linux Kernel Developer - Open Source Group
Samsung Research America(Silicon Valley)
shuah.kh@samsung.com | (970) 672-0658
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] power: Replace printks with dev_* and pr_* routines
2013-11-19 18:57 ` Shuah Khan
2013-11-19 19:07 ` Joe Perches
@ 2013-11-19 22:59 ` Greg KH
1 sibling, 0 replies; 6+ messages in thread
From: Greg KH @ 2013-11-19 22:59 UTC (permalink / raw)
To: Shuah Khan
Cc: Joe Perches, len.brown, pavel, rjw, linux-pm, linux-kernel,
shuahkhan
On Tue, Nov 19, 2013 at 11:57:22AM -0700, Shuah Khan wrote:
> On 11/19/2013 11:53 AM, Joe Perches wrote:
> > On Tue, 2013-11-19 at 11:46 -0700, Shuah Khan wrote:
> >> Replaced printks with dev_* and pr_* routines. Replacing printk in
> >> __suspend_report_result() will require passing in struct device *
> >> pointer from calling routines and this will require changes to
> >> external interface suspend_report_result() which is used by several
> >> drivers. Hence, this one instance is replaced by pr_err().
> > []
> >> diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
> > []
> >> @@ -1308,9 +1308,8 @@ int dpm_prepare(pm_message_t state)
> >> error = 0;
> >> continue;
> >> }
> >> - printk(KERN_INFO "PM: Device %s not prepared "
> >> - "for power transition: code %d\n",
> >> - dev_name(dev), error);
> >> + dev_info("PM: not prepared for power transition: ",
> >> + "code %d\n", error);
> >
> > Shuah, you have to make sure the files modified by
> > your patches compile successfully before sending
> > patches like this.
> >
> >
>
> Oops. I did compile. Missed the warning. Sorry about that.
It should be an "error"...
It adds a codingstyle warning as well, so fix that up for the next
version please :)
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-11-19 22:59 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-19 18:46 [PATCH v2] power: Replace printks with dev_* and pr_* routines Shuah Khan
2013-11-19 18:53 ` Joe Perches
2013-11-19 18:57 ` Shuah Khan
2013-11-19 19:07 ` Joe Perches
2013-11-19 20:00 ` Shuah Khan
2013-11-19 22:59 ` Greg KH
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).