From: Heikki Orsila <shd@zakalwe.fi>
To: "Eugeny S. Mints" <eugeny.mints@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-pm@lists.osdl.org,
matt@nomadgs.com, amit.kucheria@nokia.com, igor.stoppa@nokia.com,
ext-Tuukka.Tikkanen@nokia.com
Subject: Re: [RFC] OMAP1 PM Core, PM Core Implementation 2/2
Date: Sun, 1 Oct 2006 18:22:28 +0300 [thread overview]
Message-ID: <20061001152228.GA24539@zakalwe.fi> (raw)
In-Reply-To: <20060930022435.b2344b5f.eugeny.mints@gmail.com>
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.
> +static long
> +set_vtg(const char *vdomain, int val)
> +{
> + long ret = 0;
here too. This and 'int i = 0;' happens in many functions.
> + err = omap_pm_core_verify_opt(opt);
> + if (err != 0)
> + goto out;
> +
> + return (void *)opt;
> +out:
> + kfree(opt);
> + return NULL;
> +}
Maybe use if (err != 0) { kfree(opt); return NULL; } because goto out is
only used once?
> +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.
> + int dpll; /* in KHz */
> + int cpu; /* CPU frequency in KHz */
> + int tc; /* in KHz */
> + int per; /* in KHz */
> + int dsp; /* in KHz */
> + int dspmmu; /* in KHz */
> + int lcd; /* in KHz */
> +};
The SI multiplier is 'k', not 'K'.
- Heikki
next prev parent reply other threads:[~2006-10-01 15:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-29 22:24 [RFC] OMAP1 PM Core, PM Core Implementation 2/2 Eugeny S. Mints
2006-10-01 15:22 ` Heikki Orsila [this message]
2006-10-01 17:10 ` [linux-pm] " Pavel Machek
2006-10-01 17:32 ` Heikki Orsila
2006-10-01 17:37 ` Pavel Machek
-- strict thread matches above, loose matches on Subject: below --
2006-10-02 19:19 [linux-pm] " Scott E. Preece
2006-10-04 21:25 ` Pavel Machek
2006-10-04 21:33 Scott E. Preece
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=20061001152228.GA24539@zakalwe.fi \
--to=shd@zakalwe.fi \
--cc=amit.kucheria@nokia.com \
--cc=eugeny.mints@gmail.com \
--cc=ext-Tuukka.Tikkanen@nokia.com \
--cc=igor.stoppa@nokia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.osdl.org \
--cc=matt@nomadgs.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