All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Al Viro <viro@ftp.linux.org.uk>
Cc: Linus Torvalds <torvalds@osdl.org>,
	linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
	gcc@gcc.gnu.org
Subject: Re: [RFC] timers, pointers to functions and type safety
Date: Sat, 2 Dec 2006 11:47:38 +0100	[thread overview]
Message-ID: <200612021147.40505.arnd@arndb.de> (raw)
In-Reply-To: <20061201172149.GC3078@ftp.linux.org.uk>

On Friday 01 December 2006 18:21, Al Viro wrote:
>  There is a tempting
> possibility to do that gradually, with all intermediates still in working
> state, provided that on all platforms currently supported by the kernel
> unsigned long and void * are indeed passed the same way (again, only for
> current kernel targets and existing gcc versions).  Namely, we could
>         * introduce SETUP_TIMER variant with cast to void (*)(unsigned long)
>         * switch to its use, converting callback instances to take pointers
> at the same time.  That would be done in reasonably sized groups.
>         * once it's over, flip ->function to void (*)(void *), ->data to
> void * and update SETUP_TIMER accordingly; deal with remaining few instances
> of ->function.

Another alternative might be to define an intermediate version of
timer_list that avoids adding new macros, like

struct timer_list {
	struct list_head entry;
­	unsigned long expires;

­	void (*function)(union { unsigned long l; void *p; }
				 __attribute__((transparent_union)));
­	union {
		unsigned long data __deprecated;
		void *obj;
	};

­	struct tvec_t_base_s *base;
};

Unfortunately, this relies more on gcc specific behavior than we
may want, and it makes it possible to abuse in new ways, like defining
a function to take an unsigned long argument, but passing the data
as void *obj.

	Arnd <><

  parent reply	other threads:[~2006-12-02 10:47 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-01 17:21 [RFC] timers, pointers to functions and type safety Al Viro
2006-12-02  6:29 ` Daniel Berlin
2006-12-02 12:36   ` Al Viro
2006-12-02  9:23 ` Kyle Moffett
2006-12-02 12:42   ` Al Viro
2006-12-02 20:53     ` Kyle Moffett
2006-12-02 10:47 ` Arnd Bergmann [this message]
2006-12-02 12:59 ` Thomas Gleixner
2006-12-02 14:05   ` Al Viro
2006-12-02 14:45     ` Thomas Gleixner
2006-12-02 16:02       ` Matthew Wilcox
2006-12-02 18:06         ` Thomas Gleixner
2006-12-02 18:19           ` Al Viro
2006-12-02 18:27             ` Thomas Gleixner
2006-12-02 18:40               ` Al Viro
2006-12-02 18:48                 ` Al Viro
2006-12-02 21:43                 ` Roman Zippel
2006-12-02 21:59                   ` Al Viro
2006-12-02 22:13                     ` Roman Zippel
2006-12-02 22:40                       ` Al Viro
2006-12-02 23:06                         ` Roman Zippel
2006-12-03 10:21                           ` Pavel Machek
2006-12-03 11:27                             ` Russell King
2006-12-03 15:21                               ` Roman Zippel
2006-12-03 21:01                                 ` Pavel Machek
2006-12-03 22:52                                   ` Roman Zippel
2006-12-03 23:15                                     ` Pavel Machek
2006-12-04 11:14                               ` David Howells
2006-12-04 12:16                                 ` Russell King
2006-12-04 13:03                                   ` David Howells
2006-12-04 13:29                                     ` Russell King
2006-12-04 14:17                                       ` David Howells
2006-12-04 14:22                                         ` Russell King
2006-12-04 11:48             ` Ingo Molnar
2006-12-04 12:22               ` David Howells
2006-12-06  0:24                 ` Al Viro
2006-12-06 10:20                   ` David Howells
2006-12-12  9:59                   ` Ingo Molnar
2006-12-02 21:32         ` Roman Zippel

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=200612021147.40505.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=gcc@gcc.gnu.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    --cc=viro@ftp.linux.org.uk \
    /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.