Thread (7 messages) 7 messages, 2 authors, 2022-01-07

Re: [PATCH] drm/mediatek: Fix unused-but-set variable warning

From: <hidden>
Date: 2021-12-29 03:04:13
Also in: dri-devel, linux-arm-kernel, lkml

Hi,

On 28/12/2021 10:25, Miles Chen wrote:
Fix unused-but-set variable warning:
quoted
drivers/gpu/drm/mediatek/mtk_cec.c:85:6: warning: variable 'tmp' set but not used [-Wunused-but-set-variable]
Actually we ignore the value passed to mtk_cec_mask. In case of
mtk_cec_mask(cec, CEC_CKGEN, 0 | CEC_32K_PDN, PDN | CEC_32K_PDN);


We are not setting CEC_32K_PDN. I wonder which side effect will it have to set 
that bit.
I am confused about "not setting CEC_32K_PDN" part,
in case mtk_cec_mask(cec, CEC_CKGEN, 0 | CEC_32K_PDN, PDN | CEC_32K_PDN);
CEC_32K_PDN (BIT(19)) is set.

for exmaple:
CEC_32K_PDN is BIT(19)
PDN is BIT(16)
say tmp = 0xffffffff;

mask = PDN | CEC_32K_PDN;
val = 0 | CEC_32K_PDN;

tmp = fff6ffff, mask = 90000
val = 80000, tmp = fffeffff

u32 tmp = readl(cec->regs + offset) & ~mask; // tmp = fff6ffff
tmp |= val & mask; // tmp = fffeffff
writel(val, cec->regs + offset); // val = 80000, tmp = fffeffff

in both val and tmp case, CEC_32K_PDN is set.
Anyway, if it's the right thing to do, we should add:

Fixes: 8f83f26891e1 ("drm/mediatek: Add HDMI support")
I will add the Fixes tag, thanks.

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help