From: "Eugeny S. Mints" <eugeny.mints@gmail.com>
To: Greg KH <greg@kroah.com>
Cc: pm list <linux-pm@lists.osdl.org>
Subject: Re: [PATCH] PowerOP, PowerOP Core, 1/3
Date: Sun, 03 Sep 2006 03:06:01 +0400 [thread overview]
Message-ID: <44FA0E59.5070303@gmail.com> (raw)
In-Reply-To: <20060825055643.GA24226@kroah.com>
Greg,
Greg KH wrote:
> On Thu, Aug 24, 2006 at 05:10:47AM +0400, Eugeny S. Mints wrote:
[snip]
>> +struct powerop_point {
>> + struct kobject kobj; /* hook to reference an operating point in
>> + * some arch independent way
>> + */
>
> What do you do with this kobject? It looks as if you only use the name
> portion of it, which seems like a big waste of memory for a whole
> kobject.
>
> It's also the first time I've seen a struct kobject abused this way :)
>
it is a shim for sysfs interface which is now implemented in the next take of
the patchset.
>> +static void *
>> +create_point(const char *pwr_params, va_list args)
>
> Return types on the same line please.
I ran lindent script and now return types locate in the same line. Personally
I'd prefer to have it as I put it since such type of coding allows to search a
function _implementation_ much simpler by "grep ^function_name" and to
distinguish implementation from function declaration/forward declaration/calls
and similar function names. Isn't it a purpose of coding style among others?
[snip]
>> +struct powerop_driver {
>> + char *name;
>> + void *(*create_point)(const char *pwr_params, va_list args);
>> + int (*set_point)(void *md_opt);
>> + int (*get_point)(void *md_opt, const char *pwr_params, va_list args);
>> +};
>
> Module owner perhaps too? You need to handle these drivers in modules
> properly with the correct usage counting.
Current design assumes only one powerop driver in the system and powerop core
checks pointers to the routines against NULL value before every call. PowerOP
core does not share any data with powerop driver so I don't see the reason to lock
powerop driver in this case.
Eugeny
>> +
>> +int powerop_driver_register(struct powerop_driver *p);
>> +void powerop_driver_unregister(struct powerop_driver *p);
>> +
>> +/* Main PowerOP Core interface */
>> +
>> +/*
>> + * powerop_register_point - add new operating point with a given name to
>> + * operating points list. A caller passes power parameters for new operating
>> + * points as pairs of name/value and passes only those parameter names the
>> + * caller is interested in. PowerOP Core calls powerop driver to initialize
>> + * arch dependent part of new operating point and links new named operating
>> + * point to the list maintained by PowerOP Core
>> + *
>> + *
>> + * INPUT
>> + * id - operating point name
>> + * pwr_params - set of (power parameter name, value) pairs
>> + *
>> + * OUTPUT
>> + * none
>> + *
>> + * RETURN
>> + * zero on success, error code otherwise
>> + *
>> + */
>> +int powerop_register_point(const char *id, const char *pwr_params, ...);
>
> Again with the wierd documentation style. Also, this does not belong in
> a .h file, kerneldoc can be generated from the .c files. Please do it
> that way instead of duplicating it twice.
>
> thanks,
>
> greg k-h
>
next prev parent reply other threads:[~2006-09-02 23:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-24 1:10 [PATCH] PowerOP, PowerOP Core, 1/3 Eugeny S. Mints
2006-08-25 5:56 ` Greg KH
2006-09-02 23:06 ` Eugeny S. Mints [this message]
2006-09-03 1:41 ` Greg KH
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=44FA0E59.5070303@gmail.com \
--to=eugeny.mints@gmail.com \
--cc=greg@kroah.com \
--cc=linux-pm@lists.osdl.org \
/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