All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Lei Liu" <liulei.rjpt@vivo.com>,
	"Paul Cercueil" <paul@crapouillou.net>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Jiri Slaby" <jirislaby@kernel.org>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Jonathan Hunter" <jonathanh@nvidia.com>,
	"Kunihiko Hayashi" <hayashi.kunihiko@socionext.com>,
	"Masami Hiramatsu" <mhiramat@kernel.org>,
	"Richard Genoud" <richard.genoud@bootlin.com>,
	"Nicolas Ferre" <nicolas.ferre@microchip.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
	"Liviu Dudau" <liviu.dudau@arm.com>,
	"Sudeep Holla" <sudeep.holla@arm.com>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Andreas Färber" <afaerber@suse.de>,
	"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	"Patrice Chotard" <patrice.chotard@foss.st.com>,
	"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
	"Alexandre Torgue" <alexandre.torgue@foss.st.com>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"John Ogness" <john.ogness@linutronix.de>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
	"Jeff Johnson" <quic_jjohnson@quicinc.com>,
	"Valentin Caron" <valentin.caron@foss.st.com>,
	"Lino Sanfilippo" <l.sanfilippo@kunbus.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH 5/8] tty: mps2-uart: Use devm_clk_get_enabled() helpers
Date: Fri, 23 Aug 2024 01:20:21 +0800	[thread overview]
Message-ID: <202408230137.c8NBMil9-lkp@intel.com> (raw)
In-Reply-To: <20240822033924.32397-6-liulei.rjpt@vivo.com>

