All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: David Howells <dhowells@redhat.com>,
	Akinobu Mita <akinobu.mita@gmail.com>,
	akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: Mark bitrevX() functions as const
Date: Mon, 11 Dec 2006 16:12:52 +0000	[thread overview]
Message-ID: <29623.1165853572@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0612110803340.12500@woody.osdl.org>

Linus Torvalds <torvalds@osdl.org> wrote:

> > Mark the bit reversal functions as being const as they always return the
> > same output for any given input.
> 
> Well, we should mark the argument const too, no?

The argument is just an integer; I'm not sure that marking it const actually
achieves anything, except to tell the function that it can't modify it - and
since it's effectively a copy, where's the fun in that.

> Does anythign actually improve from this? Also, we should actually use 
> "__attribute_const__" instead (which works with other compilers), not the 
> gcc'ism. That "__attribute__((const))" thing is a horrible syntax anyway 
> (and has apparently slipped into <linux/log2.h> too - Damn.

Ah.  I thought that was just for supporting old versions of gcc.  I didn't
realise it was for handling strange compilers.

David

  reply	other threads:[~2006-12-11 16:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-11 12:35 Mark bitrevX() functions as const David Howells
2006-12-11 12:57 ` Jeff Garzik
2006-12-11 13:14   ` David Howells
2006-12-11 13:32     ` Jeff Garzik
2006-12-11 14:18       ` David Howells
2006-12-11 13:37   ` Andreas Schwab
2006-12-11 13:53     ` Jeff Garzik
2006-12-11 13:25 ` Akinobu Mita
2006-12-11 14:22   ` David Howells
2006-12-11 16:05 ` Linus Torvalds
2006-12-11 16:12   ` David Howells [this message]
2006-12-11 16:34     ` Linus Torvalds
2006-12-11 17:35     ` Jan Engelhardt
2006-12-11 17:51       ` Bernd Petrovitsch

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=29623.1165853572@redhat.com \
    --to=dhowells@redhat.com \
    --cc=akinobu.mita@gmail.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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.