[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f957eb74-cdbe-848f-b345-7c9fb3d7b1e6@suse.com>
Date: Mon, 18 May 2020 08:40:08 +0200
From: Jiri Slaby <jslaby@...e.com>
To: Gregory CLEMENT <gregory.clement@...tlin.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org
Cc: Thomas Petazzoni <thomas.petazzoni@...tlin.com>
Subject: Re: [PATCH v2 1/3] tty: n_gsm: Improve debug output
On 12. 05. 20, 13:53, Gregory CLEMENT wrote:
> Use appropriate print helpers for debug messages.
>
> Signed-off-by: Gregory CLEMENT <gregory.clement@...tlin.com>
> ---
> drivers/tty/n_gsm.c | 14 ++------------
> 1 file changed, 2 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
> index d77ed82a4840..67c8f8173023 100644
> --- a/drivers/tty/n_gsm.c
> +++ b/drivers/tty/n_gsm.c
> @@ -504,18 +504,8 @@ static void gsm_print_packet(const char *hdr, int addr, int cr,
> else
> pr_cont("(F)");
>
> - if (dlen) {
> - int ct = 0;
> - while (dlen--) {
> - if (ct % 8 == 0) {
> - pr_cont("\n");
> - pr_debug(" ");
> - }
> - pr_cont("%02X ", *data++);
> - ct++;
> - }
> - }
> - pr_cont("\n");
> + if (dlen)
This test is superfluous. print_hex_dump_* won't write anything when
zero length is passed to it.
> + print_hex_dump_bytes("", DUMP_PREFIX_NONE, data, dlen);
> }
thanks,
--
js
suse labs
Powered by blists - more mailing lists