Hi Lei,

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 atorgue-stm32/stm32-next mani-mhi/mhi-next linus/master v6.11-rc4 next-20240822]
[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/Lei-Liu/tty-8250_ingenic-Use-devm_clk_get_enabled-helpers/20240822-114359
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
patch link:    https://lore.kernel.org/r/20240822033924.32397-6-liulei.rjpt%40vivo.com
patch subject: [PATCH 5/8] tty: mps2-uart: Use devm_clk_get_enabled() helpers
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20240823/202408230137.c8NBMil9-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 26670e7fa4f032a019d23d56c6a02926e854e8af)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240823/202408230137.c8NBMil9-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408230137.c8NBMil9-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/tty/serial/mps2-uart.c:17:
   In file included from include/linux/io.h:14:
   In file included from arch/s390/include/asm/io.h:93:
   include/asm-generic/io.h:548:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     548 |         val = __raw_readb(PCI_IOBASE + addr);
         |                           ~~~~~~~~~~ ^
   include/asm-generic/io.h:561:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     561 |         val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:37:59: note: expanded from macro '__le16_to_cpu'
      37 | #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
         |                                                           ^
   include/uapi/linux/swab.h:102:54: note: expanded from macro '__swab16'
     102 | #define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
         |                                                      ^
   In file included from drivers/tty/serial/mps2-uart.c:17:
   In file included from include/linux/io.h:14:
   In file included from arch/s390/include/asm/io.h:93:
   include/asm-generic/io.h:574:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     574 |         val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:35:59: note: expanded from macro '__le32_to_cpu'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                                                           ^
   include/uapi/linux/swab.h:115:54: note: expanded from macro '__swab32'
     115 | #define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
         |                                                      ^
   In file included from drivers/tty/serial/mps2-uart.c:17:
   In file included from include/linux/io.h:14:
   In file included from arch/s390/include/asm/io.h:93:
   include/asm-generic/io.h:585:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     585 |         __raw_writeb(value, PCI_IOBASE + addr);
         |                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:595:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     595 |         __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:605:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     605 |         __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:693:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     693 |         readsb(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:701:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     701 |         readsw(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:709:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     709 |         readsl(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:718:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     718 |         writesb(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   include/asm-generic/io.h:727:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     727 |         writesw(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   include/asm-generic/io.h:736:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     736 |         writesl(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   In file included from drivers/tty/serial/mps2-uart.c:20:
   In file included from include/linux/platform_device.h:13:
   In file included from include/linux/device.h:32:
   In file included from include/linux/device/driver.h:21:
   In file included from include/linux/module.h:19:
   In file included from include/linux/elf.h:6:
   In file included from arch/s390/include/asm/elf.h:181:
   In file included from arch/s390/include/asm/mmu_context.h:11:
   In file included from arch/s390/include/asm/pgalloc.h:18:
   In file included from include/linux/mm.h:2228:
   include/linux/vmstat.h:503:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     503 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     504 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:510:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     510 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     511 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:517:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     517 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   include/linux/vmstat.h:523:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     523 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     524 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
>> drivers/tty/serial/mps2-uart.c:567:9: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
     567 |         return ret;
         |                ^~~
   drivers/tty/serial/mps2-uart.c:539:9: note: initialize the variable 'ret' to silence this warning
     539 |         int ret;
         |                ^
         |                 = 0
   17 warnings generated.


vim +/ret +567 drivers/tty/serial/mps2-uart.c

041f031def3305 Vladimir Murzin 2016-04-25  534  
9f25e07b882bd1 Vladimir Murzin 2019-01-30  535  static int mps2_init_port(struct platform_device *pdev,
9f25e07b882bd1 Vladimir Murzin 2019-01-30  536  			  struct mps2_uart_port *mps_port)
041f031def3305 Vladimir Murzin 2016-04-25  537  {
041f031def3305 Vladimir Murzin 2016-04-25  538  	struct resource *res;
041f031def3305 Vladimir Murzin 2016-04-25  539  	int ret;
041f031def3305 Vladimir Murzin 2016-04-25  540  
6b4cda0248360d Yangtao Li      2023-07-12  541  	mps_port->port.membase = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
041f031def3305 Vladimir Murzin 2016-04-25  542  	if (IS_ERR(mps_port->port.membase))
041f031def3305 Vladimir Murzin 2016-04-25  543  		return PTR_ERR(mps_port->port.membase);
041f031def3305 Vladimir Murzin 2016-04-25  544  
041f031def3305 Vladimir Murzin 2016-04-25  545  	mps_port->port.mapbase = res->start;
041f031def3305 Vladimir Murzin 2016-04-25  546  	mps_port->port.mapsize = resource_size(res);
041f031def3305 Vladimir Murzin 2016-04-25  547  	mps_port->port.iotype = UPIO_MEM;
041f031def3305 Vladimir Murzin 2016-04-25  548  	mps_port->port.flags = UPF_BOOT_AUTOCONF;
041f031def3305 Vladimir Murzin 2016-04-25  549  	mps_port->port.fifosize = 1;
041f031def3305 Vladimir Murzin 2016-04-25  550  	mps_port->port.ops = &mps2_uart_pops;
041f031def3305 Vladimir Murzin 2016-04-25  551  	mps_port->port.dev = &pdev->dev;
041f031def3305 Vladimir Murzin 2016-04-25  552  
7a06cfee297041 Lei Liu         2024-08-22  553  	mps_port->clk = devm_clk_get_enabled(&pdev->dev, NULL);
041f031def3305 Vladimir Murzin 2016-04-25  554  	if (IS_ERR(mps_port->clk))
041f031def3305 Vladimir Murzin 2016-04-25  555  		return PTR_ERR(mps_port->clk);
041f031def3305 Vladimir Murzin 2016-04-25  556  
041f031def3305 Vladimir Murzin 2016-04-25  557  	mps_port->port.uartclk = clk_get_rate(mps_port->clk);
041f031def3305 Vladimir Murzin 2016-04-25  558  
775ea4ea2fd9a4 Vladimir Murzin 2019-01-30  559  	if (mps_port->flags & UART_PORT_COMBINED_IRQ) {
775ea4ea2fd9a4 Vladimir Murzin 2019-01-30  560  		mps_port->port.irq = platform_get_irq(pdev, 0);
775ea4ea2fd9a4 Vladimir Murzin 2019-01-30  561  	} else {
775ea4ea2fd9a4 Vladimir Murzin 2019-01-30  562  		mps_port->rx_irq = platform_get_irq(pdev, 0);
775ea4ea2fd9a4 Vladimir Murzin 2019-01-30  563  		mps_port->tx_irq = platform_get_irq(pdev, 1);
775ea4ea2fd9a4 Vladimir Murzin 2019-01-30  564  		mps_port->port.irq = platform_get_irq(pdev, 2);
775ea4ea2fd9a4 Vladimir Murzin 2019-01-30  565  	}
775ea4ea2fd9a4 Vladimir Murzin 2019-01-30  566  
041f031def3305 Vladimir Murzin 2016-04-25 @567  	return ret;
041f031def3305 Vladimir Murzin 2016-04-25  568  }
041f031def3305 Vladimir Murzin 2016-04-25  569  

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

  parent reply	other threads:[~2024-08-22 17:21 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-22  3:39 [PATCH 0/8] tty serial drivers use devm_clk_get_enabled() helpers Lei Liu
2024-08-22  3:39 ` [PATCH 1/8] tty: 8250_ingenic: Use " Lei Liu
2024-08-22  9:40   ` Paul Cercueil
2024-08-22 13:24     ` Andy Shevchenko
2024-08-22 13:24       ` Andy Shevchenko
2024-08-22 13:09   ` Andy Shevchenko
2024-08-22 13:09     ` Andy Shevchenko
2024-08-22  3:39 ` [PATCH 2/8] tty: 8250_tegra: " Lei Liu
2024-08-22 13:10   ` Andy Shevchenko
2024-08-22 13:10     ` Andy Shevchenko
2024-08-22  3:39 ` [PATCH 3/8] tty: 8250_uniphier: " Lei Liu
2024-08-22  3:39 ` [PATCH 4/8] tty: atmel_serial: " Lei Liu
2024-08-22 13:28   ` Richard GENOUD
2024-08-22 13:28     ` Richard GENOUD
2024-08-22 13:34     ` Andy Shevchenko
2024-08-22 13:34       ` Andy Shevchenko
2024-08-22 14:33       ` Alexandre Belloni
2024-08-22 14:33         ` Alexandre Belloni
2024-08-22  3:39 ` [PATCH 5/8] tty: mps2-uart: " Lei Liu
2024-08-22 13:19   ` Andy Shevchenko
2024-08-22 13:19     ` Andy Shevchenko
2024-08-22 13:29     ` Lei Liu
2024-08-22 13:29       ` Lei Liu
2024-08-22 17:20   ` kernel test robot [this message]
2024-08-22  3:39 ` [PATCH 6/8] tty: owl-uart: " Lei Liu
2024-08-22  3:39 ` [PATCH 7/8] tty: st-asc: " Lei Liu
2024-08-22 13:21   ` Andy Shevchenko
2024-08-22 13:21     ` Andy Shevchenko
2024-08-22  3:39 ` [PATCH 8/8] tty: stm32-usart: " Lei Liu
2024-08-22 13:23   ` Andy Shevchenko
2024-08-22 13:23     ` Andy Shevchenko

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=202408230137.c8NBMil9-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=afaerber@suse.de \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=bigeasy@linutronix.de \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=hayashi.kunihiko@socionext.com \
    --cc=jirislaby@kernel.org \
    --cc=john.ogness@linutronix.de \
    --cc=jonathanh@nvidia.com \
    --cc=l.sanfilippo@kunbus.com \
    --cc=liulei.rjpt@vivo.com \
    --cc=liviu.dudau@arm.com \
    --cc=llvm@lists.linux.dev \
    --cc=lpieralisi@kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=mhiramat@kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=patrice.chotard@foss.st.com \
    --cc=paul@crapouillou.net \
    --cc=quic_jjohnson@quicinc.com \
    --cc=richard.genoud@bootlin.com \
    --cc=sudeep.holla@arm.com \
    --cc=tglx@linutronix.de \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=valentin.caron@foss.st.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.