mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nikita Danilov <Nikita@Namesys.COM>
To: William Lee Irwin III <wli@holomorphy.com>
Cc: Gianni Tedesco <gianni@scaramanga.co.uk>,
	Linux Kernel Mailing List <Linux-Kernel@Vger.Kernel.ORG>,
	Linus Torvalds <Torvalds@Transmeta.COM>,
	Andrew Morton <AKPM@Digeo.COM>
Subject: Re: const from include/asm-i386/byteorder.h
Date: Mon, 2 Jun 2003 16:36:18 +0400	[thread overview]
Message-ID: <16091.17602.257293.364468@laputa.namesys.com> (raw)
In-Reply-To: <20030602121457.GO8978@holomorphy.com>

William Lee Irwin III writes:
 > On Mon, Jun 02, 2003 at 03:51:39PM +0400, Nikita Danilov wrote:
 > > Gcc info page:
 > > `const'
 > >      Many functions do not examine any values except their arguments,
 > >      and have no effects except the return value.  Basically this is
 > >      just slightly more strict class than the `pure' attribute above,
 > >      since function is not allowed to read global memory.
 > > So, it seems byte swapping functions should be __attribute__((const))
 > > Here is a patch:
 > 
 > I'm very skeptical, in particular, about these hunks:
 > 
 > 
 > On Mon, Jun 02, 2003 at 03:51:39PM +0400, Nikita Danilov wrote:
 > >  #include <linux/thread_info.h>
 > > -static inline struct task_struct *get_current(void) __attribute__ (( __const__ ));
 > > +static inline struct task_struct *get_current(void) __attribute_const;
 > >  static inline struct task_struct *get_current(void)
 > >  {
 > > ===== include/asm-arm/thread_info.h 1.6 vs edited =====
 > > --- 1.6/include/asm-arm/thread_info.h	Sat Dec 28 19:26:45 2002
 > > +++ edited/include/asm-arm/thread_info.h	Mon Jun  2 14:44:24 2003
 > > @@ -74,7 +74,7 @@
 > >  /*
 > >   * how to get the thread information struct from C
 > >   */
 > > -static inline struct thread_info *current_thread_info(void) __attribute__ (( __const__ ));
 > > +static inline struct thread_info *current_thread_info(void) __attribute_const;
 > >  
 > >  static inline struct thread_info *current_thread_info(void)
 > >  {
 > 
 > Someone needs to doublecheck whether this actually works. Last I heard,

I don't quite understand. __attribute_const is defined as

#define __attribute_const __attribute__ ((__const__))

so, after preprocessing prototypes of get_current() and
current_thread_info() will be the same as before patch, modulo spacing.

 > it did not, but that could have changed since. It vaguely appears some
 > assumption about it working was made recently since __const__ was there.
 > 

I am currently running ./fsstress -p 111 on patched kernel on 2*XEON
2.20GHz with hyper threading.

 > 
 > -- wli

Nikita.

  reply	other threads:[~2003-06-02 12:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-31 14:10 Nikita Danilov
2003-05-31 18:49 ` Gianni Tedesco
2003-05-31 18:57   ` William Lee Irwin III
2003-06-02 11:51     ` Nikita Danilov
2003-06-02 12:14       ` William Lee Irwin III
2003-06-02 12:36         ` Nikita Danilov [this message]
2003-06-02 12:40           ` William Lee Irwin III
2003-06-02 12:59             ` Nikita Danilov
2003-06-02 13:08               ` William Lee Irwin III
2003-06-02 13:21       ` Gianni Tedesco
2003-06-02 13:37       ` Adrian Bunk
2003-06-02 14:46         ` Nikita Danilov

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=16091.17602.257293.364468@laputa.namesys.com \
    --to=nikita@namesys.com \
    --cc=AKPM@Digeo.COM \
    --cc=Linux-Kernel@Vger.Kernel.ORG \
    --cc=Torvalds@Transmeta.COM \
    --cc=gianni@scaramanga.co.uk \
    --cc=wli@holomorphy.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

all inboxes | Powered by JetHome®