Skip to content

Commit 89cba95

Browse files
Jason-JH.LinChun-Kuang Hu
authored andcommitted
drm/mediatek: Fix void-pointer-to-enum-cast warning
1. Fix build warning message in mtk_disp_ovl_adaptor.c >> drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c:415:10: warning: cast to smaller integer type 'enum mtk_ovl_adaptor_comp_type' from 'const void *' [-Wvoid-pointer-to-enum-cast] type = (enum mtk_ovl_adaptor_comp_type)of_id->data; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. 2. Also fix the same warning message in mtk_drm_drv.c >> drivers/gpu/drm/mediatek/mtk_drm_drv.c:832:15: warning: cast to smaller integer type 'enum mtk_ddp_comp_type' from 'const void *' [-Wvoid-pointer-to-enum-cast] comp_type = (enum mtk_ddp_comp_type)of_id->data; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com> Fixes: 453c336 ("drm/mediatek: Add ovl_adaptor support for MT8195") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202305042054.ZtWME9OU-lkp@intel.com/ Reviewed-by: CK Hu <ck.hu@mediatek.com> Link: https://patchwork.kernel.org/project/dri-devel/patch/20230621075421.1982-1-jason-jh.lin@mediatek.com/ Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
1 parent 379091e commit 89cba95

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ static int ovl_adaptor_comp_init(struct device *dev, struct component_match **ma
426426
continue;
427427
}
428428

429-
type = (enum mtk_ovl_adaptor_comp_type)of_id->data;
429+
type = (enum mtk_ovl_adaptor_comp_type)(uintptr_t)of_id->data;
430430
id = ovl_adaptor_comp_get_id(dev, node, type);
431431
if (id < 0) {
432432
dev_warn(dev, "Skipping unknown component %pOF\n",

drivers/gpu/drm/mediatek/mtk_drm_drv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ static int mtk_drm_probe(struct platform_device *pdev)
832832
continue;
833833
}
834834

835-
comp_type = (enum mtk_ddp_comp_type)of_id->data;
835+
comp_type = (enum mtk_ddp_comp_type)(uintptr_t)of_id->data;
836836

837837
if (comp_type == MTK_DISP_MUTEX) {
838838
int id;

0 commit comments

Comments
 (0)