From: Andreas Herrmann <herrmann.der.user@googlemail.com>
To: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Jean Delvare <khali@linux-fr.org>,
Thomas Renninger <trenn@suse.de>,
"lm-sensors@lm-sensors.org" <lm-sensors@lm-sensors.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [lm-sensors] [PATCH v2] hwmon: Add driver for AMD family 15h
Date: Wed, 06 Apr 2011 16:20:16 +0000 [thread overview]
Message-ID: <20110406162016.GF2177@alberich.amd.com> (raw)
In-Reply-To: <20110406161445.GB25724@ericsson.com>
On Wed, Apr 06, 2011 at 09:14:45AM -0700, Guenter Roeck wrote:
> On Wed, Apr 06, 2011 at 11:35:43AM -0400, Jean Delvare wrote:
> > On Wed, 6 Apr 2011 17:19:01 +0200, Andreas Herrmann wrote:
> > > On Wed, Apr 06, 2011 at 04:14:01PM +0200, Jean Delvare wrote:
> > > > On Tue, 5 Apr 2011 16:45:36 +0200, Andreas Herrmann wrote:
> > > > > +static ssize_t show_power(struct device *dev,
> > > > > + struct device_attribute *attr, char *buf)
> > > > > +{
> > > > > + u32 val, btdp, tdpl, tdp2w, arange;
> > > > > + s32 acap;
> > > > > + u64 ctdp;
> > > >
> > > > These variable names aren't easy to understand.
> > >
> > > Just random names which eventually map to the spec:
> > >
> > > btdp - base_tdp
> > > tdpl - tdp_limit
> > > tdp2w - tdp_to_watt
> > > acap - average_accumulator_capture (or even worse how about "processor_tdp_running_average_accumulator":(
> > > arange - average_range
> >
> > avg_cap and avg_range would do, respectively, for the last two.
> >
> > > I don't think that changing the names make it much easier to
> > > reconstruct the calculation but if you insist in changing it I'll
> > > adapt it.
> >
> > I do prefer the "extended" names, really. Sure, this doesn't change the
> > calculations, but it helps the reader understand what's going on. Which
> > will be useful if one ever has to fix a bug in the code or extend it
> > for a different CPU family.
> >
> > But maybe this is just me. Guenter, do you have an opinion?
> >
> I agree. base_tdp is definitely much better than btdp. Same for the others.
>
> Thanks,
> Guenter
Ok.
Will update the patch soon.
Andreas
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
WARNING: multiple messages have this Message-ID (diff)
From: Andreas Herrmann <herrmann.der.user@googlemail.com>
To: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Jean Delvare <khali@linux-fr.org>,
Thomas Renninger <trenn@suse.de>,
"lm-sensors@lm-sensors.org" <lm-sensors@lm-sensors.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] hwmon: Add driver for AMD family 15h processor power information
Date: Wed, 6 Apr 2011 18:20:16 +0200 [thread overview]
Message-ID: <20110406162016.GF2177@alberich.amd.com> (raw)
In-Reply-To: <20110406161445.GB25724@ericsson.com>
On Wed, Apr 06, 2011 at 09:14:45AM -0700, Guenter Roeck wrote:
> On Wed, Apr 06, 2011 at 11:35:43AM -0400, Jean Delvare wrote:
> > On Wed, 6 Apr 2011 17:19:01 +0200, Andreas Herrmann wrote:
> > > On Wed, Apr 06, 2011 at 04:14:01PM +0200, Jean Delvare wrote:
> > > > On Tue, 5 Apr 2011 16:45:36 +0200, Andreas Herrmann wrote:
> > > > > +static ssize_t show_power(struct device *dev,
> > > > > + struct device_attribute *attr, char *buf)
> > > > > +{
> > > > > + u32 val, btdp, tdpl, tdp2w, arange;
> > > > > + s32 acap;
> > > > > + u64 ctdp;
> > > >
> > > > These variable names aren't easy to understand.
> > >
> > > Just random names which eventually map to the spec:
> > >
> > > btdp - base_tdp
> > > tdpl - tdp_limit
> > > tdp2w - tdp_to_watt
> > > acap - average_accumulator_capture (or even worse how about "processor_tdp_running_average_accumulator":(
> > > arange - average_range
> >
> > avg_cap and avg_range would do, respectively, for the last two.
> >
> > > I don't think that changing the names make it much easier to
> > > reconstruct the calculation but if you insist in changing it I'll
> > > adapt it.
> >
> > I do prefer the "extended" names, really. Sure, this doesn't change the
> > calculations, but it helps the reader understand what's going on. Which
> > will be useful if one ever has to fix a bug in the code or extend it
> > for a different CPU family.
> >
> > But maybe this is just me. Guenter, do you have an opinion?
> >
> I agree. base_tdp is definitely much better than btdp. Same for the others.
>
> Thanks,
> Guenter
Ok.
Will update the patch soon.
Andreas
next prev parent reply other threads:[~2011-04-06 16:20 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-04 16:07 [lm-sensors] [PATCH] hwmon: Add driver for AMD family 15h processor Andreas Herrmann
2011-04-05 14:45 ` [lm-sensors] [PATCH v2] hwmon: Add driver for AMD family 15h Andreas Herrmann
2011-04-05 14:45 ` [PATCH v2] hwmon: Add driver for AMD family 15h processor power information Andreas Herrmann
2011-04-05 20:12 ` [lm-sensors] [PATCH v2] hwmon: Add driver for AMD family 15h Guenter Roeck
2011-04-05 20:12 ` [PATCH v2] hwmon: Add driver for AMD family 15h processor power information Guenter Roeck
2011-04-06 7:14 ` [lm-sensors] [PATCH v2] hwmon: Add driver for AMD family 15h Clemens Ladisch
2011-04-06 7:14 ` [PATCH v2] hwmon: Add driver for AMD family 15h processor power information Clemens Ladisch
2011-04-06 9:38 ` [lm-sensors] [PATCH v2] hwmon: Add driver for AMD family 15h Andreas Herrmann
2011-04-06 9:38 ` [PATCH v2] hwmon: Add driver for AMD family 15h processor power information Andreas Herrmann
2011-04-06 9:31 ` [lm-sensors] [PATCH v2] hwmon: Add driver for AMD family 15h Andreas Herrmann
2011-04-06 9:31 ` [PATCH v2] hwmon: Add driver for AMD family 15h processor power information Andreas Herrmann
2011-04-06 13:54 ` [lm-sensors] [PATCH v3] hwmon: Add driver for AMD family 15h Andreas Herrmann
2011-04-06 13:54 ` [PATCH v3] hwmon: Add driver for AMD family 15h processor power information Andreas Herrmann
2011-04-06 16:50 ` [lm-sensors] [PATCH v3] hwmon: Add driver for AMD family 15h Jean Delvare
2011-04-06 16:50 ` [PATCH v3] hwmon: Add driver for AMD family 15h processor power information Jean Delvare
2011-04-07 9:13 ` [lm-sensors] [PATCH v3] hwmon: Add driver for AMD family 15h Andreas Herrmann
2011-04-07 9:13 ` [PATCH v3] hwmon: Add driver for AMD family 15h processor power information Andreas Herrmann
2011-04-08 13:54 ` [lm-sensors] [PATCH v4] hwmon: Add driver for AMD family 15h Andreas Herrmann
2011-04-08 13:54 ` [PATCH v4] hwmon: Add driver for AMD family 15h processor power information Andreas Herrmann
2011-04-13 13:06 ` [lm-sensors] [PATCH v4] hwmon: Add driver for AMD family 15h Jean Delvare
2011-04-13 13:06 ` [PATCH v4] hwmon: Add driver for AMD family 15h processor power information Jean Delvare
2011-04-14 19:16 ` [lm-sensors] [PATCH v4] hwmon: Add driver for AMD family 15h Andreas Herrmann
2011-04-14 19:16 ` [PATCH v4] hwmon: Add driver for AMD family 15h processor power information Andreas Herrmann
2011-04-14 19:20 ` [lm-sensors] [PATCH v5] hwmon: Add driver for AMD family 15h Andreas Herrmann
2011-04-14 19:20 ` [PATCH v5] hwmon: Add driver for AMD family 15h processor power information Andreas Herrmann
2011-04-15 9:31 ` [lm-sensors] [PATCH v5] hwmon: Add driver for AMD family 15h Jean Delvare
2011-04-15 9:31 ` [PATCH v5] hwmon: Add driver for AMD family 15h processor power information Jean Delvare
2011-04-08 13:57 ` [lm-sensors] [PATCH] hwmon, fam15h_power: Add maintainers entry Andreas Herrmann
2011-04-08 13:57 ` Andreas Herrmann
2011-04-13 13:08 ` [lm-sensors] " Jean Delvare
2011-04-13 13:08 ` Jean Delvare
2011-04-13 14:51 ` [lm-sensors] " Andreas Herrmann
2011-04-13 14:51 ` Andreas Herrmann
2011-04-06 14:14 ` [lm-sensors] [PATCH v2] hwmon: Add driver for AMD family 15h Jean Delvare
2011-04-06 14:14 ` [PATCH v2] hwmon: Add driver for AMD family 15h processor power information Jean Delvare
2011-04-06 15:19 ` [lm-sensors] [PATCH v2] hwmon: Add driver for AMD family 15h Andreas Herrmann
2011-04-06 15:19 ` [PATCH v2] hwmon: Add driver for AMD family 15h processor power information Andreas Herrmann
2011-04-06 15:35 ` [lm-sensors] [PATCH v2] hwmon: Add driver for AMD family 15h Jean Delvare
2011-04-06 15:35 ` [PATCH v2] hwmon: Add driver for AMD family 15h processor power information Jean Delvare
2011-04-06 16:14 ` [lm-sensors] [PATCH v2] hwmon: Add driver for AMD family 15h Guenter Roeck
2011-04-06 16:14 ` [PATCH v2] hwmon: Add driver for AMD family 15h processor power information Guenter Roeck
2011-04-06 16:20 ` Andreas Herrmann [this message]
2011-04-06 16:20 ` Andreas Herrmann
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=20110406162016.GF2177@alberich.amd.com \
--to=herrmann.der.user@googlemail.com \
--cc=guenter.roeck@ericsson.com \
--cc=khali@linux-fr.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lm-sensors@lm-sensors.org \
--cc=trenn@suse.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.