From: Gregory CLEMENT <gregory.clement@bootlin.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>,
linux-kernel@vger.kernel.org
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Gregory CLEMENT <gregory.clement@bootlin.com>
Subject: [PATCH 1/2] tty: n_gsm: Remove unnecessary test in gsm_print_packet()
Date: Mon, 18 May 2020 10:45:12 +0200 [thread overview]
Message-ID: <20200518084517.2173242-2-gregory.clement@bootlin.com> (raw)
In-Reply-To: <20200518084517.2173242-1-gregory.clement@bootlin.com>
If the length is zero then the print_hex_dump_bytes won't output
anything, so testing the length before the call is unnecessary.
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
---
drivers/tty/n_gsm.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index 69200bd411f7..4465dd04fead 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -504,8 +504,7 @@ static void gsm_print_packet(const char *hdr, int addr, int cr,
else
pr_cont("(F)");
- if (dlen)
- print_hex_dump_bytes("", DUMP_PREFIX_NONE, data, dlen);
+ print_hex_dump_bytes("", DUMP_PREFIX_NONE, data, dlen);
}
--
2.26.2
next prev parent reply other threads:[~2020-05-18 8:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-18 8:45 [PATCH 0/2] TTY fix-ups for "TTY improve n_gsm support" series Gregory CLEMENT
2020-05-18 8:45 ` Gregory CLEMENT [this message]
2020-05-18 8:45 ` [PATCH 2/2] tty: n_gsm: Fix bogus i++ in gsm_data_kick Gregory CLEMENT
2020-05-18 8:45 ` [PATCH v2 0/3] TTY improve n_gsm support Gregory CLEMENT
2020-05-18 10:01 ` Gregory CLEMENT
2020-05-18 8:45 ` [PATCH v2 1/3] tty: n_gsm: Improve debug output Gregory CLEMENT
2020-05-18 8:45 ` [PATCH v2 2/3] tty: n_gsm: Fix SOF skipping Gregory CLEMENT
2020-05-18 8:45 ` [PATCH v2 3/3] tty: n_gsm: Fix waking up upper tty layer when room available Gregory CLEMENT
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200518084517.2173242-2-gregory.clement@bootlin.com \
--to=gregory.clement@bootlin.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.