public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jiri Slaby <jslaby@suse.cz>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: [jirislaby:devel 48/48] drivers/tty/serial/max310x.c:753:33: warning: variable 'to_send' set but not used
Date: Tue, 12 Apr 2022 18:20:46 +0800	[thread overview]
Message-ID: <202204121850.mWrZUR2V-lkp@intel.com> (raw)

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@intel.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

                 reply	other threads:[~2022-04-12 11:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202204121850.mWrZUR2V-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=jslaby@suse.cz \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox