drivers/tty/serial/mcf.c:586 mcf_probe() warn: unsigned 'port->irq' is never less than zero.
kernel test robot
build bottree: https://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu.git cf-serial head: 13e7fc3bb9e0e6b9de008260d6925af530c79882 commit: 93cb854f633956fd1e5df8744a9e27695b2e8cd8 [1/4] serial: mcf: convert to use proper platform resources config: m68k-randconfig-2200-20261118 (https://download.01.org/0day-ci/archive/20261118/[email protected]/config) compiler: m68k-linux-gcc (GCC) 12.5.0 smatch: v0.5.0-9187-g5189e3fb
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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
smatch warnings:drivers/tty/serial/mcf.c:586 mcf_probe() warn: unsigned 'port->irq' is never less than zero.
vim +586 drivers/tty/serial/mcf.c
570
571 static int mcf_probe(struct platform_device *pdev)
572 {
573 struct uart_port *port;
574 struct resource *res;
575
576 if (pdev->id >= MCF_MAXPORTS)
577 return -ENODEV;
578 port = &mcf_ports[pdev->id].port;
579
580 port->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
581 if (IS_ERR(port->membase))
582 return PTR_ERR(port->membase);
583 port->mapbase = res->start;
584
585 port->irq = platform_get_irq(pdev, 0);
> 586 if (port->irq < 0)
587 return port->irq;
588
589 port->line = pdev->id;
590 port->type = PORT_MCF;
591 port->dev = &pdev->dev;
592 port->iotype = SERIAL_IO_MEM;
593 port->uartclk = MCF_BUSCLK;
594 port->ops = &mcf_uart_ops;
595 port->flags = UPF_BOOT_AUTOCONF;
596 port->rs485_config = mcf_config_rs485;
597 port->rs485_supported = mcf_rs485_supported;
598 port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_MCF_CONSOLE);
599
600 uart_add_one_port(&mcf_driver, port);
601 return 0;
602 }
603
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki