Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261405AbUFCG6I (ORCPT ); Thu, 3 Jun 2004 02:58:08 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261396AbUFCG6I (ORCPT ); Thu, 3 Jun 2004 02:58:08 -0400 Received: from mail.fh-wedel.de ([213.39.232.194]:46799 "EHLO mail.fh-wedel.de") by vger.kernel.org with ESMTP id S261389AbUFCG4G (ORCPT ); Thu, 3 Jun 2004 02:56:06 -0400 Date: Thu, 3 Jun 2004 08:55:21 +0200 From: =?iso-8859-1?Q?J=F6rn?= Engel To: viro@parcelfarce.linux.theplanet.co.uk Cc: Davide Libenzi , Linus Torvalds , Horst von Brand , Pavel Machek , Andrew Morton , Arjan van de Ven , Ingo Molnar , Andrea Arcangeli , Rik van Riel , Linux Kernel Mailing List Subject: Re: [RFC PATCH] explicitly mark recursion count Message-ID: <20040603065521.GA20977@wohnheim.fh-wedel.de> References: <20040602131623.GA23017@wohnheim.fh-wedel.de> <20040602182019.GC30427@wohnheim.fh-wedel.de> <20040602185832.GA2874@wohnheim.fh-wedel.de> <20040602193720.GQ12308@parcelfarce.linux.theplanet.co.uk> <20040602194515.GA4477@wohnheim.fh-wedel.de> <20040602195944.GR12308@parcelfarce.linux.theplanet.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20040602195944.GR12308@parcelfarce.linux.theplanet.co.uk> User-Agent: Mutt/1.3.28i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1509 Lines: 40 On Wed, 2 June 2004 20:59:44 +0100, viro@parcelfarce.linux.theplanet.co.uk wrote: > > > > Ok. Would it be ok to use the following then? > > > > b1. Function pointer are passed as arguments to functions and > > b2. those pointer are called directly from the function, they are > > passed to. > > Again not guaranteed to be true - they can be (and often are) passed further. Hmm. If that happens, I'm out of ideas for now. Cannot do more than give a warning. > Moreover, they are also stored untyped in structures. Common pattern > is > foo.callback = f; > foo.argument = p; > iterate_over_blah(blah, &foo); > > Note that here f is the only thing that will see the value of p _and_ the > only thing that cares about type of p. iterator itself doesn't care and > can be used for different types. Those cases I should already catch. If foo is of type "struct bar", "bar.callback" will be the function name for a pseudo-function. That function is called by iterate_over_blah and calls f. Unnamed struct get a name made up from the components of the struct, like ____FAKE.Name.Chip.stat.Regi.LILP.Opti.high.lowe->ProcessIMQEntry. Doesn't look pretty, but works. J?rn -- Time? What's that? Time is only worth what you do with it. -- Theo de Raadt - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/