lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202204121850.mWrZUR2V-lkp@intel.com>
Date:   Tue, 12 Apr 2022 18:20:46 +0800
From:   kernel test robot <lkp@...el.com>
To:     Jiri Slaby <jslaby@...e.cz>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [jirislaby:devel 48/48] drivers/tty/serial/max310x.c:753:33:
 warning: variable 'to_send' set but not used

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@intel.com/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@...el.com>

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