From: "Eugeny S. Mints" <eugeny.mints@gmail.com>
To: Dominik Brodowski <linux@dominikbrodowski.net>,
"Eugeny S. Mints" <eugeny.mints@gmail.com>,
pm list <linux-pm@lists.osdl.org>,
Matthew Locke <matt@nomadgs.com>,
Amit Kucheria <amit.kucheria@nokia.com>,
Igor Stoppa <igor.stoppa@nokia.com>,
kernel list <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] CPUFreq PowerOP integration, Centrino PM Core and OPs registration 2/3
Date: Mon, 09 Oct 2006 17:42:26 +0400 [thread overview]
Message-ID: <452A51C2.2010106@gmail.com> (raw)
In-Reply-To: <20061007031910.GA1494@dominikbrodowski.de>
Dominik Brodowski wrote:
> Hi,
>
> On Thu, Sep 14, 2006 at 06:50:02PM +0400, Eugeny S. Mints wrote:
>
>> +static int
>> +process_pwr_param(struct pm_core_point *opt, int op, char *param_name,
>> + int va_arg)
>> +{
>> + int cpu = 0;
>> + char buf[8];
>> +
>> + for (cpu = 0; cpu < NR_CPUS; cpu++)
>> + {
>> + sprintf(buf, "v%d", cpu);
>> +
>> + if (strcmp(param_name, buf) == 0) {
>> + if (op == PWR_PARAM_SET)
>> + opt->opt[cpu].pwpr[_I386_PM_CORE_POINT_V] =
>> + va_arg;
>> + else if (opt != NULL)
>> + *(int *)va_arg =
>> + opt->opt[cpu].pwpr[_I386_PM_CORE_POINT_V];
>> + else if ((*(int *)va_arg = get_vtg(cpu)) <= 0)
>> + return -EINVAL;
>> + return 0;
>> + }
>> +
>> + sprintf(buf, "freq%d", cpu);
>> +
>> + if (strcmp(param_name, buf) == 0) {
>> + if (op == PWR_PARAM_SET)
>> + opt->opt[cpu].pwpr[_I386_PM_CORE_POINT_FREQ] =
>> + va_arg;
>> + else if (opt != NULL)
>> + *(int *)va_arg =
>> + opt->opt[cpu].pwpr[_I386_PM_CORE_POINT_FREQ];
>> + else if ((*(int *)va_arg = get_freq(cpu)) <= 0)
>> + return -EINVAL;
>> +
>> + return 0;
>> + }
>> + }
>> +
>> + return -EINVAL;
>> +}
>
> Ouch. IIRC Pavel had some fine comments about such string parsing deep in
> arch code... Other than that I see lots of indirection, lots of code being
> added (~400 lines) for no gain in functionality for the x86 case.
THis code is no longer anyhow relevant to the latest take of PowerOP. Please
check to make sure that you are looking at the very latest PowerOP code
submitted for discussion. Latest PowerOP take gets rid of all parsing. Latest
patches do not contain x86 patch yet but omap PM core reference code is
supplied. So please use omap code for the discussion. FYI, forward porting of
x86 patches to the latest POwerOP is on the way.
Thanks,
Eugeny
>
> Thanks,
> Dominik
>
prev parent reply other threads:[~2006-10-09 13:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-14 14:50 [RFC] CPUFreq PowerOP integration, Centrino PM Core and OPs registration 2/3 Eugeny S. Mints
2006-09-18 10:46 ` [linux-pm] " Pavel Machek
2006-09-18 11:16 ` Eugeny S. Mints
2006-10-07 3:19 ` Dominik Brodowski
2006-10-09 13:42 ` Eugeny S. Mints [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=452A51C2.2010106@gmail.com \
--to=eugeny.mints@gmail.com \
--cc=amit.kucheria@nokia.com \
--cc=igor.stoppa@nokia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.osdl.org \
--cc=linux@dominikbrodowski.net \
--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