* [PATCH] drm: gma500: fix logic error
@ 2017-09-05 7:47 Arnd Bergmann
2017-09-05 11:08 ` Daniel Vetter
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2017-09-05 7:47 UTC (permalink / raw)
To: Patrik Jakobsson, David Airlie
Cc: Arnd Bergmann, Daniel Vetter, Ville Syrjälä,
Laurent Pinchart, dri-devel, linux-kernel
gcc-8 points out a condition that almost certainly doesn't
do what the author had in mind:
drivers/gpu/drm/gma500/mdfld_intel_display.c: In function 'mdfldWaitForPipeEnable':
drivers/gpu/drm/gma500/mdfld_intel_display.c:102:37: error: bitwise comparison always evaluates to false [-Werror=tautological-compare]
This changes it to a simple bit mask operation to check
whether the bit is set.
Fixes: 026abc333205 ("gma500: initial medfield merge")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/gpu/drm/gma500/mdfld_intel_display.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/gma500/mdfld_intel_display.c b/drivers/gpu/drm/gma500/mdfld_intel_display.c
index 531e4450c000..5c066448be5b 100644
--- a/drivers/gpu/drm/gma500/mdfld_intel_display.c
+++ b/drivers/gpu/drm/gma500/mdfld_intel_display.c
@@ -99,7 +99,7 @@ void mdfldWaitForPipeEnable(struct drm_device *dev, int pipe)
/* Wait for for the pipe enable to take effect. */
for (count = 0; count < COUNT_MAX; count++) {
temp = REG_READ(map->conf);
- if ((temp & PIPEACONF_PIPE_STATE) == 1)
+ if (temp & PIPEACONF_PIPE_STATE)
break;
}
}
--
2.9.0
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] drm: gma500: fix logic error
2017-09-05 7:47 [PATCH] drm: gma500: fix logic error Arnd Bergmann
@ 2017-09-05 11:08 ` Daniel Vetter
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2017-09-05 11:08 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Patrik Jakobsson, David Airlie, Daniel Vetter,
Ville Syrjälä,
Laurent Pinchart, dri-devel, linux-kernel
On Tue, Sep 05, 2017 at 09:47:26AM +0200, Arnd Bergmann wrote:
> gcc-8 points out a condition that almost certainly doesn't
> do what the author had in mind:
>
> drivers/gpu/drm/gma500/mdfld_intel_display.c: In function 'mdfldWaitForPipeEnable':
> drivers/gpu/drm/gma500/mdfld_intel_display.c:102:37: error: bitwise comparison always evaluates to false [-Werror=tautological-compare]
>
> This changes it to a simple bit mask operation to check
> whether the bit is set.
>
> Fixes: 026abc333205 ("gma500: initial medfield merge")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied to drm-misc, thanks.
-Daniel
> ---
> drivers/gpu/drm/gma500/mdfld_intel_display.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/gma500/mdfld_intel_display.c b/drivers/gpu/drm/gma500/mdfld_intel_display.c
> index 531e4450c000..5c066448be5b 100644
> --- a/drivers/gpu/drm/gma500/mdfld_intel_display.c
> +++ b/drivers/gpu/drm/gma500/mdfld_intel_display.c
> @@ -99,7 +99,7 @@ void mdfldWaitForPipeEnable(struct drm_device *dev, int pipe)
> /* Wait for for the pipe enable to take effect. */
> for (count = 0; count < COUNT_MAX; count++) {
> temp = REG_READ(map->conf);
> - if ((temp & PIPEACONF_PIPE_STATE) == 1)
> + if (temp & PIPEACONF_PIPE_STATE)
> break;
> }
> }
> --
> 2.9.0
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-09-05 11:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-05 7:47 [PATCH] drm: gma500: fix logic error Arnd Bergmann
2017-09-05 11:08 ` Daniel Vetter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®