netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Olof Johansson <olof@lixom.net>
To: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Cc: Chas Williams <chas@cmf.nrl.navy.mil>,
	Grant Likely <grant.likely@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	linux-atm-general@lists.sourceforge.net,
	Network Development <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH] atm: fore200e.c: Cleaning up uninitialized variables
Date: Sun, 1 Jun 2014 17:10:39 -0700	[thread overview]
Message-ID: <CAOesGMi4SGRP6_WMgv3xz_QrGScktYGQEK-muCrE=ohFBfeBeQ@mail.gmail.com> (raw)
In-Reply-To: <1401577712-4447-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

On Sat, May 31, 2014 at 4:08 PM, Rickard Strandqvist
<rickard_strandqvist@spectrumdigital.se> wrote:
> There is a risk that the variable will be used without being initialized.
>
> This was largely found by using a static code analysis program called cppcheck.
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
>  drivers/atm/fore200e.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
> index 204814e..d4725fc 100644
> --- a/drivers/atm/fore200e.c
> +++ b/drivers/atm/fore200e.c
> @@ -2780,7 +2780,7 @@ static struct pci_driver fore200e_pca_driver = {
>
>  static int __init fore200e_module_init(void)
>  {
> -       int err;
> +       int err = 0;
>
>         printk(FORE200E "FORE Systems 200E-series ATM driver - version " FORE200E_VERSION "\n");


I can see how a tool that doesn't know about Kconfig dependencies
might think so, but if you look at Kconfig you'll see that for this
driver to be enabled for building either CONFIG_SBUS or CONFIG_PCI
must be set, and if either of them is then this variable will not be
used without first being set.


-Olof

  reply	other threads:[~2014-06-02  0:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-31 23:08 [PATCH] atm: fore200e.c: Cleaning up uninitialized variables Rickard Strandqvist
2014-06-02  0:10 ` Olof Johansson [this message]
2014-06-02 19:40   ` Rickard Strandqvist
     [not found]   ` <CAOesGMi4SGRP6_WMgv3xz_QrGScktYGQEK-muCrE=ohFBfeBeQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-06-03  0:11     ` David Miller

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='CAOesGMi4SGRP6_WMgv3xz_QrGScktYGQEK-muCrE=ohFBfeBeQ@mail.gmail.com' \
    --to=olof@lixom.net \
    --cc=chas@cmf.nrl.navy.mil \
    --cc=devicetree@vger.kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=linux-atm-general@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@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;
as well as URLs for NNTP newsgroup(s).