2023-11-06 22:27:19

by Yuran Pereira

[permalink] [raw]
Subject: [PATCH 2/2] Bluetooth: Replaces printk with pr_debug in bt_dbg

bt_dbg() uses printk, as opposed to other functions in this file
which use pr_* family of logging functions.

This patch changes that by replacing `printk(KERN_DEBUG` with
the equivalent pr_debug() call which makes the overall file
look more uniform and cleaner.

Signed-off-by: Yuran Pereira <[email protected]>
---
net/bluetooth/lib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/lib.c b/net/bluetooth/lib.c
index 063032fe9c68..96ba39f8b461 100644
--- a/net/bluetooth/lib.c
+++ b/net/bluetooth/lib.c
@@ -329,7 +329,7 @@ void bt_dbg(const char *format, ...)
vaf.fmt = format;
vaf.va = &args;

- printk(KERN_DEBUG pr_fmt("%pV"), &vaf);
+ pr_debug("%pV", &vaf);

va_end(args);
}
--
2.25.1


2023-11-07 06:31:40

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 2/2] Bluetooth: Replaces printk with pr_debug in bt_dbg

On Tue, Nov 07, 2023 at 03:56:08AM +0530, Yuran Pereira wrote:
> bt_dbg() uses printk, as opposed to other functions in this file
> which use pr_* family of logging functions.
>
> This patch changes that by replacing `printk(KERN_DEBUG` with
> the equivalent pr_debug() call which makes the overall file
> look more uniform and cleaner.
>
> Signed-off-by: Yuran Pereira <[email protected]>
> ---
> net/bluetooth/lib.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/bluetooth/lib.c b/net/bluetooth/lib.c
> index 063032fe9c68..96ba39f8b461 100644
> --- a/net/bluetooth/lib.c
> +++ b/net/bluetooth/lib.c
> @@ -329,7 +329,7 @@ void bt_dbg(const char *format, ...)
> vaf.fmt = format;
> vaf.va = &args;
>
> - printk(KERN_DEBUG pr_fmt("%pV"), &vaf);
> + pr_debug("%pV", &vaf);

You might have just changed the functionality here, are you SURE this is
identical to the original code? How was it tested?

I'm not saying this is a bad idea to do, just be aware of the
consequences for this change and document it properly (hint, the
changelog does not document the user-visible change that just happened.)

Note, pr_debug() is NOT identical to printk(), look at the source for
the full details.

thanks,

greg k-h