All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/tty/serial/serial_core.c:621 uart_write_room() warn: unsigned 'ret' is never less than zero.
@ 2021-09-28 11:47 ` kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2021-09-28 11:47 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: kbuild-all, linux-kernel, 0day robot

[-- Attachment #1: Type: text/plain, Size: 1669 bytes --]

tree:   https://github.com/0day-ci/linux/commits/Tony-Lindgren/Get-rid-of-pm_runtime_irq_safe-for-8250_omap/20210922-152808
head:   4456f28c1932b70461a0d8c45d4e863fa9d1be29
commit: 3c7e2a8d4353263d8c5607fc7eca5e4b009f45eb serial: core: Add new prep_tx for power management
date:   6 days ago
config: i386-randconfig-m021-20210927 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

New smatch warnings:
drivers/tty/serial/serial_core.c:621 uart_write_room() warn: unsigned 'ret' is never less than zero.

Old smatch warnings:
drivers/tty/serial/serial_core.c:308 uart_shutdown() error: we previously assumed 'uport' could be null (see line 304)
drivers/tty/serial/serial_core.c:329 uart_shutdown() error: uninitialized symbol 'flags'.
drivers/tty/serial/serial_core.c:2753 iomem_base_show() warn: argument 3 to %lX specifier is cast from pointer

vim +/ret +621 drivers/tty/serial/serial_core.c

   611	
   612	static unsigned int uart_write_room(struct tty_struct *tty)
   613	{
   614		struct uart_state *state = tty->driver_data;
   615		struct uart_port *port;
   616		unsigned long flags;
   617		unsigned int ret;
   618	
   619		port = uart_port_lock(state, flags);
   620		ret = __uart_prep_tx(tty);
 > 621		if (ret < 0) {
   622			uart_port_unlock(port, flags);
   623			return 0;
   624		}
   625	
   626		ret = uart_circ_chars_free(&state->xmit);
   627		uart_port_unlock(port, flags);
   628		return ret;
   629	}
   630	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 40442 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* drivers/tty/serial/serial_core.c:621 uart_write_room() warn: unsigned 'ret' is never less than zero.
@ 2021-09-28 11:47 ` kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2021-09-28 11:47 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1715 bytes --]

tree:   https://github.com/0day-ci/linux/commits/Tony-Lindgren/Get-rid-of-pm_runtime_irq_safe-for-8250_omap/20210922-152808
head:   4456f28c1932b70461a0d8c45d4e863fa9d1be29
commit: 3c7e2a8d4353263d8c5607fc7eca5e4b009f45eb serial: core: Add new prep_tx for power management
date:   6 days ago
config: i386-randconfig-m021-20210927 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

New smatch warnings:
drivers/tty/serial/serial_core.c:621 uart_write_room() warn: unsigned 'ret' is never less than zero.

Old smatch warnings:
drivers/tty/serial/serial_core.c:308 uart_shutdown() error: we previously assumed 'uport' could be null (see line 304)
drivers/tty/serial/serial_core.c:329 uart_shutdown() error: uninitialized symbol 'flags'.
drivers/tty/serial/serial_core.c:2753 iomem_base_show() warn: argument 3 to %lX specifier is cast from pointer

vim +/ret +621 drivers/tty/serial/serial_core.c

   611	
   612	static unsigned int uart_write_room(struct tty_struct *tty)
   613	{
   614		struct uart_state *state = tty->driver_data;
   615		struct uart_port *port;
   616		unsigned long flags;
   617		unsigned int ret;
   618	
   619		port = uart_port_lock(state, flags);
   620		ret = __uart_prep_tx(tty);
 > 621		if (ret < 0) {
   622			uart_port_unlock(port, flags);
   623			return 0;
   624		}
   625	
   626		ret = uart_circ_chars_free(&state->xmit);
   627		uart_port_unlock(port, flags);
   628		return ret;
   629	}
   630	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 40442 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: drivers/tty/serial/serial_core.c:621 uart_write_room() warn: unsigned 'ret' is never less than zero.
  2021-09-28 11:47 ` kernel test robot
@ 2021-09-30  8:33   ` Tony Lindgren
  -1 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2021-09-30  8:33 UTC (permalink / raw)
  To: kernel test robot; +Cc: kbuild-all, linux-kernel

* kernel test robot <lkp@intel.com> [210928 11:48]:
> tree:   https://github.com/0day-ci/linux/commits/Tony-Lindgren/Get-rid-of-pm_runtime_irq_safe-for-8250_omap/20210922-152808
> head:   4456f28c1932b70461a0d8c45d4e863fa9d1be29
> commit: 3c7e2a8d4353263d8c5607fc7eca5e4b009f45eb serial: core: Add new prep_tx for power management
> date:   6 days ago
> config: i386-randconfig-m021-20210927 (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> New smatch warnings:
> drivers/tty/serial/serial_core.c:621 uart_write_room() warn: unsigned 'ret' is never less than zero.
> 
> Old smatch warnings:
> drivers/tty/serial/serial_core.c:308 uart_shutdown() error: we previously assumed 'uport' could be null (see line 304)
> drivers/tty/serial/serial_core.c:329 uart_shutdown() error: uninitialized symbol 'flags'.
> drivers/tty/serial/serial_core.c:2753 iomem_base_show() warn: argument 3 to %lX specifier is cast from pointer

FYI, this patch is no longer needed, updated series posted at [0] below.

Thanks,

Tony

[0] https://lore.kernel.org/linux-kernel/20210930062906.58937-1-tony@atomide.com/T/#m8aa4dc5d38218d17c652d45d3611fc8a696b96c1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: drivers/tty/serial/serial_core.c:621 uart_write_room() warn: unsigned 'ret' is never less than zero.
@ 2021-09-30  8:33   ` Tony Lindgren
  0 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2021-09-30  8:33 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1295 bytes --]

* kernel test robot <lkp@intel.com> [210928 11:48]:
> tree:   https://github.com/0day-ci/linux/commits/Tony-Lindgren/Get-rid-of-pm_runtime_irq_safe-for-8250_omap/20210922-152808
> head:   4456f28c1932b70461a0d8c45d4e863fa9d1be29
> commit: 3c7e2a8d4353263d8c5607fc7eca5e4b009f45eb serial: core: Add new prep_tx for power management
> date:   6 days ago
> config: i386-randconfig-m021-20210927 (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> New smatch warnings:
> drivers/tty/serial/serial_core.c:621 uart_write_room() warn: unsigned 'ret' is never less than zero.
> 
> Old smatch warnings:
> drivers/tty/serial/serial_core.c:308 uart_shutdown() error: we previously assumed 'uport' could be null (see line 304)
> drivers/tty/serial/serial_core.c:329 uart_shutdown() error: uninitialized symbol 'flags'.
> drivers/tty/serial/serial_core.c:2753 iomem_base_show() warn: argument 3 to %lX specifier is cast from pointer

FYI, this patch is no longer needed, updated series posted at [0] below.

Thanks,

Tony

[0] https://lore.kernel.org/linux-kernel/20210930062906.58937-1-tony(a)atomide.com/T/#m8aa4dc5d38218d17c652d45d3611fc8a696b96c1

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-30  8:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-28 11:47 drivers/tty/serial/serial_core.c:621 uart_write_room() warn: unsigned 'ret' is never less than zero kernel test robot
2021-09-28 11:47 ` kernel test robot
2021-09-30  8:33 ` Tony Lindgren
2021-09-30  8:33   ` Tony Lindgren

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.