linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Martin Kepplinger <martink@posteo.de>
Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: adc: dln2-adc: initialize local struct before using it
Date: Sun, 10 Sep 2017 16:30:58 +0100	[thread overview]
Message-ID: <20170910163058.0eefc6ae@archlinux> (raw)
In-Reply-To: <20170910124501.30829-1-martink@posteo.de>

On Sun, 10 Sep 2017 14:45:01 +0200
Martin Kepplinger <martink@posteo.de> wrote:

> struct data is defined and declared locally. Initiliazation has to be done
> manually, so let's add that.
> 
> Signed-off-by: Martin Kepplinger <martink@posteo.de>
> ---
> 
> This is more of a question actually! Did you have in mind that data is
> not initialized here? If so, please drop this patch. This is just in case
> you implicitely expected data to be zero.
> 

I don't think it matters as the whole structure is filled by the later
code anyway..  Am I missing a path where it isn't?

Jonathan

> 
>  drivers/iio/adc/dln2-adc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/dln2-adc.c b/drivers/iio/adc/dln2-adc.c
> index ab8d6aed5085..452330075b67 100644
> --- a/drivers/iio/adc/dln2-adc.c
> +++ b/drivers/iio/adc/dln2-adc.c
> @@ -489,7 +489,7 @@ static irqreturn_t dln2_adc_trigger_h(int irq, void *p)
>  	struct {
>  		__le16 values[DLN2_ADC_MAX_CHANNELS];
>  		int64_t timestamp_space;
> -	} data;
> +	} data = { 0 };
>  	struct dln2_adc_get_all_vals dev_data;
>  	struct dln2_adc *dln2 = iio_priv(indio_dev);
>  	const struct dln2_adc_demux_table *t;


  reply	other threads:[~2017-09-10 15:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-10 12:45 [PATCH] iio: adc: dln2-adc: initialize local struct before using it Martin Kepplinger
2017-09-10 15:30 ` Jonathan Cameron [this message]
2017-09-12  1:32 ` kbuild test robot
2017-09-12  7:01   ` Martin Kepplinger
2017-09-13 16:52     ` Jonathan Cameron

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=20170910163058.0eefc6ae@archlinux \
    --to=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martink@posteo.de \
    --cc=pmeerw@pmeerw.net \
    /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;
as well as URLs for NNTP newsgroup(s).