linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] drm/mcde: fix masking and bitwise-or on variable val
@ 2020-11-24 12:15 Colin King
  2020-11-25 20:59 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2020-11-24 12:15 UTC (permalink / raw)
  To: Linus Walleij, David Airlie, Daniel Vetter, Sam Ravnborg, dri-devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The masking of val with ~MCDE_CRX1_CLKSEL_MASK is currently being
ignored because there seems to be a missing bitwise-or of val in the
following statement.  Fix this by replacing the assignment of val
with a bitwise-or.

Addresses-Coverity: ("Unused valued")
Fixes: d795fd322063 ("drm/mcde: Support DPI output")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/gpu/drm/mcde/mcde_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/mcde/mcde_display.c b/drivers/gpu/drm/mcde/mcde_display.c
index d941026b940c..7c2e0b865441 100644
--- a/drivers/gpu/drm/mcde/mcde_display.c
+++ b/drivers/gpu/drm/mcde/mcde_display.c
@@ -738,7 +738,7 @@ static void mcde_configure_fifo(struct mcde *mcde, enum mcde_fifo fifo,
 	} else {
 		/* Use the MCDE clock for DSI */
 		val &= ~MCDE_CRX1_CLKSEL_MASK;
-		val = MCDE_CRX1_CLKSEL_MCDECLK << MCDE_CRX1_CLKSEL_SHIFT;
+		val |= MCDE_CRX1_CLKSEL_MCDECLK << MCDE_CRX1_CLKSEL_SHIFT;
 	}
 	writel(val, mcde->regs + cr1);
 	spin_unlock(&mcde->fifo_crx1_lock);
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][next] drm/mcde: fix masking and bitwise-or on variable val
  2020-11-24 12:15 [PATCH][next] drm/mcde: fix masking and bitwise-or on variable val Colin King
@ 2020-11-25 20:59 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2020-11-25 20:59 UTC (permalink / raw)
  To: Colin King
  Cc: David Airlie, Daniel Vetter, Sam Ravnborg,
	open list:DRM PANEL DRIVERS, kernel-janitors, linux-kernel

On Tue, Nov 24, 2020 at 1:15 PM Colin King <colin.king@canonical.com> wrote:

> From: Colin Ian King <colin.king@canonical.com>
>
> The masking of val with ~MCDE_CRX1_CLKSEL_MASK is currently being
> ignored because there seems to be a missing bitwise-or of val in the
> following statement.  Fix this by replacing the assignment of val
> with a bitwise-or.
>
> Addresses-Coverity: ("Unused valued")
> Fixes: d795fd322063 ("drm/mcde: Support DPI output")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Nice catch!
Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-25 20:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-24 12:15 [PATCH][next] drm/mcde: fix masking and bitwise-or on variable val Colin King
2020-11-25 20:59 ` Linus Walleij

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).