From: Guenter Roeck <guenter.roeck@ericsson.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH] pmbus: Use long variables for register to
Date: Tue, 12 Jul 2011 16:25:17 +0000 [thread overview]
Message-ID: <20110712162517.GA25347@ericsson.com> (raw)
In-Reply-To: <1310411064-16337-1-git-send-email-guenter.roeck@ericsson.com>
On Tue, Jul 12, 2011 at 12:03:25PM -0400, Jean Delvare wrote:
> On Tue, 12 Jul 2011 06:40:57 -0700, Guenter Roeck wrote:
> > On Tue, Jul 12, 2011 at 03:00:16AM -0400, Jean Delvare wrote:
> > > Hi Guenter,
> > >
> > > On Mon, 11 Jul 2011 12:04:24 -0700, Guenter Roeck wrote:
> > > > Using integer variable types for register to data conversions can cause
> > > > overflows especially for power calculations, which are in microwatt.
> > > > Use long variables instead.
> > >
> > > I have no objection, using longs for calculations certainly makes
> > > sense, however does it really help in practice? I thought that
> > > sizeof(int) = sizeof(long) for all architectures on Linux?
> > >
> > No ... for x86_64 long is 64 bit and int is 32 bit.
>
> D'oh, you're right. Will I ever remember this...
>
> > I'll may have
> > to switch to "long long" at some point, though, or maybe s64.
> > Still hesitating to do that.
>
> I'd think twice about it (and how to do it exactly)... I think long
> long is relatively expensive on 32-bit x86?
>
That is my concern ... I think I'll wait with that change until someone
actually needs it.
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
prev parent reply other threads:[~2011-07-12 16:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-11 19:04 [lm-sensors] [PATCH] pmbus: Use long variables for register to data Guenter Roeck
2011-07-12 7:00 ` [lm-sensors] [PATCH] pmbus: Use long variables for register to Jean Delvare
2011-07-12 13:40 ` Guenter Roeck
2011-07-12 16:03 ` Jean Delvare
2011-07-12 16:25 ` Guenter Roeck [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=20110712162517.GA25347@ericsson.com \
--to=guenter.roeck@ericsson.com \
--cc=lm-sensors@vger.kernel.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 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.