misc: ti-st: don't check for tty data == NULL
authorJiri Slaby <jirislaby@kernel.org>
Mon, 31 Jul 2023 08:02:44 +0000 (10:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 31 Jul 2023 15:16:05 +0000 (17:16 +0200)
tty data passed to tty_ldisc_ops::receive_buf() are never NULL. Remove
this check.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230731080244.2698-11-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/ti-st/st_core.c
drivers/misc/ti-st/st_kim.c

index e2add50b191c82cd510a176b9c41ac036051cde9..3b2145722bd7703d7fc6b6780b3fdc06de7e1c75 100644 (file)
@@ -234,8 +234,7 @@ static void st_int_recv(void *disc_data,
        struct st_data_s *st_gdata = (struct st_data_s *)disc_data;
        unsigned long flags;
 
-       /* tty_receive sent null ? */
-       if (unlikely(ptr == NULL) || (st_gdata == NULL)) {
+       if (st_gdata == NULL) {
                pr_err(" received null from TTY ");
                return;
        }
index 8c801897ffa2b725f8877d6d2e6881866e0eb8d1..5431a89924aa171367b65d62bf1e2350fed28dc7 100644 (file)
@@ -135,11 +135,6 @@ static void kim_int_recv(struct kim_data_s *kim_gdata,
 
        pr_debug("%s", __func__);
        /* Decode received bytes here */
-       if (unlikely(ptr == NULL)) {
-               pr_err(" received null from TTY ");
-               return;
-       }
-
        while (count) {
                if (kim_gdata->rx_count) {
                        len = min_t(unsigned int, kim_gdata->rx_count, count);