From: Samuel Ortiz <sameo@linux.intel.com>
To: Aaro Koskinen <aaro.koskinen@nokia.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] mfd: twl4030-power: do not allow negative or zero length script
Date: Mon, 19 Oct 2009 18:37:16 +0200 [thread overview]
Message-ID: <20091019163715.GG3885@sortiz.org> (raw)
In-Reply-To: <1255522550-15199-1-git-send-email-aaro.koskinen@nokia.com>
Hi Aaro,
On Wed, Oct 14, 2009 at 03:15:49PM +0300, Aaro Koskinen wrote:
> The script length cannot be negative. If the length is zero, return
> an error.
>
> The patch eliminates the following compiler warning:
Out of curiosity, which toolchain are you using ? I cross compile my mfd tree
for ARM, and I dont get this error...
> drivers/mfd/twl4030-power.c: In function 'twl4030_power_init':
twl4030_power_init ? Isnt it twl4030_write_script ?
Cheers,
Samuel.
> drivers/mfd/twl4030-power.c:151: warning: 'err' may be used uninitialized in this function
> drivers/mfd/twl4030-power.c:151: note: 'err' was declared here
>
> Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
> ---
> drivers/mfd/twl4030-power.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
> index d423e0c..eae6cda 100644
> --- a/drivers/mfd/twl4030-power.c
> +++ b/drivers/mfd/twl4030-power.c
> @@ -146,9 +146,9 @@ out:
> }
>
> static int __init twl4030_write_script(u8 address, struct twl4030_ins *script,
> - int len)
> + unsigned len)
> {
> - int err;
> + int err = EINVAL;
>
> for (; len; len--, address++, script++) {
> if (len == 1) {
> --
> 1.6.0.4
>
--
Intel Open Source Technology Centre
http://oss.intel.com/
next prev parent reply other threads:[~2009-10-19 16:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-14 12:15 Aaro Koskinen
2009-10-14 12:15 ` [PATCH 2/2] mfd: twl4030-power: fix undefined resconfig value checks Aaro Koskinen
2009-10-19 16:37 ` Samuel Ortiz [this message]
2009-10-20 10:21 ` [PATCH 1/2] mfd: twl4030-power: do not allow negative or zero length script Aaro Koskinen
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=20091019163715.GG3885@sortiz.org \
--to=sameo@linux.intel.com \
--cc=aaro.koskinen@nokia.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
Powered by JetHome