[<prev] [next>] [day] [month] [year] [list]
Message-ID: <406152.8763.qm@web50108.mail.re2.yahoo.com>
Date: Fri, 17 Apr 2009 14:42:47 -0700 (PDT)
From: Doug Thompson <norsk5@...oo.com>
To: Harry Ciao <qingtao.cao@...driver.com>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: michael@...erman.id.au, bluesmoke-devel@...ts.sourceforge.net,
linuxppc-dev@...abs.org, linux-kernel@...r.kernel.org
Subject: Re: [v2 PATCH 2/3] EDAC: Add edac_device_alloc_index()
--- On Wed, 4/15/09, Andrew Morton <akpm@...ux-foundation.org> wrote:
> From: Andrew Morton <akpm@...ux-foundation.org>
> Subject: Re: [v2 PATCH 2/3] EDAC: Add edac_device_alloc_index()
> To: "Harry Ciao" <qingtao.cao@...driver.com>
> Cc: norsk5@...oo.com, michael@...erman.id.au, bluesmoke-devel@...ts.sourceforge.net, linuxppc-dev@...abs.org, linux-kernel@...r.kernel.org
> Date: Wednesday, April 15, 2009, 4:27 PM
> On Mon, 13 Apr 2009 14:05:15 +0800
> Harry Ciao <qingtao.cao@...driver.com>
> wrote:
>
> > Add edac_device_alloc_index(), because for MAPLE
> platform there may
> > exist several EDAC driver modules that could make use
> of
> > edac_device_ctl_info structure at the same time. The
> index allocation
> > for these structures should be taken care of by EDAC
> core.
> >
>
> From: Andrew Morton <akpm@...ux-foundation.org>
>
> keep things neat. Also avoids having global
> identifier device_index
> shadowed by local identifier device_index.
>
> Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
Acked-by: Doug Thompson <dougthompson@...ssion.com>
> Cc: Harry Ciao <qingtao.cao@...driver.com>
> Cc: Kumar Gala <galak@...e.crashing.org>
> Cc: Michael Ellerman <michael@...erman.id.au>
> Cc: Paul Mackerras <paulus@...ba.org>
> Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
> ---
>
> drivers/edac/edac_device.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff -puN
> drivers/edac/amd8111_edac.c~edac-add-edac_device_alloc_index-cleanup
> drivers/edac/amd8111_edac.c
> diff -puN
> drivers/edac/edac_core.h~edac-add-edac_device_alloc_index-cleanup
> drivers/edac/edac_core.h
> diff -puN
> drivers/edac/edac_device.c~edac-add-edac_device_alloc_index-cleanup
> drivers/edac/edac_device.c
> ---
> a/drivers/edac/edac_device.c~edac-add-edac_device_alloc_index-cleanup
> +++ a/drivers/edac/edac_device.c
> @@ -37,7 +37,6 @@
> */
> static DEFINE_MUTEX(device_ctls_mutex);
> static LIST_HEAD(edac_device_list);
> -static atomic_t device_indexes = ATOMIC_INIT(0);
>
> #ifdef CONFIG_EDAC_DEBUG
> static void edac_device_dump_device(struct
> edac_device_ctl_info *edac_dev)
> @@ -499,6 +498,8 @@ void
> edac_device_reset_delay_period(stru
> */
> int edac_device_alloc_index(void)
> {
> + static atomic_t device_indexes =
> ATOMIC_INIT(0);
> +
> return
> atomic_inc_return(&device_indexes) - 1;
> }
> EXPORT_SYMBOL_GPL(edac_device_alloc_index);
> _
>
>
--
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