From: Russell King <rmk@arm.linux.org.uk>
To: Xavier Bestel <xavier.bestel@free.fr>
Cc: Dominik Brodowski <linux@brodo.de>,
torvalds@transmeta.com, hpa@transmeta.com,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
cpufreq@www.linux.org.uk
Subject: Re: [PATCH][2.5.35] CPUfreq documentation (4/5)
Date: Tue, 17 Sep 2002 12:00:33 +0100 [thread overview]
Message-ID: <20020917120033.A28438@flint.arm.linux.org.uk> (raw)
In-Reply-To: <1032257979.3070.29.camel@nomade>; from xavier.bestel@free.fr on Tue, Sep 17, 2002 at 12:19:37PM +0200
On Tue, Sep 17, 2002 at 12:19:37PM +0200, Xavier Bestel wrote:
> Le mar 17/09/2002 à 11:35, Dominik Brodowski a écrit :
>
> > +The third argument, a void *pointer, points to a struct cpufreq_freqs
> > +consisting of five values: cpu, min, max, policy and max_cpu_freq. Min
> > +and max are the lower and upper frequencies (in kHz) of the new
> > +policy, policy the new policy, cpu the number of the affected CPU or
> > +CPUFREQ_ALL_CPUS for all CPUs; and max_cpu_freq the maximum supported
> > +CPU frequency. This value is given for informational purposes only.
>
> - Why choosing a void* ? that doesn't validate type ..
That's the type specified by the notifier code. You have two choices:
int notifier_foo(struct notifier_block *nb, int foo, void *bar)
{
struct my_bar *my = bar;
}
struct notifier_block nb = {
.notifier_call = notifier_foo,
};
OR:
int notifier_foo(struct notifier_block *nb, int foo, struct my_bar *my)
{
}
struct notifier_block nb = {
.notifier_call = (int (*)(struct notifier_block *, int, void *))notifier_foo,
};
So, you end up with a cast in one place or the other. I know which one
I prefer.
> - The struct cpufreq_freqs actually consists of only three values (cpu,
> old, new). The five values you cite here are in the struct
> cpufreq_policy.
Yep, it's a little unclear.
The policy notifiers are called with struct cpufreq_policy, which have
five values. The transition notifiers are called with struct
cpufreq_freqs, which has three values.
--
Russell King (rmk@arm.linux.org.uk) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html
next prev parent reply other threads:[~2002-09-17 10:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-17 9:35 [PATCH][2.5.35] CPUfreq documentation (4/5) Dominik Brodowski
2002-09-17 10:03 ` Xavier Bestel
2002-09-17 10:19 ` Xavier Bestel
2002-09-17 11:00 ` Russell King [this message]
2002-09-17 14:39 ` [PATCH] " Dominik Brodowski
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=20020917120033.A28438@flint.arm.linux.org.uk \
--to=rmk@arm.linux.org.uk \
--cc=cpufreq@www.linux.org.uk \
--cc=hpa@transmeta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@brodo.de \
--cc=torvalds@transmeta.com \
--cc=xavier.bestel@free.fr \
/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