From: Pavel Machek <pavel@ucw.cz>
To: "Scott E. Preece" <preece@motorola.com>
Cc: shd@zakalwe.fi, linux-pm@lists.osdl.org,
linux-kernel@vger.kernel.org, ext-Tuukka.Tikkanen@nokia.com
Subject: Re: [linux-pm] [RFC] OMAP1 PM Core, PM Core Implementation 2/2
Date: Wed, 4 Oct 2006 23:24:26 +0200 [thread overview]
Message-ID: <20061004212426.GC8437@elf.ucw.cz> (raw)
In-Reply-To: <200610021858.k92IwXJg011184@olwen.urbana.css.mot.com>
Hi!
> | 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.
>
> Many of us work in environments where initialization is in the coding
> standard.
Well, l-k is not _this_ kind of environment.
> | > +static int cpu_vltg_show(void *md_opt, int *value)
> | > +{
> | > + int rc = 0;
> | > + if (md_opt == NULL) {
> | > + if ((*value = get_vtg("v1")) <= 0)
> | > + return -EIO;
> | > + }
> | > + else {
> | > + struct pm_core_point *opt = (struct pm_core_point *)md_opt;
> | > + *value = opt->cpu_vltg;
> | > + }
> | > +
> | > + return rc;
> | > +}
> |
> | int rc is unnecessary because the function always returns 0. This
> | happens in many places.
> ---
>
> Wonder if he wrote it for a coding standard that requires single return
> (so that the "return -EIO" would have been "rc=-EIO") and converted
> it...
We sometimes do that in l-k, too. But having rc=-EIO; return rc; with
single return is little extreme. Just fix it, it is easier than
debating codingstyle.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
next prev parent reply other threads:[~2006-10-04 21:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-02 18:58 [linux-pm] [RFC] OMAP1 PM Core, PM Core Implementation 2/2 Scott E. Preece
2006-10-02 20:44 ` Heikki Orsila
2006-10-04 21:24 ` Pavel Machek [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-10-02 21:53 Scott E. Preece
2006-10-02 19:19 Scott E. Preece
2006-09-29 22:24 Eugeny S. Mints
2006-10-01 15:22 ` Heikki Orsila
2006-10-01 17:10 ` [linux-pm] " Pavel Machek
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=20061004212426.GC8437@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=ext-Tuukka.Tikkanen@nokia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.osdl.org \
--cc=preece@motorola.com \
--cc=shd@zakalwe.fi \
/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