linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Darshana Padmadas <darshanapadmadas@gmail.com>
Cc: outreachy-kernel@googlegroups.com, jic23@kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [Outreachy kernel] [PATCH] iio: adc: Call uninitialized_var for raw_sample
Date: Thu, 19 Mar 2015 15:05:11 +0100	[thread overview]
Message-ID: <20150319140511.GA7046@kroah.com> (raw)
In-Reply-To: <1426772061-20753-1-git-send-email-darshanapadmadas@gmail.com>

On Thu, Mar 19, 2015 at 07:04:21PM +0530, Darshana Padmadas wrote:
> This patch calls uninitialized_var function for uninitialized
> variable raw_sample. This error was reported by the static
> analysis tool, cppcheck.
> 
> Signed-off-by: Darshana Padmadas <darshanapadmadas@gmail.com>
> ---
>  drivers/iio/adc/ad_sigma_delta.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c
> index d10bd0c..f0bbf3c 100644
> --- a/drivers/iio/adc/ad_sigma_delta.c
> +++ b/drivers/iio/adc/ad_sigma_delta.c
> @@ -248,7 +248,8 @@ int ad_sigma_delta_single_conversion(struct iio_dev *indio_dev,
>  	const struct iio_chan_spec *chan, int *val)
>  {
>  	struct ad_sigma_delta *sigma_delta = iio_device_get_drvdata(indio_dev);
> -	unsigned int sample, raw_sample;
> +	unsigned int sample;
> +	unsigned int uninitialized_var(raw_sample);

I don't understand, what exactly is this "fixing"?

And note, cppcheck is known to give you lots of false warnings / errors,
be very careful when using it.  Some kernel developers refuse to take
patches that mention it given that it has been wrong so many times in
the past.

thanks,

greg k-h

  reply	other threads:[~2015-03-19 14:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19 13:34 [PATCH] iio: adc: Call uninitialized_var for raw_sample Darshana Padmadas
2015-03-19 14:05 ` Greg KH [this message]
2015-03-21 11:49   ` [Outreachy kernel] " 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=20150319140511.GA7046@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=darshanapadmadas@gmail.com \
    --cc=jic23@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=outreachy-kernel@googlegroups.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;
as well as URLs for NNTP newsgroup(s).