* [PATCH 1/2] driver core: printk to pr_*
@ 2019-04-12 15:47 Willy Wolff
2019-04-13 16:57 ` Joe Perches
2019-04-16 13:39 ` Greg Kroah-Hartman
0 siblings, 2 replies; 3+ messages in thread
From: Willy Wolff @ 2019-04-12 15:47 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rafael J. Wysocki, linux-kernel
Signed-off-by: Willy Wolff <willy.mh.wolff.ml@gmail.com>
---
drivers/base/dd.c | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index a823f469e53f..1bc4557a0f49 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -328,7 +328,7 @@ bool device_is_bound(struct device *dev)
static void driver_bound(struct device *dev)
{
if (device_is_bound(dev)) {
- printk(KERN_WARNING "%s: device %s already bound\n",
+ pr_warn("%s: device %s already bound\n",
__func__, kobject_name(&dev->kobj));
return;
}
@@ -494,8 +494,8 @@ static int really_probe(struct device *dev, struct device_driver *drv)
}
if (driver_sysfs_add(dev)) {
- printk(KERN_ERR "%s: driver_sysfs_add(%s) failed\n",
- __func__, dev_name(dev));
+ pr_err("%s: driver_sysfs_add(%s) failed\n",
+ __func__, dev_name(dev));
goto probe_failed;
}
@@ -575,9 +575,8 @@ static int really_probe(struct device *dev, struct device_driver *drv)
break;
default:
/* driver matched but the probe failed */
- printk(KERN_WARNING
- "%s: probe of %s failed with error %d\n",
- drv->name, dev_name(dev), ret);
+ pr_warn("%s: probe of %s failed with error %d\n",
+ drv->name, dev_name(dev), ret);
}
/*
* Ignore errors returned by ->probe so that the next driver can try
@@ -602,8 +601,8 @@ static int really_probe_debug(struct device *dev, struct device_driver *drv)
ret = really_probe(dev, drv);
rettime = ktime_get();
delta = ktime_sub(rettime, calltime);
- printk(KERN_DEBUG "probe of %s returned %d after %lld usecs\n",
- dev_name(dev), ret, (s64) ktime_to_us(delta));
+ pr_debug("probe of %s returned %d after %lld usecs\n",
+ dev_name(dev), ret, (s64) ktime_to_us(delta));
return ret;
}
@@ -687,8 +686,7 @@ static inline bool cmdline_requested_async_probing(const char *drv_name)
static int __init save_async_options(char *buf)
{
if (strlen(buf) >= ASYNC_DRV_NAMES_MAX_LEN)
- printk(KERN_WARNING
- "Too long list of driver names for 'driver_async_probe'!\n");
+ pr_warn("Too long list of driver names for 'driver_async_probe'!\n");
strlcpy(async_probe_drv_names, buf, ASYNC_DRV_NAMES_MAX_LEN);
return 0;
--
2.11.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] driver core: printk to pr_*
2019-04-12 15:47 [PATCH 1/2] driver core: printk to pr_* Willy Wolff
@ 2019-04-13 16:57 ` Joe Perches
2019-04-16 13:39 ` Greg Kroah-Hartman
1 sibling, 0 replies; 3+ messages in thread
From: Joe Perches @ 2019-04-13 16:57 UTC (permalink / raw)
To: Willy Wolff, Greg Kroah-Hartman, Rafael J. Wysocki, linux-kernel
On Fri, 2019-04-12 at 16:47 +0100, Willy Wolff wrote:
> Signed-off-by: Willy Wolff <willy.mh.wolff.ml@gmail.com>
Most people seem to prefer some type of commit message before
your sign-off.
And trivia:
> diff --git a/drivers/base/dd.c b/drivers/base/dd.c
[]
> @@ -602,8 +601,8 @@ static int really_probe_debug(struct device *dev, struct device_driver *drv)
> ret = really_probe(dev, drv);
> rettime = ktime_get();
> delta = ktime_sub(rettime, calltime);
> - printk(KERN_DEBUG "probe of %s returned %d after %lld usecs\n",
> - dev_name(dev), ret, (s64) ktime_to_us(delta));
> + pr_debug("probe of %s returned %d after %lld usecs\n",
> + dev_name(dev), ret, (s64) ktime_to_us(delta));
While I think this particular change is fine, and you may
already know this, but converting a
printk(KERN_DEBUG ...)
to
pr_debug(...)
changes object code and output.
The first is always emitted, the second is not emitted
unless DEBUG is defined or CONFIG_DYNAMIC_DEBUG is enabled.
Your commit message should show this understanding.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] driver core: printk to pr_*
2019-04-12 15:47 [PATCH 1/2] driver core: printk to pr_* Willy Wolff
2019-04-13 16:57 ` Joe Perches
@ 2019-04-16 13:39 ` Greg Kroah-Hartman
1 sibling, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2019-04-16 13:39 UTC (permalink / raw)
To: Willy Wolff; +Cc: Rafael J. Wysocki, linux-kernel
On Fri, Apr 12, 2019 at 04:47:54PM +0100, Willy Wolff wrote:
> Signed-off-by: Willy Wolff <willy.mh.wolff.ml@gmail.com>
I do not take patches without any changelog text, sorry.
> ---
> drivers/base/dd.c | 18 ++++++++----------
> 1 file changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/base/dd.c b/drivers/base/dd.c
> index a823f469e53f..1bc4557a0f49 100644
> --- a/drivers/base/dd.c
> +++ b/drivers/base/dd.c
> @@ -328,7 +328,7 @@ bool device_is_bound(struct device *dev)
> static void driver_bound(struct device *dev)
> {
> if (device_is_bound(dev)) {
> - printk(KERN_WARNING "%s: device %s already bound\n",
> + pr_warn("%s: device %s already bound\n",
> __func__, kobject_name(&dev->kobj));
This really should be dev_warn() now, that way no need to use
kobject_name().
> return;
> }
> @@ -494,8 +494,8 @@ static int really_probe(struct device *dev, struct device_driver *drv)
> }
>
> if (driver_sysfs_add(dev)) {
> - printk(KERN_ERR "%s: driver_sysfs_add(%s) failed\n",
> - __func__, dev_name(dev));
> + pr_err("%s: driver_sysfs_add(%s) failed\n",
> + __func__, dev_name(dev));
dev_err()?
> goto probe_failed;
> }
>
> @@ -575,9 +575,8 @@ static int really_probe(struct device *dev, struct device_driver *drv)
> break;
> default:
> /* driver matched but the probe failed */
> - printk(KERN_WARNING
> - "%s: probe of %s failed with error %d\n",
> - drv->name, dev_name(dev), ret);
> + pr_warn("%s: probe of %s failed with error %d\n",
> + drv->name, dev_name(dev), ret);
dev_warn()?
> }
> /*
> * Ignore errors returned by ->probe so that the next driver can try
> @@ -602,8 +601,8 @@ static int really_probe_debug(struct device *dev, struct device_driver *drv)
> ret = really_probe(dev, drv);
> rettime = ktime_get();
> delta = ktime_sub(rettime, calltime);
> - printk(KERN_DEBUG "probe of %s returned %d after %lld usecs\n",
> - dev_name(dev), ret, (s64) ktime_to_us(delta));
> + pr_debug("probe of %s returned %d after %lld usecs\n",
> + dev_name(dev), ret, (s64) ktime_to_us(delta));
dev_dbg()?
> return ret;
> }
>
> @@ -687,8 +686,7 @@ static inline bool cmdline_requested_async_probing(const char *drv_name)
> static int __init save_async_options(char *buf)
> {
> if (strlen(buf) >= ASYNC_DRV_NAMES_MAX_LEN)
> - printk(KERN_WARNING
> - "Too long list of driver names for 'driver_async_probe'!\n");
> + pr_warn("Too long list of driver names for 'driver_async_probe'!\n");
This one was ok.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-04-16 14:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-12 15:47 [PATCH 1/2] driver core: printk to pr_* Willy Wolff
2019-04-13 16:57 ` Joe Perches
2019-04-16 13:39 ` Greg Kroah-Hartman
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).