public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Harvey Harrison <harvey.harrison@gmail.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Christoph Hellwig <hch@infradead.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Boaz Harrosh <bharrosh@panasas.com>
Subject: Re: [PATCH 1/2] byteorder: add load/store_{endian} API
Date: Mon, 02 Mar 2009 16:40:45 -0800	[thread overview]
Message-ID: <1236040845.5756.33.camel@brick> (raw)
In-Reply-To: <alpine.LFD.2.00.0903021632320.3111@localhost.localdomain>

On Mon, 2009-03-02 at 16:37 -0800, Linus Torvalds wrote:
> 
> On Mon, 2 Mar 2009, Harvey Harrison wrote:
> >
> > Although gcc (4.4) grew support for __builtin_constant_p in static 
> > inlines, older gcc's don't, so we would lose that with essentially all 
> > current compilers.
> 
> We've used __builtin_constant_p in inline functions for a long time.
> 
> Look at kmalloc() in <linux/slab_dev.h>.
> 
> I do agree that it's a "new" feature, but I don't think it's _that_ new. I 
> think it goes back to something like 3.2 rather than 4.4.
> 
> Although I also would not be surprised if this is one of those "gcc 
> version of the day" things, where some versions do it, others don't.
> 
> So it's quite possible that it depends a bit on just how many dead cats 
> you have offered, and whether you ran widdershins or turnwise around the 
> computer when you turned it on.
> 

OK, static inline it is then. Would you be opposed to an API like:

get_le16
put_le16

to match with 
get_unaligned_le16
put_unaligned_le16

And make the existing unaligned helpers typesafe?

Harvey


  reply	other threads:[~2009-03-03  0:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-03  0:06 [PATCH 1/2] byteorder: add load/store_{endian} API Harvey Harrison
2009-03-03  0:15 ` Linus Torvalds
2009-03-03  0:25   ` Harvey Harrison
2009-03-03  0:37     ` Linus Torvalds
2009-03-03  0:40       ` Harvey Harrison [this message]
2009-03-03  1:51         ` Linus Torvalds
2009-03-03  2:09           ` Harvey Harrison

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=1236040845.5756.33.camel@brick \
    --to=harvey.harrison@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bharrosh@panasas.com \
    --cc=geert@linux-m68k.org \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox