]> git.baikalelectronics.ru Git - kernel.git/commit
omap_hwmod: use a null structure record to terminate omap_hwmod_addr_space arrays
authorPaul Walmsley <paul@pwsan.com>
Sun, 10 Jul 2011 01:14:05 +0000 (19:14 -0600)
committerPaul Walmsley <paul@pwsan.com>
Sun, 10 Jul 2011 01:14:05 +0000 (19:14 -0600)
commit581e15a634bbe480a710662686d2a9e6425e0ee3
treec236cc685b3568c2092e8aca16a20da0a87008b2
parent6969eb1dfd7c38aaacbcca0e5f28eb7700303ed9
omap_hwmod: use a null structure record to terminate omap_hwmod_addr_space arrays

Previously, struct omap_hwmod_addr_space arrays were unterminated; and
users of these arrays used the ARRAY_SIZE() macro to determine the
length of the array.  However, ARRAY_SIZE() only works when the array
is in the same scope as the macro user.

So far this hasn't been a problem.  However, to reduce duplicated
data, a subsequent patch will move common data to a separate, shared
file.  When this is done, ARRAY_SIZE() will no longer be usable.

This patch removes ARRAY_SIZE() usage for struct omap_hwmod_addr_space
arrays and uses a null structure member as the array terminator
instead.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
arch/arm/mach-omap2/omap_hwmod.c
arch/arm/mach-omap2/omap_hwmod_2420_data.c
arch/arm/mach-omap2/omap_hwmod_2430_data.c
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
arch/arm/mach-omap2/omap_hwmod_44xx_data.c
arch/arm/plat-omap/include/plat/omap_hwmod.h