From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tony Prisk Subject: Re: [PATCH] In absence of braces, port and NULL are missed Date: Tue, 15 Oct 2013 06:37:06 +1300 Message-ID: <525C2BC2.1030207@prisktech.co.nz> References: <1381703376-31380-1-git-send-email-roel.kluin@gmail.com> <20131014125449.GB31708@e106331-lin.cambridge.arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from server.prisktech.co.nz ([115.188.14.127]:63603 "EHLO server.prisktech.co.nz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756608Ab3JNRgw (ORCPT ); Mon, 14 Oct 2013 13:36:52 -0400 In-Reply-To: <20131014125449.GB31708@e106331-lin.cambridge.arm.com> Sender: linux-serial-owner@vger.kernel.org List-Id: linux-serial@vger.kernel.org To: Mark Rutland , Roel Kluin Cc: "grant.likely@linaro.org" , "rob.herring@calxeda.com" , "devicetree@vger.kernel.org" , linux-serial@vger.kernel.org On 15/10/13 01:54, Mark Rutland wrote: > [Adding Tony Prisk and linux-serial] > > Hi Roel, > > While this looks like a good fix, the commit message is a bit confusing. > How about something like the message between the scissor lines below: > > ---->8---- > [PATCH] serial: vt8500: add missing braces > > Due to missing braces on an if statement, port will always be assigned > -1 regardless of any alias entries in the dt, which was clearly not the > intended behaviour. > > This patch adds the missing braces, fixing the issue. > ---->8---- > > Also, while this is device tree related, you should Cc the driver > maintainer when submitting driver changes. > > Cheers, > Mark. > > On Sun, Oct 13, 2013 at 11:29:36PM +0100, Roel Kluin wrote: >> Signed-off-by: Roel Kluin >> --- >> drivers/tty/serial/vt8500_serial.c | 5 +++-- >> 1 file changed, 3 insertions(+), 2 deletions(-) >> >> 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 */ >> -- >> 1.8.1.2 >> >> -- >> To unsubscribe from this list: send the line "unsubscribe devicetree" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >> Nice find and thanks for the fix. Acked-by: Tony Prisk Regards Tony P