All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denys Vlasenko <vda.linux@googlemail.com>
To: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Mikael Starvik <mikael.starvik@axis.com>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Subject: Re: [PATCH] CRISv10 fasttimer: Scrap INLINE and name timeval_cmp better
Date: Wed, 14 Nov 2007 18:29:17 -0800	[thread overview]
Message-ID: <200711141829.17361.vda.linux@googlemail.com> (raw)
In-Reply-To: <20071114170850.GR6347@axis.com>

On Wednesday 14 November 2007 09:08, Jesper Nilsson wrote:
> Scrap the local __INLINE__ macro, and rename timeval_cmp to fasttime_cmp.
>
> Inline macro was completely unnecessary since the macro was defined
> locally to be inline.
> timeval_cmp was inaccurately named since it does comparison on
> struct fasttimer_t and not on struct timeval.
>
> Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
> ---
>  fasttimer.c |   16 +++++++---------
>  1 file changed, 7 insertions(+), 9 deletions(-)
>
> diff --git a/arch/cris/arch-v10/kernel/fasttimer.c
> b/arch/cris/arch-v10/kernel/fasttimer.c index 645d705..c1a3a21 100644
> --- a/arch/cris/arch-v10/kernel/fasttimer.c
> +++ b/arch/cris/arch-v10/kernel/fasttimer.c
> @@ -46,8 +46,6 @@ static int sanity_failed;
>  #define D2(x)
>  #define DP(x)
>
> -#define __INLINE__ inline
> -
>  static unsigned int fast_timer_running;
>  static unsigned int fast_timers_added;
>  static unsigned int fast_timers_started;
> @@ -118,13 +116,13 @@ int timer_freq_settings[NUM_TIMER_STATS];
>  int timer_delay_settings[NUM_TIMER_STATS];
>
>  /* Not true gettimeofday, only checks the jiffies (uptime) + useconds */
> -void __INLINE__ do_gettimeofday_fast(struct fasttime_t *tv)
> +inline void do_gettimeofday_fast(struct fasttime_t *tv)

Why these functions are not "static inline"?
Wthout "static", gcc will actually create non-inlined version of them!

$ cat t.c
inline int f() { return 1; }
int g() { return f(); }
$ gcc -O2 -c t.c
$ nm --size-sort t.o
0000000a T f   <=================== !!!
0000000a T g

P.S. whitespace style in fasttimer.c doesn't match rest of the kernel
(kernel uses tab, not 2-spaces indentation). Curly braces don't match too:
  if (t0->tv_sec < t1->tv_sec)
  {
    return -1;
  }
should be
      if (t0->tv_sec < t1->tv_sec) {
              return -1;
      }

--
vda

  reply	other threads:[~2007-11-15  3:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-14 17:08 [PATCH] CRISv10 fasttimer: Scrap INLINE and name timeval_cmp better Jesper Nilsson
2007-11-15  2:29 ` Denys Vlasenko [this message]
2007-11-15  8:10   ` Jesper Nilsson

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=200711141829.17361.vda.linux@googlemail.com \
    --to=vda.linux@googlemail.com \
    --cc=akpm@linux-foundation.org \
    --cc=jesper.nilsson@axis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=mikael.starvik@axis.com \
    /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.