[<prev] [next>] [day] [month] [year] [list]
Message-Id: <200610042133.k94LXkDq016761@olwen.urbana.css.mot.com>
Date: Wed, 4 Oct 2006 16:33:46 -0500 (CDT)
From: "Scott E. Preece" <preece@...orola.com>
To: pavel@....cz
CC: shd@...alwe.fi, 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
| From: Pavel Machek<pavel@....cz>
|
| Hi!
|
| > | > > > +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.
| > ---
| >
| > True, but a good compiler should remove the dead initialization...
|
| True, but efficient code is only one of constraints. Code should be
| easy to read, too.
| Pavel
| --
| (english) http://www.livejournal.com/~pavelmachek
| (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[Ironically, I was going to say "I think this dead horse has been
sufficiently beaten, but then I saw the picture reference in Pavel's
signature and decided that would be rude!]
I agree - the initialization is unneeded. However, it's also mostly
harmless...
scott
--
scott preece
motorola mobile devices, il67, 1800 s. oak st., champaign, il 61820
e-mail: preece@...orola.com fax: +1-217-384-8550
phone: +1-217-384-8589 cell: +1-217-433-6114 pager: 2174336114@...xt.com
-
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