[bug report] drm/mediatek: dp: Audio support for MT8195

Dan Carpenter dan.carpenter at linaro.org
Wed Apr 19 07:30:37 PDT 2023


Hello Guillaume Ranquet,

The patch e71a8ebbe086: "drm/mediatek: dp: Audio support for MT8195"
from Sep 1, 2022, leads to the following Smatch static checker
warning:

drivers/gpu/drm/mediatek/mtk_dp.c:680 mtk_dp_disable_sdp_aui() warn: odd binop '0x30a8 & 0x3'
drivers/gpu/drm/mediatek/mtk_dp.c:692 mtk_dp_setup_sdp_aui() warn: odd binop '0x30a8 & 0x3'

drivers/gpu/drm/mediatek/mtk_dp.c
    676 static void mtk_dp_disable_sdp_aui(struct mtk_dp *mtk_dp)
    677 {
    678         /* Disable periodic send */
    679         mtk_dp_update_bits(mtk_dp, MTK_DP_ENC0_P0_30A8 & 0xfffc, 0,
--> 680                            0xff << ((MTK_DP_ENC0_P0_30A8 & 3) * 8));

MTK_DP_ENC0_P0_30A8 is 0x30a8 as the name implies.  So 0x30a8 & 3 is
always zero.  It's not clear what's happening here.

    681 }

regards,
dan carpenter



More information about the Linux-mediatek mailing list