tty: jsm: remove unused members from struct board_ops
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Tue, 21 Nov 2023 10:36:23 +0000 (11:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Nov 2023 19:16:03 +0000 (19:16 +0000)
clang-struct [1] found board_ops::get_uart_bytes_left() and
::send_immediate_char() unused.

Both are only set but never called. And it has been like that since the
git history, so drop both the members along with the cls+neo
implementations.

[1] https://github.com/jirislaby/clang-struct

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20231121103626.17772-4-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/jsm/jsm.h
drivers/tty/serial/jsm/jsm_cls.c
drivers/tty/serial/jsm/jsm_neo.c

index 8489c07f4cd5eadcb749e3a2f288ff74de77df06..08a42f045ec8c80ac189cb652986f8b49bbaaba6 100644 (file)
@@ -115,8 +115,6 @@ struct board_ops {
        void (*send_start_character)(struct jsm_channel *ch);
        void (*send_stop_character)(struct jsm_channel *ch);
        void (*copy_data_from_queue_to_uart)(struct jsm_channel *ch);
-       u32 (*get_uart_bytes_left)(struct jsm_channel *ch);
-       void (*send_immediate_char)(struct jsm_channel *ch, unsigned char);
 };
 
 
index 3fd57ac3ad81c465c5a74bab262f1e5fbfcd556c..1eda48964c0b6539f0e6281d121d7b17344549b7 100644 (file)
@@ -877,28 +877,6 @@ static void cls_uart_off(struct jsm_channel *ch)
        writeb(0, &ch->ch_cls_uart->ier);
 }
 
-/*
- * cls_get_uarts_bytes_left.
- * Returns 0 is nothing left in the FIFO, returns 1 otherwise.
- *
- * The channel lock MUST be held by the calling function.
- */
-static u32 cls_get_uart_bytes_left(struct jsm_channel *ch)
-{
-       u8 left = 0;
-       u8 lsr = readb(&ch->ch_cls_uart->lsr);
-
-       /* Determine whether the Transmitter is empty or not */
-       if (!(lsr & UART_LSR_TEMT))
-               left = 1;
-       else {
-               ch->ch_flags |= (CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);
-               left = 0;
-       }
-
-       return left;
-}
-
 /*
  * cls_send_break.
  * Starts sending a break thru the UART.
@@ -916,18 +894,6 @@ static void cls_send_break(struct jsm_channel *ch)
        }
 }
 
-/*
- * cls_send_immediate_char.
- * Sends a specific character as soon as possible to the UART,
- * jumping over any bytes that might be in the write queue.
- *
- * The channel lock MUST be held by the calling function.
- */
-static void cls_send_immediate_char(struct jsm_channel *ch, unsigned char c)
-{
-       writeb(c, &ch->ch_cls_uart->txrx);
-}
-
 struct board_ops jsm_cls_ops = {
        .intr =                         cls_intr,
        .uart_init =                    cls_uart_init,
@@ -943,7 +909,5 @@ struct board_ops jsm_cls_ops = {
        .send_start_character =         cls_send_start_character,
        .send_stop_character =          cls_send_stop_character,
        .copy_data_from_queue_to_uart = cls_copy_data_from_queue_to_uart,
-       .get_uart_bytes_left =          cls_get_uart_bytes_left,
-       .send_immediate_char =          cls_send_immediate_char
 };
 
index 2bd6404289708b07a29ba96a79f18af8ed1aa2ea..1fa10f19368f57edb7b6b097bfc3236541890952 100644 (file)
@@ -1309,25 +1309,6 @@ static void neo_uart_off(struct jsm_channel *ch)
        writeb(0, &ch->ch_neo_uart->ier);
 }
 
-static u32 neo_get_uart_bytes_left(struct jsm_channel *ch)
-{
-       u8 left = 0;
-       u8 lsr = readb(&ch->ch_neo_uart->lsr);
-
-       /* We must cache the LSR as some of the bits get reset once read... */
-       ch->ch_cached_lsr |= lsr;
-
-       /* Determine whether the Transmitter is empty or not */
-       if (!(lsr & UART_LSR_TEMT))
-               left = 1;
-       else {
-               ch->ch_flags |= (CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);
-               left = 0;
-       }
-
-       return left;
-}
-
 /* Channel lock MUST be held by the calling function! */
 static void neo_send_break(struct jsm_channel *ch)
 {
@@ -1348,25 +1329,6 @@ static void neo_send_break(struct jsm_channel *ch)
        }
 }
 
-/*
- * neo_send_immediate_char.
- *
- * Sends a specific character as soon as possible to the UART,
- * jumping over any bytes that might be in the write queue.
- *
- * The channel lock MUST be held by the calling function.
- */
-static void neo_send_immediate_char(struct jsm_channel *ch, unsigned char c)
-{
-       if (!ch)
-               return;
-
-       writeb(c, &ch->ch_neo_uart->txrx);
-
-       /* flush write operation */
-       neo_pci_posting_flush(ch->ch_bd);
-}
-
 struct board_ops jsm_neo_ops = {
        .intr                           = neo_intr,
        .uart_init                      = neo_uart_init,
@@ -1382,6 +1344,4 @@ struct board_ops jsm_neo_ops = {
        .send_start_character           = neo_send_start_character,
        .send_stop_character            = neo_send_stop_character,
        .copy_data_from_queue_to_uart   = neo_copy_data_from_queue_to_uart,
-       .get_uart_bytes_left            = neo_get_uart_bytes_left,
-       .send_immediate_char            = neo_send_immediate_char
 };