linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
To: gregkh@linuxfoundation.org
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Jiri Slaby (SUSE)" <jirislaby@kernel.org>,
	Arnd Bergmann <arnd@arndb.de>
Subject: [PATCH 09/10] misc: ti-st: remove ptr from recv functions
Date: Mon, 31 Jul 2023 10:02:43 +0200	[thread overview]
Message-ID: <20230731080244.2698-10-jirislaby@kernel.org> (raw)
In-Reply-To: <20230731080244.2698-1-jirislaby@kernel.org>

ptr is the same as data, so use ptr directly as a parameter and drop the
useless local variable.

Likely, the two were introduced to have a different type. But 'char' and
'unsigned char' are the same in the kernel for a long time.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
---
 drivers/misc/ti-st/st_core.c | 4 +---
 drivers/misc/ti-st/st_kim.c  | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c
index 389901276ce3..e2add50b191c 100644
--- a/drivers/misc/ti-st/st_core.c
+++ b/drivers/misc/ti-st/st_core.c
@@ -224,9 +224,8 @@ static inline void st_wakeup_ack(struct st_data_s *st_gdata,
  *	CH-8 packets from FM, CH-9 packets from GPS cores.
  */
 static void st_int_recv(void *disc_data,
-	const unsigned char *data, long count)
+	const unsigned char *ptr, long count)
 {
-	char *ptr;
 	struct st_proto_s *proto;
 	unsigned short payload_len = 0;
 	int len = 0;
@@ -235,7 +234,6 @@ static void st_int_recv(void *disc_data,
 	struct st_data_s *st_gdata = (struct st_data_s *)disc_data;
 	unsigned long flags;
 
-	ptr = (char *)data;
 	/* tty_receive sent null ? */
 	if (unlikely(ptr == NULL) || (st_gdata == NULL)) {
 		pr_err(" received null from TTY ");
diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c
index f2f6cab97c08..8c801897ffa2 100644
--- a/drivers/misc/ti-st/st_kim.c
+++ b/drivers/misc/ti-st/st_kim.c
@@ -128,15 +128,13 @@ static inline int kim_check_data_len(struct kim_data_s *kim_gdata, int len)
  *	tty_receive and hence the logic
  */
 static void kim_int_recv(struct kim_data_s *kim_gdata,
-	const unsigned char *data, long count)
+	const unsigned char *ptr, long count)
 {
-	const unsigned char *ptr;
 	int len = 0;
 	unsigned char *plen;
 
 	pr_debug("%s", __func__);
 	/* Decode received bytes here */
-	ptr = data;
 	if (unlikely(ptr == NULL)) {
 		pr_err(" received null from TTY ");
 		return;
-- 
2.41.0


  parent reply	other threads:[~2023-07-31  8:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-31  8:02 [PATCH 00/10] tty: minor cleanups Jiri Slaby (SUSE)
2023-07-31  8:02 ` [PATCH 01/10] serial: move WARN_ON() in uart_write() to the condition Jiri Slaby (SUSE)
2023-07-31  8:02 ` [PATCH 02/10] Bluetooth: rfcomm: remove casts from tty->driver_data Jiri Slaby (SUSE)
2023-07-31  8:02 ` [PATCH 03/10] tty: hvsi: remove an extra variable from hvsi_write() Jiri Slaby (SUSE)
2023-07-31  8:02 ` [PATCH 04/10] input: serport: remove casts from tty->disc_data Jiri Slaby (SUSE)
2023-07-31 16:18   ` Dmitry Torokhov
2023-07-31  8:02 ` [PATCH 05/10] can: slcan: " Jiri Slaby (SUSE)
2023-07-31  8:16   ` Marc Kleine-Budde
2023-07-31  8:02 ` [PATCH 06/10] serial: altera_jtaguart: switch status to u32 Jiri Slaby (SUSE)
2023-08-08 14:34   ` Tobias Klauser
2023-07-31  8:02 ` [PATCH 07/10] speakup: switch to unsigned iterator in spk_ttyio_receive_buf2() Jiri Slaby (SUSE)
2023-07-31  8:02 ` [PATCH 08/10] misc: ti-st: remove forward declarations and make st_int_recv() static Jiri Slaby (SUSE)
2023-07-31  8:02 ` Jiri Slaby (SUSE) [this message]
2023-07-31  8:02 ` [PATCH 10/10] misc: ti-st: don't check for tty data == NULL Jiri Slaby (SUSE)
2023-07-31  8:15 ` [PATCH 00/10] tty: minor cleanups Marc Kleine-Budde
2023-07-31  8:21   ` Jiri Slaby

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=20230731080244.2698-10-jirislaby@kernel.org \
    --to=jirislaby@kernel.org \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /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 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).