All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] Add a driver for the ADT7475 thermal sensor
Date: Mon, 29 Sep 2008 20:23:56 +0000	[thread overview]
Message-ID: <20080929222356.39846d64@hyperion.delvare> (raw)
In-Reply-To: <20080926232036.GH22230@cosmic.amd.com>

Hi Jordan,

On Mon, 29 Sep 2008 14:13:50 -0600, Jordan Crouse wrote:
> On 27/09/08 16:04 +0200, Hans de Goede wrote:
> > 1) As Andrew Morten already noted as comment to some other patch, its better to
> >     make complex macros like this one:
> > +#define TEMP2REG(val) ((val) <= -128000 ? -128 : \
> > +       (val) >= 127000 ? 127 : \
> > +       (val) < 0 ? ((val) - 500) / 1000 : \
> > +       ((val) + 500) / 1000)
> > 
> >     static functions rather then macros all the ? constructions will lead to
> >     interesting code and if you make it a function the compiler will usually
> >     create significant smaller code
> 
> I have turned all the macros into function.  Am I right in saying that
> the current kernel policy is to not mark them as inline and let
> the compiler decide?

I am happy to see inline keywords in the code. Different versions of
gcc have different levels of smartness when it comes to auto-inlining.
Some versions apparently have an algorithm as simple as "inline
everything that's used only once", which doesn't work at all for our
drivers. As long as you do not force the inlining of large functions,
there's really no drawback to using the inline keyword.

-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

      parent reply	other threads:[~2008-09-29 20:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-26 23:20 [lm-sensors] Add a driver for the ADT7475 thermal sensor (resend 3) Jordan Crouse
2008-09-27 14:04 ` [lm-sensors] Add a driver for the ADT7475 thermal sensor Hans de Goede
2008-09-29  8:25 ` Jean Delvare
2008-09-29 20:13 ` Jordan Crouse
2008-09-29 20:23 ` Jean Delvare [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=20080929222356.39846d64@hyperion.delvare \
    --to=khali@linux-fr.org \
    --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.