Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: jsm: remove unused members from struct board_ops

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>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
79b18e51 5bd8ad37

-78
-2
drivers/tty/serial/jsm/jsm.h
··· 115 115 void (*send_start_character)(struct jsm_channel *ch); 116 116 void (*send_stop_character)(struct jsm_channel *ch); 117 117 void (*copy_data_from_queue_to_uart)(struct jsm_channel *ch); 118 - u32 (*get_uart_bytes_left)(struct jsm_channel *ch); 119 - void (*send_immediate_char)(struct jsm_channel *ch, unsigned char); 120 118 }; 121 119 122 120
-36
drivers/tty/serial/jsm/jsm_cls.c
··· 878 878 } 879 879 880 880 /* 881 - * cls_get_uarts_bytes_left. 882 - * Returns 0 is nothing left in the FIFO, returns 1 otherwise. 883 - * 884 - * The channel lock MUST be held by the calling function. 885 - */ 886 - static u32 cls_get_uart_bytes_left(struct jsm_channel *ch) 887 - { 888 - u8 left = 0; 889 - u8 lsr = readb(&ch->ch_cls_uart->lsr); 890 - 891 - /* Determine whether the Transmitter is empty or not */ 892 - if (!(lsr & UART_LSR_TEMT)) 893 - left = 1; 894 - else { 895 - ch->ch_flags |= (CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM); 896 - left = 0; 897 - } 898 - 899 - return left; 900 - } 901 - 902 - /* 903 881 * cls_send_break. 904 882 * Starts sending a break thru the UART. 905 883 * ··· 892 914 writeb((temp | UART_LCR_SBC), &ch->ch_cls_uart->lcr); 893 915 ch->ch_flags |= (CH_BREAK_SENDING); 894 916 } 895 - } 896 - 897 - /* 898 - * cls_send_immediate_char. 899 - * Sends a specific character as soon as possible to the UART, 900 - * jumping over any bytes that might be in the write queue. 901 - * 902 - * The channel lock MUST be held by the calling function. 903 - */ 904 - static void cls_send_immediate_char(struct jsm_channel *ch, unsigned char c) 905 - { 906 - writeb(c, &ch->ch_cls_uart->txrx); 907 917 } 908 918 909 919 struct board_ops jsm_cls_ops = { ··· 909 943 .send_start_character = cls_send_start_character, 910 944 .send_stop_character = cls_send_stop_character, 911 945 .copy_data_from_queue_to_uart = cls_copy_data_from_queue_to_uart, 912 - .get_uart_bytes_left = cls_get_uart_bytes_left, 913 - .send_immediate_char = cls_send_immediate_char 914 946 }; 915 947
-40
drivers/tty/serial/jsm/jsm_neo.c
··· 1309 1309 writeb(0, &ch->ch_neo_uart->ier); 1310 1310 } 1311 1311 1312 - static u32 neo_get_uart_bytes_left(struct jsm_channel *ch) 1313 - { 1314 - u8 left = 0; 1315 - u8 lsr = readb(&ch->ch_neo_uart->lsr); 1316 - 1317 - /* We must cache the LSR as some of the bits get reset once read... */ 1318 - ch->ch_cached_lsr |= lsr; 1319 - 1320 - /* Determine whether the Transmitter is empty or not */ 1321 - if (!(lsr & UART_LSR_TEMT)) 1322 - left = 1; 1323 - else { 1324 - ch->ch_flags |= (CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM); 1325 - left = 0; 1326 - } 1327 - 1328 - return left; 1329 - } 1330 - 1331 1312 /* Channel lock MUST be held by the calling function! */ 1332 1313 static void neo_send_break(struct jsm_channel *ch) 1333 1314 { ··· 1329 1348 } 1330 1349 } 1331 1350 1332 - /* 1333 - * neo_send_immediate_char. 1334 - * 1335 - * Sends a specific character as soon as possible to the UART, 1336 - * jumping over any bytes that might be in the write queue. 1337 - * 1338 - * The channel lock MUST be held by the calling function. 1339 - */ 1340 - static void neo_send_immediate_char(struct jsm_channel *ch, unsigned char c) 1341 - { 1342 - if (!ch) 1343 - return; 1344 - 1345 - writeb(c, &ch->ch_neo_uart->txrx); 1346 - 1347 - /* flush write operation */ 1348 - neo_pci_posting_flush(ch->ch_bd); 1349 - } 1350 - 1351 1351 struct board_ops jsm_neo_ops = { 1352 1352 .intr = neo_intr, 1353 1353 .uart_init = neo_uart_init, ··· 1344 1382 .send_start_character = neo_send_start_character, 1345 1383 .send_stop_character = neo_send_stop_character, 1346 1384 .copy_data_from_queue_to_uart = neo_copy_data_from_queue_to_uart, 1347 - .get_uart_bytes_left = neo_get_uart_bytes_left, 1348 - .send_immediate_char = neo_send_immediate_char 1349 1385 };