From: Samuel Ortiz <sameo@linux.intel.com>
To: Axel Lin <axel.lin@gmail.com>
Cc: linux-kernel@vger.kernel.org,
Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: Re: [PATCH] mfd: Silence uninitialized variable warning for wm8994-core
Date: Mon, 16 Apr 2012 17:37:08 +0200 [thread overview]
Message-ID: <20120416153708.GG24130@sortiz-mobl> (raw)
In-Reply-To: <1333597752.10597.1.camel@phoenix>
Hi Axel,
On Thu, Apr 05, 2012 at 11:49:12AM +0800, Axel Lin wrote:
> Fix below build warning:
> CC drivers/mfd/wm8994-core.o
> drivers/mfd/wm8994-core.c: In function 'wm8994_i2c_probe':
> drivers/mfd/wm8994-core.c:582:7: warning: 'patch_regs' may be used uninitialized in this function [-Wuninitialized]
> drivers/mfd/wm8994-core.c:393:14: note: 'patch_regs' was declared here
>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
> drivers/mfd/wm8994-core.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c
> index 9d7ca1e..bd02202 100644
> --- a/drivers/mfd/wm8994-core.c
> +++ b/drivers/mfd/wm8994-core.c
> @@ -390,7 +390,7 @@ static __devinit int wm8994_device_init(struct wm8994 *wm8994, int irq)
> struct regmap_config *regmap_config;
> const struct reg_default *regmap_patch = NULL;
> const char *devname;
> - int ret, i, patch_regs;
> + int ret, i, patch_regs = 0;
I'd agree with Mark here. I don't particularily like this kind of fix as it
basically turns potentially useful gcc warnings off.
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
prev parent reply other threads:[~2012-04-16 15:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-05 3:49 [PATCH] mfd: Silence uninitialized variable warning for wm8994-core Axel Lin
2012-04-05 9:57 ` Mark Brown
2012-04-16 15:37 ` Samuel Ortiz [this message]
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=20120416153708.GG24130@sortiz-mobl \
--to=sameo@linux.intel.com \
--cc=axel.lin@gmail.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linux-kernel@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