[jirislaby:devel 48/48] drivers/tty/serial/max310x.c:753:33: warning: variable 'to_send' set but not used
From: kernel test robot
Date: Tue Apr 12 2022 - 07:41:48 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jirislaby/linux.git devel
head: ea94a80635daaf36a289f1ec1f982b1e094faeca
commit: ea94a80635daaf36a289f1ec1f982b1e094faeca [48/48] tty: serial, use kfifo
config: arc-buildonly-randconfig-r003-20220411 (https://download.01.org/0day-ci/archive/20220412/202204121850.mWrZUR2V-lkp@xxxxxxxxx/config)
compiler: arceb-elf-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/jirislaby/linux.git/commit/?id=ea94a80635daaf36a289f1ec1f982b1e094faeca
git remote add jirislaby https://git.kernel.org/pub/scm/linux/kernel/git/jirislaby/linux.git
git fetch --no-tags jirislaby devel
git checkout ea94a80635daaf36a289f1ec1f982b1e094faeca
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash drivers/tty/serial/ kernel/time/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
All warnings (new ones prefixed by >>):
drivers/tty/serial/max310x.c: In function 'max310x_handle_tx':
>> drivers/tty/serial/max310x.c:753:33: warning: variable 'to_send' set but not used [-Wunused-but-set-variable]
753 | unsigned int /*txlen,*/ to_send;//, until_end;
| ^~~~~~~
vim +/to_send +753 drivers/tty/serial/max310x.c
749
750 static void max310x_handle_tx(struct uart_port *port)
751 {
752 struct tty_port *tport = &port->state->port;
> 753 unsigned int /*txlen,*/ to_send;//, until_end;
754
755 if (unlikely(port->x_char)) {
756 max310x_port_write(port, MAX310X_THR_REG, port->x_char);
757 port->icount.tx++;
758 port->x_char = 0;
759 return;
760 }
761
762 if (kfifo_is_empty(&tport->xmit_fifo) || uart_tx_stopped(port))
763 return;
764
765 /* Get length of data pending in circular buffer */
766 to_send = kfifo_len(&tport->xmit_fifo);
767 #ifdef UNFINISHED
768 until_end = CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE);
769 if (likely(to_send)) {
770 /* Limit to size of TX FIFO */
771 txlen = max310x_port_read(port, MAX310X_TXFIFOLVL_REG);
772 txlen = port->fifosize - txlen;
773 to_send = (to_send > txlen) ? txlen : to_send;
774
775 if (until_end < to_send) {
776 /* It's a circ buffer -- wrap around.
777 * We could do that in one SPI transaction, but meh. */
778 max310x_batch_write(port, xmit->buf + xmit->tail, until_end);
779 max310x_batch_write(port, xmit->buf, to_send - until_end);
780 } else {
781 max310x_batch_write(port, xmit->buf + xmit->tail, to_send);
782 }
783
784 /* Add data to send */
785 port->icount.tx += to_send;
786 xmit->tail = (xmit->tail + to_send) & (UART_XMIT_SIZE - 1);
787 }
788 #endif
789
790 if (kfifo_len(&tport->xmit_fifo) < WAKEUP_CHARS)
791 uart_write_wakeup(port);
792 }
793
--
0-DAY CI Kernel Test Service
https://01.org/lkp