From: Roel Kluin <roel.kluin@gmail.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Roel Kluin <roel.kluin@gmail.com>,
"grant.likely@linaro.org" <grant.likely@linaro.org>,
"rob.herring@calxeda.com" <rob.herring@calxeda.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Tony Prisk <linux@prisktech.co.nz>,
linux-serial@vger.kernel.org
Subject: Re: [PATCH] In absence of braces, port and NULL are missed
Date: Mon, 14 Oct 2013 23:21:15 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.02.1310142027370.11060@Z> (raw)
In-Reply-To: <20131014125449.GB31708@e106331-lin.cambridge.arm.com>
Hi Mark,
On Mon, 14 Oct 2013, Mark Rutland wrote:
> While this looks like a good fix, the commit message is a bit confusing.
I like your suggestion, however I feel the commit message fails to
appreciate the error path this patch addresses as well, so I adapted your
suggested commit message to the following:
---
[PATCH] serial: vt8500: add missing braces
Due to missing braces on an if statement, in presence of a device_node
a port was always assigned -1, regardless of any alias entries in the
device tree. Conversely, if device_node was NULL, an unitialized port
ended up being used.
This patch adds the missing braces, fixing the issues.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Tony Prisk <linux@prisktech.co.nz>
diff --git a/drivers/tty/serial/vt8500_serial.c
b/drivers/tty/serial/vt8500_serial.c
index 93b697a..4cf71c0 100644
--- a/drivers/tty/serial/vt8500_serial.c
+++ b/drivers/tty/serial/vt8500_serial.c
@@ -561,12 +561,13 @@ static int vt8500_serial_probe(struct
platform_device *pdev)
if (!mmres || !irqres)
return -ENODEV;
- if (np)
+ if (np) {
port = of_alias_get_id(np, "serial");
if (port >= VT8500_MAX_PORTS)
port = -1;
- else
+ } else {
port = -1;
+ }
if (port < 0) {
/* calculate the port id */
prev parent reply other threads:[~2013-10-14 21:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-13 22:29 [PATCH] In absence of braces, port and NULL are missed Roel Kluin
2013-10-14 12:54 ` Mark Rutland
2013-10-14 17:37 ` Tony Prisk
2013-10-14 21:21 ` Roel Kluin [this message]
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=alpine.DEB.2.02.1310142027370.11060@Z \
--to=roel.kluin@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=grant.likely@linaro.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux@prisktech.co.nz \
--cc=mark.rutland@arm.com \
--cc=rob.herring@calxeda.com \
/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