[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090203025937.2cfca36a.akpm@linux-foundation.org>
Date: Tue, 3 Feb 2009 02:59:37 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Jean Delvare <khali@...ux-fr.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Hans de Goede <hdegoede@...hat.com>,
Matthew Garrett <mjg@...hat.com>,
Roland Dreier <rolandd@...co.com>
Subject: Re: [PATCH] dmi: Let dmi_walk() users pass private data
On Tue, 3 Feb 2009 10:52:22 +0100 Jean Delvare <khali@...ux-fr.org> wrote:
> On Tue, 3 Feb 2009 00:42:10 -0800, Andrew Morton wrote:
> > On Sun, 1 Feb 2009 22:46:59 +0100 Jean Delvare <khali@...ux-fr.org> wrote:
> >
> > > At the moment, dmi_walk() lacks flexibility, users can't pass data to
> > > the callback function. Add a pointer for private data to make this
> > > function more flexible.
> >
> > That new argument is sometimes called "priv", other times called "data"
> > and other times called "dummy". It would be good to come up with a nice
> > meaningful name and stick to it.
> >
> > (The "dummy" thing probably makes sense, as long as people think to
> > rename it to the chosen identifier if they later actually use it for
> > something).
>
> Indeed, naming things "dummy" when they are required for prototype
> reasons but otherwise unused is a rather common strategy.
>
> As for "priv" vs. "data", I wanted to use "data" everywhere, but it
> happens that we already have a local variable named "data" in function
> dmi_table(). I didn't want to change it, to not make the patch bigger
> and harder to read. If you think this is such a big issue, I could
> either rename that local variable nevertheless, or use "priv"
> everywhere (with the open question whether we should also use "priv"
> instead of "data" in <linux/dmi.h> or not.) Let me know what you prefer.
>
Could use `private_data' everywhere. There's a lot of precedent:
y:/usr/src/25> grep private_data Tags | wc -l
228
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists