From: "Michael Büsch" <m@bues.ch>
To: Connor Hansen <cmdkhh@gmail.com>
Cc: mb@bu3sch.de, netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers/ssb/driver_chipcommon_pmu.c: uninitilized warning
Date: Sat, 11 Jun 2011 20:50:57 +0200 [thread overview]
Message-ID: <20110611205057.4b9bf462@maggie> (raw)
In-Reply-To: <1307816085-20062-1-git-send-email-cmdkhh@gmail.com>
On Sat, 11 Jun 2011 11:14:45 -0700
Connor Hansen <cmdkhh@gmail.com> wrote:
> warning message
> drivers/ssb/driver_chipcommon_pmu.c: In function ssb_pmu_resources_init
> drivers/ssb/driver_chipcommon_pmu.c:420:15: warning: updown_tab_size may
> be used uninitilized in this function.
>
> updown_tab_size and depend_tab_size may not be set in the bus->chip_id
> switch statement, so set to 0 by default to avoid using uninitialized
> stack space.
We wouldn't be using uninitialized stack space or uninitialized variables,
without this patch. However, for the sake of shutting up the compiler, ACK.
> Signed-off-by: Connor Hansen <cmdkhh@gmail.com>
> ---
> drivers/ssb/driver_chipcommon_pmu.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/ssb/driver_chipcommon_pmu.c b/drivers/ssb/driver_chipcommon_pmu.c
> index 305ade7..a7aef47 100644
> --- a/drivers/ssb/driver_chipcommon_pmu.c
> +++ b/drivers/ssb/driver_chipcommon_pmu.c
> @@ -417,9 +417,9 @@ static void ssb_pmu_resources_init(struct ssb_chipcommon *cc)
> u32 min_msk = 0, max_msk = 0;
> unsigned int i;
> const struct pmu_res_updown_tab_entry *updown_tab = NULL;
> - unsigned int updown_tab_size;
> + unsigned int updown_tab_size = 0;
> const struct pmu_res_depend_tab_entry *depend_tab = NULL;
> - unsigned int depend_tab_size;
> + unsigned int depend_tab_size = 0;
>
> switch (bus->chip_id) {
> case 0x4312:
next prev parent reply other threads:[~2011-06-11 18:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-11 18:14 [PATCH] drivers/ssb/driver_chipcommon_pmu.c: uninitilized warning Connor Hansen
2011-06-11 18:50 ` Michael Büsch [this message]
2011-06-12 9:07 ` Borislav Petkov
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=20110611205057.4b9bf462@maggie \
--to=m@bues.ch \
--cc=cmdkhh@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mb@bu3sch.de \
--cc=netdev@vger.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).