* [PATCH] ARM: pxafb: Fix access to nonexistent member of pxafb_info
@ 2011-03-22 12:14 Marek Vasut
2011-03-23 9:15 ` Vasily Khoruzhick
0 siblings, 1 reply; 5+ messages in thread
From: Marek Vasut @ 2011-03-22 12:14 UTC (permalink / raw)
To: linux-arm-kernel
In case CONFIG_FB_PXA_OVERLAY is not defined, the pxafb_freq_transition()
function tests nonexistent member of pxafb_info (since the member is not
part of the structure).
Fix this by wraping the test in ifdef, even if I don't really like how the code
looks now. The check doesn't have to happen if overlays are disabled at all as
the check is always true then.
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
drivers/video/pxafb.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index a2e5b51..0f4e8c9 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -1648,7 +1648,9 @@ pxafb_freq_transition(struct notifier_block *nb, unsigned long val, void *data)
switch (val) {
case CPUFREQ_PRECHANGE:
- if (!fbi->overlay[0].usage && !fbi->overlay[1].usage)
+#ifdef CONFIG_FB_PXA_OVERLAY
+ if (!(fbi->overlay[0].usage || fbi->overlay[1].usage))
+#endif
set_ctrlr_state(fbi, C_DISABLE_CLKCHANGE);
break;
--
1.7.2.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] ARM: pxafb: Fix access to nonexistent member of pxafb_info
2011-03-22 12:14 [PATCH] ARM: pxafb: Fix access to nonexistent member of pxafb_info Marek Vasut
@ 2011-03-23 9:15 ` Vasily Khoruzhick
2011-03-23 14:54 ` Marek Vasut
0 siblings, 1 reply; 5+ messages in thread
From: Vasily Khoruzhick @ 2011-03-23 9:15 UTC (permalink / raw)
To: linux-arm-kernel
On Tuesday 22 March 2011 14:14:14 Marek Vasut wrote:
> In case CONFIG_FB_PXA_OVERLAY is not defined, the pxafb_freq_transition()
> function tests nonexistent member of pxafb_info (since the member is not
> part of the structure).
> Fix this by wraping the test in ifdef, even if I don't really like how the
> code looks now. The check doesn't have to happen if overlays are disabled
> at all as the check is always true then.
Ok, but how you're going to implement it if overlay support is enabled, but
SoC does not support it?
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Vasily Khoruzhick <anarsoul@gmail.com>
> ---
> drivers/video/pxafb.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
> index a2e5b51..0f4e8c9 100644
> --- a/drivers/video/pxafb.c
> +++ b/drivers/video/pxafb.c
> @@ -1648,7 +1648,9 @@ pxafb_freq_transition(struct notifier_block *nb,
> unsigned long val, void *data)
>
> switch (val) {
> case CPUFREQ_PRECHANGE:
> - if (!fbi->overlay[0].usage && !fbi->overlay[1].usage)
> +#ifdef CONFIG_FB_PXA_OVERLAY
> + if (!(fbi->overlay[0].usage || fbi->overlay[1].usage))
> +#endif
> set_ctrlr_state(fbi, C_DISABLE_CLKCHANGE);
> break;
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ARM: pxafb: Fix access to nonexistent member of pxafb_info
2011-03-23 9:15 ` Vasily Khoruzhick
@ 2011-03-23 14:54 ` Marek Vasut
2011-03-23 15:05 ` Vasily Khoruzhick
0 siblings, 1 reply; 5+ messages in thread
From: Marek Vasut @ 2011-03-23 14:54 UTC (permalink / raw)
To: linux-arm-kernel
On Wednesday 23 March 2011 10:15:52 Vasily Khoruzhick wrote:
> On Tuesday 22 March 2011 14:14:14 Marek Vasut wrote:
> > In case CONFIG_FB_PXA_OVERLAY is not defined, the pxafb_freq_transition()
> > function tests nonexistent member of pxafb_info (since the member is not
> > part of the structure).
> > Fix this by wraping the test in ifdef, even if I don't really like how
> > the code looks now. The check doesn't have to happen if overlays are
> > disabled at all as the check is always true then.
>
> Ok, but how you're going to implement it if overlay support is enabled, but
> SoC does not support it?
Implement what ? The member doesn't exist in the structure so it doesn't even
compile with overlays disabled.
>
> > Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
>
> Acked-by: Vasily Khoruzhick <anarsoul@gmail.com>
>
> > ---
> >
> > drivers/video/pxafb.c | 4 +++-
> > 1 files changed, 3 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
> > index a2e5b51..0f4e8c9 100644
> > --- a/drivers/video/pxafb.c
> > +++ b/drivers/video/pxafb.c
> > @@ -1648,7 +1648,9 @@ pxafb_freq_transition(struct notifier_block *nb,
> > unsigned long val, void *data)
> >
> > switch (val) {
> >
> > case CPUFREQ_PRECHANGE:
> > - if (!fbi->overlay[0].usage && !fbi->overlay[1].usage)
> > +#ifdef CONFIG_FB_PXA_OVERLAY
> > + if (!(fbi->overlay[0].usage || fbi->overlay[1].usage))
> > +#endif
> >
> > set_ctrlr_state(fbi, C_DISABLE_CLKCHANGE);
> >
> > break;
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ARM: pxafb: Fix access to nonexistent member of pxafb_info
2011-03-23 14:54 ` Marek Vasut
@ 2011-03-23 15:05 ` Vasily Khoruzhick
2011-03-26 15:49 ` Eric Miao
0 siblings, 1 reply; 5+ messages in thread
From: Vasily Khoruzhick @ 2011-03-23 15:05 UTC (permalink / raw)
To: linux-arm-kernel
On Wednesday 23 March 2011 16:54:36 Marek Vasut wrote:
> Implement what ? The member doesn't exist in the structure so it doesn't
> even compile with overlays disabled.
Hm, sorry, I thought you also don't like that check is performed on SoCs
without overlays (PXA250/PXA260) when overlay support is compiled in.
I understand that it does not compile at all when CONFIG_FB_PXA_OVERLAY is not
set.
Regards
Vasily
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ARM: pxafb: Fix access to nonexistent member of pxafb_info
2011-03-23 15:05 ` Vasily Khoruzhick
@ 2011-03-26 15:49 ` Eric Miao
0 siblings, 0 replies; 5+ messages in thread
From: Eric Miao @ 2011-03-26 15:49 UTC (permalink / raw)
To: linux-arm-kernel
Merged with Vasily's Ack. On SoCs where there is no overlay HW yet
the support has been built into the kernel, the overlay[0/1].usage will
just be zero(s).
On Wed, Mar 23, 2011 at 11:05 PM, Vasily Khoruzhick <anarsoul@gmail.com> wrote:
> On Wednesday 23 March 2011 16:54:36 Marek Vasut wrote:
>
>> Implement what ? The member doesn't exist in the structure so it doesn't
>> even compile with overlays disabled.
>
> Hm, sorry, I thought you also don't like that check is performed on SoCs
> without overlays (PXA250/PXA260) when overlay support is compiled in.
>
> I understand that it does not compile at all when CONFIG_FB_PXA_OVERLAY is not
> set.
>
> Regards
> Vasily
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-03-26 15:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-22 12:14 [PATCH] ARM: pxafb: Fix access to nonexistent member of pxafb_info Marek Vasut
2011-03-23 9:15 ` Vasily Khoruzhick
2011-03-23 14:54 ` Marek Vasut
2011-03-23 15:05 ` Vasily Khoruzhick
2011-03-26 15:49 ` Eric Miao
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).