Skip to contentSkip to conversation

omap-serial: Add minimal device tree support

DISCUSSION Dan Carpenter 1 participant 1 message Nov 6, 2013 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

Hello Rajendra Nayak,

The patch d92b0dfc5078: "omap-serial: Add minimal device tree support" from Dec 14, 2011, leads to the following Smatch warning:

	"drivers/tty/serial/omap-serial.c:1700 serial_omap_probe()
	 warn: unsigned 'up->port.line' is never less than zero."

drivers/tty/serial/omap-serial.c
1695 if (pdev->dev.of_node)
1696 up->port.line = of_alias_get_id(pdev->dev.of_node, "serial");
1697 else
1698 up->port.line = pdev->id;
1699

  1700          if (up->port.line < 0) {
                    ^^^^^^^^^^^^^^^^^

This condition is never true because "up->port.line" is unsigned.

1701 dev_err(&pdev->dev, "failed to get alias/pdev id, errno %d\n",
1702 up->port.line);
1703 ret = -ENODEV;
1704 goto err_port_line;
1705 }

regards,
dan carpenter