[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20061001173252.GB24539@zakalwe.fi>
Date: Sun, 1 Oct 2006 20:32:52 +0300
From: Heikki Orsila <shd@...alwe.fi>
To: Pavel Machek <pavel@....cz>
Cc: "Eugeny S. Mints" <eugeny.mints@...il.com>,
linux-pm@...ts.osdl.org, linux-kernel@...r.kernel.org,
ext-Tuukka.Tikkanen@...ia.com
Subject: Re: [linux-pm] [RFC] OMAP1 PM Core, PM Core Implementation 2/2
On Sun, Oct 01, 2006 at 07:10:32PM +0200, Pavel Machek wrote:
> On Sun 2006-10-01 18:22:28, Heikki Orsila wrote:
> > Some nitpicking about the patch follows..
> >
> > On Sat, Sep 30, 2006 at 02:24:35AM +0400, Eugeny S. Mints wrote:
> > > +static long
> > > +get_vtg(const char *vdomain)
> > > +{
> > > + long ret = 0;
> >
> > Unnecessary initialisation.
>
> No, sorry.
In get_vtg(), if VOLTAGE_FRAMEWORK is defined then
ret = vtg_get_voltage(v);
is the first user. If VOLTAGE_FRAMEWORK is not defined, the first user is:
ret = vtg_get_voltage(&vhandle);
Then "return ret;" follows. I cannot see a path where
pre-initialisation of ret does anything useful. If someone removed the
#else part, the compiler would bark.
>
> > > +static long
> > > +set_vtg(const char *vdomain, int val)
> > > +{
> > > + long ret = 0;
> >
> > here too.
>
> Wrong again. automatic variables are not zero initialized.
My bad, this was a mistake. If VOLTAGE_FRAMEWORK is not defined, ret
must be initialised. (the compiler would have noticed this one :-)
>> 'int i = 0;' happens in many functions.
for example, omap_pm_create_point() does this.
- Heikki
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists