From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934215AbdKGN2Z (ORCPT ); Tue, 7 Nov 2017 08:28:25 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:54484 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933796AbdKGN2X (ORCPT ); Tue, 7 Nov 2017 08:28:23 -0500 X-Google-Smtp-Source: ABhQp+TdjxQUT6OcumM8tij0F8MDZOJeS2ya21s5hj56kzPSUWYL4j+ud59EmntgqxzgxQMI+K9p9A== Subject: Re: [PATCH] Documentation/rs485: Fix missing zero init on sample code To: Ricardo Ribalda Delgado , Greg Kroah-Hartman , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, claudio@evidence.eu.com References: <20171106105102.3051-1-ricardo.ribalda@gmail.com> From: Jiri Slaby Message-ID: <975e0566-c9e8-06d3-ec66-8a8aaf836760@suse.cz> Date: Tue, 7 Nov 2017 14:28:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171106105102.3051-1-ricardo.ribalda@gmail.com> Content-Type: text/plain; charset=iso-8859-2 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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