From: "CK Hu (胡俊光)" <ck.hu@mediatek.com>
To: "Jason-JH Lin (林睿祥)" <Jason-JH.Lin@mediatek.com>,
"chunkuang.hu@kernel.org" <chunkuang.hu@kernel.org>,
"angelogioacchino.delregno@collabora.com"
<angelogioacchino.delregno@collabora.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Singo Chang (張興國)" <Singo.Chang@mediatek.com>,
"Johnson Wang (王聖鑫)" <Johnson.Wang@mediatek.com>,
"Jason-ch Chen (陳建豪)" <Jason-ch.Chen@mediatek.com>,
"Shawn Sung (宋孝謙)" <Shawn.Sung@mediatek.com>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"Nancy Lin (林欣螢)" <Nancy.Lin@mediatek.com>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
Project_Global_Chrome_Upstream_Group
<Project_Global_Chrome_Upstream_Group@mediatek.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2] drm/mediatek: Fix void-pointer-to-enum-cast warning
Date: Mon, 10 Jul 2023 02:13:38 +0000 [thread overview]
Message-ID: <b7769eb121b2241881f2eb3f5756ce8ceb95f862.camel@mediatek.com> (raw)
In-Reply-To: <20230621075421.1982-1-jason-jh.lin@mediatek.com>
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;
parent reply other threads:[~2023-07-10 2:14 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20230621075421.1982-1-jason-jh.lin@mediatek.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b7769eb121b2241881f2eb3f5756ce8ceb95f862.camel@mediatek.com \
--to=ck.hu@mediatek.com \
--cc=Jason-JH.Lin@mediatek.com \
--cc=Jason-ch.Chen@mediatek.com \
--cc=Johnson.Wang@mediatek.com \
--cc=Nancy.Lin@mediatek.com \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=Shawn.Sung@mediatek.com \
--cc=Singo.Chang@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=chunkuang.hu@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®