mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jonathan Corbet <corbet@lwn.net>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	claudio@evidence.eu.com
Subject: Re: [PATCH] Documentation/rs485: Fix missing zero init on sample code
Date: Tue, 7 Nov 2017 14:28:20 +0100	[thread overview]
Message-ID: <975e0566-c9e8-06d3-ec66-8a8aaf836760@suse.cz> (raw)
In-Reply-To: <20171106105102.3051-1-ricardo.ribalda@gmail.com>

On 11/06/2017, 11:51 AM, Ricardo Ribalda Delgado wrote:
> The sample code does not initialize to zero a local variable and then it
> uses the uninitialized code.
> 
> Fix in case someone copy/paste the sample code.
> 
> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
> ---
>  Documentation/serial/serial-rs485.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/serial/serial-rs485.txt b/Documentation/serial/serial-rs485.txt
> index 389fcd4759e9..2bbae93bf279 100644
> --- a/Documentation/serial/serial-rs485.txt
> +++ b/Documentation/serial/serial-rs485.txt
> @@ -54,7 +54,7 @@
>  		/* Error handling. See errno. */
>  	}
>  
> -	struct serial_rs485 rs485conf;
> +	struct serial_rs485 rs485conf = {};

I think that TIOCGRS485 is missing here instead. Ccing the author of the
text.

Does it break classifying potatoes :)?

>  	/* Enable RS485 mode: */
>  	rs485conf.flags |= SER_RS485_ENABLED;
> 

thanks,
-- 
js
suse labs

  reply	other threads:[~2017-11-07 13:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-06 10:51 Ricardo Ribalda Delgado
2017-11-07 13:28 ` Jiri Slaby [this message]
2017-11-07 16:09   ` Ricardo Ribalda Delgado

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=975e0566-c9e8-06d3-ec66-8a8aaf836760@suse.cz \
    --to=jslaby@suse.cz \
    --cc=claudio@evidence.eu.com \
    --cc=corbet@lwn.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ricardo.ribalda@gmail.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

all inboxes | Powered by JetHome®