<pre>
Hi, Jason:
On Wed, 2023-06-21 at 15:54 +0800, Jason-JH.Lin wrote:
> 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.
Reviewed-by: CK Hu <ck.hu@mediatek.com>
>
> Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
> Fixes: 453c3364632a ("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/
> ---
> V1 -> V2: Add casting to (uintprt_t) before casting from (void *) to
> (enum).
> ---
> drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c | 2 +-
> drivers/gpu/drm/mediatek/mtk_drm_drv.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
> b/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
> index c0a38f5217ee..f2f6a5c01a6d 100644
> --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
> +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
> @@ -426,7 +426,7 @@ static int ovl_adaptor_comp_init(struct device
> *dev, struct component_match **ma
> continue;
> }
>
> -type = (enum mtk_ovl_adaptor_comp_type)of_id->data;
> +type = (enum
> mtk_ovl_adaptor_comp_type)(uintptr_t)of_id->data;
> id = ovl_adaptor_comp_get_id(dev, node, type);
> if (id < 0) {
> dev_warn(dev, "Skipping unknown component
> %pOF\n",
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> index 6dcb4ba2466c..80d3bcd315a9 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> @@ -829,7 +829,7 @@ static int mtk_drm_probe(struct platform_device
> *pdev)
> continue;
> }
>
> -comp_type = (enum mtk_ddp_comp_type)of_id->data;
> +comp_type = (enum mtk_ddp_comp_type)(uintptr_t)of_id-
> >data;
>
> if (comp_type == MTK_DISP_MUTEX) {
> int id;
</pre><!--type:text--><!--{--><pre>************* MEDIATEK Confidentiality Notice ********************
The information contained in this e-mail message (including any
attachments) may be confidential, proprietary, privileged, or otherwise
exempt from disclosure under applicable laws. It is intended to be
conveyed only to the designated recipient(s). Any use, dissemination,
distribution, printing, retaining or copying of this e-mail (including its
attachments) by unintended recipient(s) is strictly prohibited and may
be unlawful. If you are not an intended recipient of this e-mail, or believe
that you have received this e-mail in error, please notify the sender
immediately (by replying to this e-mail), delete any and all copies of
this e-mail (including any attachments) from your system, and do not
disclose the content of this e-mail to any other person. Thank you!
</pre><!--}-->