linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* re: tty: serial: Add 8250-core based omap driver
@ 2014-11-12  8:48 Dan Carpenter
  2014-11-12  9:28 ` [PATCH 1/2] tty: serial: 8250: omap: line is unsigned, don't check < 0 Sebastian Andrzej Siewior
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2014-11-12  8:48 UTC (permalink / raw)
  To: bigeasy; +Cc: linux-serial

Hello Sebastian Andrzej Siewior,

The patch 61929cf0169d: "tty: serial: Add 8250-core based omap
driver" from Sep 29, 2014, leads to the following static checker
warning:

	drivers/tty/serial/8250/8250_omap.c:1025 omap8250_probe()
	warn: unsigned 'up.port.line' is never less than zero.

drivers/tty/serial/8250/8250_omap.c
  1015  
  1016          if (pdev->dev.of_node) {
  1017                  up.port.line = of_alias_get_id(pdev->dev.of_node, "serial");
  1018                  of_property_read_u32(pdev->dev.of_node, "clock-frequency",
  1019                                       &up.port.uartclk);
  1020                  priv->wakeirq = irq_of_parse_and_map(pdev->dev.of_node, 1);
  1021          } else {
  1022                  up.port.line = pdev->id;
  1023          }
  1024  
  1025          if (up.port.line < 0) {
                    ^^^^^^^^^^^^^^^^
Impossible.

  1026                  dev_err(&pdev->dev, "failed to get alias/pdev id, errno %d\n",
  1027                          up.port.line);
  1028                  return -ENODEV;
                        ^^^^^^^^^^^^^^
It's better to preserve the error code normally.

  1029          }

regards,
dan carpenter

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

end of thread, other threads:[~2014-11-25 19:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-12  8:48 tty: serial: Add 8250-core based omap driver Dan Carpenter
2014-11-12  9:28 ` [PATCH 1/2] tty: serial: 8250: omap: line is unsigned, don't check < 0 Sebastian Andrzej Siewior
2014-11-12  9:28   ` [PATCH 2/2] tty: serial: omap_serial: " Sebastian Andrzej Siewior
2014-11-25 18:08   ` [PATCH 1/2] tty: serial: 8250: omap: " Sebastian Andrzej Siewior
2014-11-25 19:27     ` Greg Kroah-Hartman

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).