* [PATCH] OMAP1: McBSP: fix build break for non-multi-OMAP1 configs
@ 2011-03-04 22:36 Paul Walmsley
2011-03-07 14:30 ` Jarkko Nikula
0 siblings, 1 reply; 4+ messages in thread
From: Paul Walmsley @ 2011-03-04 22:36 UTC (permalink / raw)
To: linux-arm-kernel
Commit 3cf32bba8ca0e0052ca41d74d455a5805b7fea85 ("OMAP: McBSP: Convert
McBSP to platform device model") in the current omap-for-linus branch
breaks compilation with non-multi-OMAP1 configs:
CC arch/arm/mach-omap1/mcbsp.o
arch/arm/mach-omap1/mcbsp.c: In function 'omap1_mcbsp_init':
arch/arm/mach-omap1/mcbsp.c:384: warning: dereferencing 'void *' pointer
arch/arm/mach-omap1/mcbsp.c:387: error: invalid use of void expression
arch/arm/mach-omap1/mcbsp.c:390: warning: dereferencing 'void *' pointer
arch/arm/mach-omap1/mcbsp.c:393: error: invalid use of void expression
Fix by avoiding NULL dereferences.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap1/mcbsp.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c
index e68f6c0..d9af981 100644
--- a/arch/arm/mach-omap1/mcbsp.c
+++ b/arch/arm/mach-omap1/mcbsp.c
@@ -136,6 +136,8 @@ struct resource omap7xx_mcbsp_res[][6] = {
},
};
+#define omap7xx_mcbsp_res_0 omap7xx_mcbsp_res[0]
+
static struct omap_mcbsp_platform_data omap7xx_mcbsp_pdata[] = {
{
.ops = &omap1_mcbsp_ops,
@@ -147,7 +149,7 @@ static struct omap_mcbsp_platform_data omap7xx_mcbsp_pdata[] = {
#define OMAP7XX_MCBSP_RES_SZ ARRAY_SIZE(omap7xx_mcbsp_res[1])
#define OMAP7XX_MCBSP_COUNT ARRAY_SIZE(omap7xx_mcbsp_res)
#else
-#define omap7xx_mcbsp_res NULL
+#define omap7xx_mcbsp_res_0 NULL
#define omap7xx_mcbsp_pdata NULL
#define OMAP7XX_MCBSP_RES_SZ 0
#define OMAP7XX_MCBSP_COUNT 0
@@ -238,6 +240,8 @@ struct resource omap15xx_mcbsp_res[][6] = {
},
};
+#define omap15xx_mcbsp_res_0 omap15xx_mcbsp_res[0]
+
static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = {
{
.ops = &omap1_mcbsp_ops,
@@ -252,7 +256,7 @@ static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = {
#define OMAP15XX_MCBSP_RES_SZ ARRAY_SIZE(omap15xx_mcbsp_res[1])
#define OMAP15XX_MCBSP_COUNT ARRAY_SIZE(omap15xx_mcbsp_res)
#else
-#define omap15xx_mcbsp_res NULL
+#define omap15xx_mcbsp_res_0 NULL
#define omap15xx_mcbsp_pdata NULL
#define OMAP15XX_MCBSP_RES_SZ 0
#define OMAP15XX_MCBSP_COUNT 0
@@ -343,6 +347,8 @@ struct resource omap16xx_mcbsp_res[][6] = {
},
};
+#define omap16xx_mcbsp_res_0 omap16xx_mcbsp_res[0]
+
static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = {
{
.ops = &omap1_mcbsp_ops,
@@ -357,7 +363,7 @@ static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = {
#define OMAP16XX_MCBSP_RES_SZ ARRAY_SIZE(omap16xx_mcbsp_res[1])
#define OMAP16XX_MCBSP_COUNT ARRAY_SIZE(omap16xx_mcbsp_res)
#else
-#define omap16xx_mcbsp_res NULL
+#define omap16xx_mcbsp_res_0 NULL
#define omap16xx_mcbsp_pdata NULL
#define OMAP16XX_MCBSP_RES_SZ 0
#define OMAP16XX_MCBSP_COUNT 0
@@ -381,19 +387,19 @@ static int __init omap1_mcbsp_init(void)
return -ENOMEM;
if (cpu_is_omap7xx())
- omap_mcbsp_register_board_cfg(omap7xx_mcbsp_res[0],
+ omap_mcbsp_register_board_cfg(omap7xx_mcbsp_res_0,
OMAP7XX_MCBSP_RES_SZ,
omap7xx_mcbsp_pdata,
OMAP7XX_MCBSP_COUNT);
if (cpu_is_omap15xx())
- omap_mcbsp_register_board_cfg(omap15xx_mcbsp_res[0],
+ omap_mcbsp_register_board_cfg(omap15xx_mcbsp_res_0,
OMAP15XX_MCBSP_RES_SZ,
omap15xx_mcbsp_pdata,
OMAP15XX_MCBSP_COUNT);
if (cpu_is_omap16xx())
- omap_mcbsp_register_board_cfg(omap16xx_mcbsp_res[0],
+ omap_mcbsp_register_board_cfg(omap16xx_mcbsp_res_0,
OMAP16XX_MCBSP_RES_SZ,
omap16xx_mcbsp_pdata,
OMAP16XX_MCBSP_COUNT);
--
1.7.2.3
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH] OMAP1: McBSP: fix build break for non-multi-OMAP1 configs
2011-03-04 22:36 [PATCH] OMAP1: McBSP: fix build break for non-multi-OMAP1 configs Paul Walmsley
@ 2011-03-07 14:30 ` Jarkko Nikula
2011-03-08 2:34 ` Paul Walmsley
0 siblings, 1 reply; 4+ messages in thread
From: Jarkko Nikula @ 2011-03-07 14:30 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, 4 Mar 2011 15:36:46 -0700 (MST)
Paul Walmsley <paul@pwsan.com> wrote:
>
> Commit 3cf32bba8ca0e0052ca41d74d455a5805b7fea85 ("OMAP: McBSP: Convert
> McBSP to platform device model") in the current omap-for-linus branch
> breaks compilation with non-multi-OMAP1 configs:
>
> CC arch/arm/mach-omap1/mcbsp.o
> arch/arm/mach-omap1/mcbsp.c: In function 'omap1_mcbsp_init':
> arch/arm/mach-omap1/mcbsp.c:384: warning: dereferencing 'void *' pointer
> arch/arm/mach-omap1/mcbsp.c:387: error: invalid use of void expression
> arch/arm/mach-omap1/mcbsp.c:390: warning: dereferencing 'void *' pointer
> arch/arm/mach-omap1/mcbsp.c:393: error: invalid use of void expression
>
> +#define omap7xx_mcbsp_res_0 omap7xx_mcbsp_res[0]
> +
...
> if (cpu_is_omap7xx())
> - omap_mcbsp_register_board_cfg(omap7xx_mcbsp_res[0],
> + omap_mcbsp_register_board_cfg(omap7xx_mcbsp_res_0,
> OMAP7XX_MCBSP_RES_SZ,
> omap7xx_mcbsp_pdata,
> OMAP7XX_MCBSP_COUNT);
omapxxx_mcbsp_res_0 doesn't look the best here in readability point of
view but provides the smallest fix as no need to rename array and
modify the _RES_SZ and _COUNT macros. So this fix is needed here and a
small readability update can be done later.
Acked-by: Jarkko Nikula <jhnikula@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH] OMAP1: McBSP: fix build break for non-multi-OMAP1 configs
2011-03-07 14:30 ` Jarkko Nikula
@ 2011-03-08 2:34 ` Paul Walmsley
2011-03-08 23:11 ` Tony Lindgren
0 siblings, 1 reply; 4+ messages in thread
From: Paul Walmsley @ 2011-03-08 2:34 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, 7 Mar 2011, Jarkko Nikula wrote:
> omapxxx_mcbsp_res_0 doesn't look the best here in readability point of
> view but provides the smallest fix as no need to rename array and
> modify the _RES_SZ and _COUNT macros. So this fix is needed here and a
> small readability update can be done later.
>
> Acked-by: Jarkko Nikula <jhnikula@gmail.com>
Thanks Jarkko. For what it's worth, I agree it's an ugly patch.
- Paul
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] OMAP1: McBSP: fix build break for non-multi-OMAP1 configs
2011-03-08 2:34 ` Paul Walmsley
@ 2011-03-08 23:11 ` Tony Lindgren
0 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2011-03-08 23:11 UTC (permalink / raw)
To: linux-arm-kernel
* Paul Walmsley <paul@pwsan.com> [110307 18:32]:
> On Mon, 7 Mar 2011, Jarkko Nikula wrote:
>
> > omapxxx_mcbsp_res_0 doesn't look the best here in readability point of
> > view but provides the smallest fix as no need to rename array and
> > modify the _RES_SZ and _COUNT macros. So this fix is needed here and a
> > small readability update can be done later.
> >
> > Acked-by: Jarkko Nikula <jhnikula@gmail.com>
>
> Thanks Jarkko. For what it's worth, I agree it's an ugly patch.
Applying.
Tony
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-03-08 23:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-04 22:36 [PATCH] OMAP1: McBSP: fix build break for non-multi-OMAP1 configs Paul Walmsley
2011-03-07 14:30 ` Jarkko Nikula
2011-03-08 2:34 ` Paul Walmsley
2011-03-08 23:11 ` Tony Lindgren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).