public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Cc: David Brown <davidb@codeaurora.org>,
	Daniel Walker <dwalker@fifo99.com>,
	Bryan Huntsman <bryanh@codeaurora.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.cz>,
	Grant Likely <grant.likely@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2] tty: serial: msm_serial.c:  Cleaning up uninitialized variables
Date: Wed, 09 Jul 2014 11:02:00 -0700	[thread overview]
Message-ID: <53BD8398.6020507@codeaurora.org> (raw)
In-Reply-To: <1404665232-14311-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

On 07/06/14 09:47, Rickard Strandqvist wrote:
> Set reasonable initial value of some variables, in case
> they do not get set to something otherwise.
> And I've also added a plausibility control of the values.
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---

This patch doesn't look right...

> @@ -930,17 +930,21 @@ static int __init msm_console_setup(struct console *co, char *options)
>  
>  	msm_init_clock(port);
>  
> -	if (options)
> +	if (options) {
>  		uart_parse_options(options, &baud, &parity, &bits, &flow);
> +		if (baud < 300 || baud > 115200)
> +			baud = 115200;
> +		if (NULL == strchr("noeNOE", parity))
> +			parity = 'n';
> +		if (bits != 7)
> +			bits = 8;
> +		if (flow != 'r')
> +			flow = 'n';
> +	}
>  
> -	bits = 8;
> -	parity = 'n';
> -	flow = 'n';
>  	msm_write(port, UART_MR2_BITS_PER_CHAR_8 | UART_MR2_STOP_BIT_LEN_ONE,
>  		  UART_MR2);	/* 8N1 */
>  

because this code is overriding whatever is parsed from
uart_parse_options() on purpose. The hardware is configured for 8 bits,
no parity, no flow control with this msm_write() statement. Maybe we
should extend the code to configure the parity and flow control bits
instead.

> -	if (baud < 300 || baud > 115200)
> -		baud = 115200;
>  	msm_set_baud_rate(port, baud);
>  
>  	msm_reset(port);


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation


  reply	other threads:[~2014-07-09 18:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-06 16:47 [PATCH v2] tty: serial: msm_serial.c: Cleaning up uninitialized variables Rickard Strandqvist
2014-07-09 18:02 ` Stephen Boyd [this message]
2014-07-09 21:01   ` Rickard Strandqvist

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=53BD8398.6020507@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=bryanh@codeaurora.org \
    --cc=davidb@codeaurora.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dwalker@fifo99.com \
    --cc=grant.likely@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.cz \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=rickard_strandqvist@spectrumdigital.se \
    --cc=robh+dt@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