public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stefani Seibold <stefani@seibold.net>
To: Richard Yang <weiyang@linux.vnet.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	richard -rw- weinberger <richard.weinberger@gmail.com>,
	Jiri Kosina <jkosina@suse.cz>
Subject: Re: linux-next: build warnings after merge of the akpm tree
Date: Fri, 26 Oct 2012 07:44:51 +0200	[thread overview]
Message-ID: <1351230291.12511.7.camel@wall-e> (raw)
In-Reply-To: <20121025223656.GA3805@richard.(null)>

Am Freitag, den 26.10.2012, 06:36 +0800 schrieb Richard Yang:

> >
> >And holy cow that code is hard to read :( Why was kfifo_in()
> >implemented as a macro, anyway?  AFAICT all its args have a known type,
> >so we could have used a proper C interface, which would have fixed all
> >this nicely.
> 

Thats simple for performance reasons, the compiler remove most of the
code during the compile stage, so no runtime checks are necessary. And
it is the only way since C does not provides templates like C++.
 
> Hmm, move the definition of kfifo_in()/kfifo_out() into the kfifo.c?
> 

Don't do it. this will result in a performance degradation. Look at the
disassembled code by each change in code and compare it with the
previous one. I don't believe that you can produce better code.


  parent reply	other threads:[~2012-10-26  5:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-25  3:28 linux-next: build warnings after merge of the akpm tree Stephen Rothwell
2012-10-25  3:30 ` Stephen Rothwell
     [not found]   ` <20121025141232.GB4730@richard.(null)>
2012-10-25 14:16     ` Stephen Rothwell
     [not found]   ` <508948de.01dc440a.58ed.ffffff17SMTPIN_ADDED@mx.google.com>
2012-10-25 22:23     ` Andrew Morton
2012-10-25 23:50       ` Stephen Rothwell
     [not found]       ` <20121025223656.GA3805@richard.(null)>
2012-10-26  5:44         ` Stefani Seibold [this message]
     [not found] ` <20121025130952.GA4730@richard.(null)>
2012-10-25 14:20   ` Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2012-11-29  6:19 Stephen Rothwell
2012-11-29  7:24 ` Lars Ellenberg
2016-11-24  5:20 Stephen Rothwell

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=1351230291.12511.7.camel@wall-e \
    --to=stefani@seibold.net \
    --cc=akpm@linux-foundation.org \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=richard.weinberger@gmail.com \
    --cc=sfr@canb.auug.org.au \
    --cc=weiyang@linux.vnet.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox