lkml.org 
[lkml]   [2021]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH] drm/mediatek: Fix unused-but-set variable warning
    Date
    Hi,

    On 28/12/2021 10:25, Miles Chen wrote:
    > Fix unused-but-set variable warning:
    >> 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.

    \
     
     \ /
      Last update: 2021-12-29 04:04    [W:2.196 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site