From: Aaro Koskinen <aaro.koskinen@nokia.com>
To: ext Samuel Ortiz <sameo@linux.intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] mfd: twl4030-power: do not allow negative or zero length script
Date: Tue, 20 Oct 2009 13:21:24 +0300 [thread overview]
Message-ID: <4ADD8F24.30401@nokia.com> (raw)
In-Reply-To: <20091019163715.GG3885@sortiz.org>
Hello,
Samuel Ortiz wrote:
> 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...
It seems I was accidentally using an older version of CodeSourcery
toolchain (2007q3-51). I tried now with the recent one and warnings
do not appear. I'm still not sure if they were totally bogus or not...
>> drivers/mfd/twl4030-power.c: In function 'twl4030_power_init':
> twl4030_power_init ? Isnt it twl4030_write_script ?
You are right, it seems the compiler does some inlining and
reports a wrong function name.
A.
> 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
>>
>
prev parent reply other threads:[~2009-10-20 10:21 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 ` [PATCH 1/2] mfd: twl4030-power: do not allow negative or zero length script Samuel Ortiz
2009-10-20 10:21 ` Aaro Koskinen [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=4ADD8F24.30401@nokia.com \
--to=aaro.koskinen@nokia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sameo@linux.intel.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
Powered by JetHome