linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: bigeasy@linutronix.de
Cc: linux-serial@vger.kernel.org
Subject: re: tty: serial: Add 8250-core based omap driver
Date: Wed, 12 Nov 2014 11:48:07 +0300	[thread overview]
Message-ID: <20141112084807.GB13955@mwanda> (raw)

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

             reply	other threads:[~2014-11-12  8:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-12  8:48 Dan Carpenter [this message]
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

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=20141112084807.GB13955@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=bigeasy@linutronix.de \
    --cc=linux-serial@vger.kernel.org \
    /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 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).