[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ADE657CA350FB648AAC2C43247A983F001F383D6DAD4@AUSP01VMBX24.collaborationhost.net>
Date: Tue, 12 Jul 2011 12:13:08 -0500
From: H Hartley Sweeten <hartleys@...ionengravers.com>
To: Arnd Bergmann <arnd@...db.de>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>
CC: Sascha Hauer <s.hauer@...gutronix.de>,
Wolfram Sang <w.sang@...gutronix.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"thierry.nolf.barco@...il.com" <thierry.nolf.barco@...il.com>,
Huang Shijie <b32955@...escale.com>,
"linux-mtd@...ts.infradead.org" <linux-mtd@...ts.infradead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
Lothar Waßmann <LW@...o-electronics.de>
Subject: RE: [PATCH] new helper to define common struct resource constructs
On Tuesday, July 12, 2011 6:29 AM, Arnd Bergmann wrote:
> On Monday 11 July 2011, Uwe Kleine-König wrote:
>> resource definitions that just define start, end and flags = IORESOURCE_MEM
>> or IORESOURCE_IRQ (with start=end) are quite common. So introduce a shortcut
>> for them. Also make available a macro to specify named resources of both
>> types which are less common.
>>
>> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
>
> Acked-by: Arnd Bergmann <arnd@...db.de>
>
> What do others think, is this worthwhile?
Assuming I found the correct patch in the archives, +1 from me. Not sure what
the correct sign-off should be, possibly:
Reviewed-by: H Hartley Sweeten <hsweeten@...ionengravers.com>
> Should we also define macros for IORESOURCE_IO and IORESOURCE_DMA?
As a gross check, on linux-next I see:
$ git grep IORESOURCE_MEM | wc -l
3989
$ git grep IORESOURCE_IRQ | wc -l
2309
$ git grep IORESOURCE_IO | wc -l
687
$ git grep IORESOURCE_DMA | wc -l
521
The *_MEM and *_IRQ macros are going to have the largest impact on reducing
the lines of code. But, for completeness it might be nice to have the *_IO
and *_DMA ones also.
If this patch is accepted there are a couple private macros in various places
that should probably be replaced or updated.
For instance in mach-nomadik/board-nhk8815.c and mach-nomadik/cpu-8815.c there
are these:
#define __MEM_4K_RESOURCE(x) \
.res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM}
And plat-omap/i2c.c has this:
#define I2C_RESOURCE_BUILDER(base, irq) \
{ \
.start = (base), \
.end = (base) + OMAP_I2C_SIZE, \
.flags = IORESOURCE_MEM, \
}, \
{ \
.start = (irq), \
.flags = IORESOURCE_IRQ, \
},
I seem to recall seeing others but can't remember exactly where.
Regards,
Hartley--
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