linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Tony Lindgren <tony@atomide.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	"Andy Shevchenko" <andriy.shevchenko@intel.com>,
	"Dhruva Gole" <d-gole@ti.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Johan Hovold" <johan@kernel.org>,
	"Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-serial@vger.kernel.org
Subject: Re: [PATCH v10 1/1] serial: core: Start managing serial controllers to enable runtime PM
Date: Tue, 9 May 2023 07:13:02 +0800	[thread overview]
Message-ID: <202305090752.w4XZxmsN-lkp@intel.com> (raw)
In-Reply-To: <20230508110339.38699-1-tony@atomide.com>

Hi Tony,

kernel test robot noticed the following build warnings:

[auto build test WARNING on tty/tty-testing]
[also build test WARNING on tty/tty-next tty/tty-linus usb/usb-testing usb/usb-next usb/usb-linus linus/master v6.4-rc1 next-20230508]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Tony-Lindgren/serial-core-Start-managing-serial-controllers-to-enable-runtime-PM/20230508-190805
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
patch link:    https://lore.kernel.org/r/20230508110339.38699-1-tony%40atomide.com
patch subject: [PATCH v10 1/1] serial: core: Start managing serial controllers to enable runtime PM
config: x86_64-randconfig-a001-20230508 (https://download.01.org/0day-ci/archive/20230509/202305090752.w4XZxmsN-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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://github.com/intel-lab-lkp/linux/commit/2f298f9dbe3a1d9550e1f15bb1415aeaf9ce4311
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Tony-Lindgren/serial-core-Start-managing-serial-controllers-to-enable-runtime-PM/20230508-190805
        git checkout 2f298f9dbe3a1d9550e1f15bb1415aeaf9ce4311
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/tty/serial/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202305090752.w4XZxmsN-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/tty/serial/serial_base_bus.c:97:13: warning: variable 'id' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
           } else if (type == &serial_port_type) {
                      ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/tty/serial/serial_base_bus.c:102:77: note: uninitialized use occurs here
           err = dev_set_name(&sbd->dev, "%s.%s.%d", type->name, dev_name(port->dev), id);
                                                                                      ^~
   drivers/tty/serial/serial_base_bus.c:97:9: note: remove the 'if' if its condition is always true
           } else if (type == &serial_port_type) {
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/tty/serial/serial_base_bus.c:83:13: note: initialize the variable 'id' to silence this warning
           int err, id;
                      ^
                       = 0
   1 warning generated.


vim +97 drivers/tty/serial/serial_base_bus.c

    77	
    78	static struct device *serial_base_device_add(struct uart_port *port,
    79						     struct device *parent_dev,
    80						     const struct device_type *type)
    81	{
    82		struct serial_base_device *sbd;
    83		int err, id;
    84	
    85		sbd = kzalloc(sizeof(*sbd), GFP_KERNEL);
    86		if (!sbd)
    87			return NULL;
    88	
    89		device_initialize(&sbd->dev);
    90		sbd->dev.type = type;
    91		sbd->dev.parent = parent_dev;
    92		sbd->dev.bus = &serial_base_bus_type;
    93		sbd->dev.release = &serial_base_release;
    94	
    95		if (type == &serial_ctrl_type) {
    96			id = port->ctrl_id;
  > 97		} else if (type == &serial_port_type) {
    98			id = port->line;
    99			sbd->port = port;
   100		}
   101	
   102		err = dev_set_name(&sbd->dev, "%s.%s.%d", type->name, dev_name(port->dev), id);
   103		if (err)
   104			goto err_free_dev;
   105	
   106		err = device_add(&sbd->dev);
   107		if (err)
   108			goto err_put_device;
   109	
   110		return &sbd->dev;
   111	
   112	err_put_device:
   113		put_device(&sbd->dev);
   114	
   115	err_free_dev:
   116		kfree(sbd);
   117	
   118		return NULL;
   119	}
   120	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

  parent reply	other threads:[~2023-05-08 23:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-08 11:03 [PATCH v10 1/1] serial: core: Start managing serial controllers to enable runtime PM Tony Lindgren
2023-05-08 12:11 ` Andy Shevchenko
2023-05-08 13:35   ` Tony Lindgren
2023-05-08 23:13 ` kernel test robot [this message]
2023-05-09  6:57   ` Tony Lindgren

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=202305090752.w4XZxmsN-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=bigeasy@linutronix.de \
    --cc=d-gole@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jirislaby@kernel.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=tony@atomide.com \
    --cc=vigneshr@ti.com \
    /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).