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@xxxxxxxxxx> Cc: Arnd Bergmann <arnd@xxxxxxxx> --- 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