llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jiri Slaby <jslaby@suse.cz>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org
Subject: [jirislaby:devel 48/48] drivers/tty/serial/atmel_serial.c:981:24: warning: variable 'tx_len' is uninitialized when used here
Date: Wed, 13 Apr 2022 00:16:51 +0800	[thread overview]
Message-ID: <202204130036.n7mzFmFK-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: hexagon-randconfig-r045-20220411 (https://download.01.org/0day-ci/archive/20220413/202204130036.n7mzFmFK-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project fe2478d44e4f7f191c43fef629ac7a23d0251e72)
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=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/tty/serial/

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/atmel_serial.c:981:24: warning: variable 'tx_len' is uninitialized when used here [-Wuninitialized]
                   atmel_port->tx_len = tx_len;
                                        ^~~~~~
   drivers/tty/serial/atmel_serial.c:927:21: note: initialize the variable 'tx_len' to silence this warning
           unsigned int tx_len, /*part1_len, part2_len,*/ sg_len;
                              ^
                               = 0
   drivers/tty/serial/atmel_serial.c:985:13: warning: variable 'sg_len' is uninitialized when used here [-Wuninitialized]
                                                  sg_len,
                                                  ^~~~~~
   drivers/tty/serial/atmel_serial.c:927:55: note: initialize the variable 'sg_len' to silence this warning
           unsigned int tx_len, /*part1_len, part2_len,*/ sg_len;
                                                                ^
                                                                 = 0
   2 warnings generated.


vim +/tx_len +981 drivers/tty/serial/atmel_serial.c

5f258b3e3d223b Cyrille Pitchen 2015-07-02   976  
5f258b3e3d223b Cyrille Pitchen 2015-07-02   977  		/*
5f258b3e3d223b Cyrille Pitchen 2015-07-02   978  		 * save tx_len so atmel_complete_tx_dma() will increase
5f258b3e3d223b Cyrille Pitchen 2015-07-02   979  		 * xmit->tail correctly
5f258b3e3d223b Cyrille Pitchen 2015-07-02   980  		 */
5f258b3e3d223b Cyrille Pitchen 2015-07-02  @981  		atmel_port->tx_len = tx_len;
08f738be88bb7a Elen Song       2013-07-22   982  
08f738be88bb7a Elen Song       2013-07-22   983  		desc = dmaengine_prep_slave_sg(chan,
5f258b3e3d223b Cyrille Pitchen 2015-07-02   984  					       sgl,
5f258b3e3d223b Cyrille Pitchen 2015-07-02   985  					       sg_len,
08f738be88bb7a Elen Song       2013-07-22   986  					       DMA_MEM_TO_DEV,
08f738be88bb7a Elen Song       2013-07-22   987  					       DMA_PREP_INTERRUPT |
08f738be88bb7a Elen Song       2013-07-22   988  					       DMA_CTRL_ACK);
08f738be88bb7a Elen Song       2013-07-22   989  		if (!desc) {
08f738be88bb7a Elen Song       2013-07-22   990  			dev_err(port->dev, "Failed to send via dma!\n");
08f738be88bb7a Elen Song       2013-07-22   991  			return;
08f738be88bb7a Elen Song       2013-07-22   992  		}
08f738be88bb7a Elen Song       2013-07-22   993  
5f258b3e3d223b Cyrille Pitchen 2015-07-02   994  		dma_sync_sg_for_device(port->dev, sg_tx, 1, DMA_TO_DEVICE);
08f738be88bb7a Elen Song       2013-07-22   995  
08f738be88bb7a Elen Song       2013-07-22   996  		atmel_port->desc_tx = desc;
08f738be88bb7a Elen Song       2013-07-22   997  		desc->callback = atmel_complete_tx_dma;
08f738be88bb7a Elen Song       2013-07-22   998  		desc->callback_param = atmel_port;
08f738be88bb7a Elen Song       2013-07-22   999  		atmel_port->cookie_tx = dmaengine_submit(desc);
1e67bd2b8cb90b Tudor Ambarus   2021-11-25  1000  		if (dma_submit_error(atmel_port->cookie_tx)) {
1e67bd2b8cb90b Tudor Ambarus   2021-11-25  1001  			dev_err(port->dev, "dma_submit_error %d\n",
1e67bd2b8cb90b Tudor Ambarus   2021-11-25  1002  				atmel_port->cookie_tx);
1e67bd2b8cb90b Tudor Ambarus   2021-11-25  1003  			return;
1e67bd2b8cb90b Tudor Ambarus   2021-11-25  1004  		}
4f4b9b5895614e Tudor Ambarus   2021-11-25  1005  
4f4b9b5895614e Tudor Ambarus   2021-11-25  1006  		dma_async_issue_pending(chan);
08f738be88bb7a Elen Song       2013-07-22  1007  	}
08f738be88bb7a Elen Song       2013-07-22  1008  
ea94a80635daaf Jiri Slaby      2022-01-05  1009  	if (kfifo_len(&tport->xmit_fifo) < WAKEUP_CHARS)
08f738be88bb7a Elen Song       2013-07-22  1010  		uart_write_wakeup(port);
08f738be88bb7a Elen Song       2013-07-22  1011  }
08f738be88bb7a Elen Song       2013-07-22  1012  

:::::: The code at line 981 was first introduced by commit
:::::: 5f258b3e3d223b5cb6d1753b2f9b821ba4455f81 tty/serial: at91: use 32bit writes into TX FIFO when DMA is enabled

:::::: TO: Cyrille Pitchen <cyrille.pitchen@atmel.com>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

                 reply	other threads:[~2022-04-12 16:32 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=202204130036.n7mzFmFK-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=jslaby@suse.cz \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    /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;
as well as URLs for NNTP newsgroup(s).