* [PATCH] drm/mediatek: Remove less-than-zero comparison of an unsigned value
@ 2024-06-14 3:49 Shawn Sung
2024-06-17 1:19 ` CK Hu (胡俊光)
0 siblings, 1 reply; 2+ messages in thread
From: Shawn Sung @ 2024-06-14 3:49 UTC (permalink / raw)
To: Chun-Kuang Hu, Philipp Zabel, David Airlie, Daniel Vetter,
Matthias Brugger, AngeloGioacchino Del Regno, Nancy . Lin,
dri-devel, linux-mediatek, linux-kernel, linux-arm-kernel
Cc: Hsiao Chien Sung
From: Hsiao Chien Sung <shawn.sung@mediatek.com>
Fix a Coverity error that less-than-zero comparison of an unsigned value
is never true.
Fixes: 0d9eee9118b7 ("drm/mediatek: Add drm ovl_adaptor sub driver for MT8195")
Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.com>
---
drivers/gpu/drm/mediatek/mtk_ddp_comp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/mediatek/mtk_ddp_comp.c b/drivers/gpu/drm/mediatek/mtk_ddp_comp.c
index 17b036411292..a66e46d0b45e 100644
--- a/drivers/gpu/drm/mediatek/mtk_ddp_comp.c
+++ b/drivers/gpu/drm/mediatek/mtk_ddp_comp.c
@@ -593,7 +593,7 @@ int mtk_ddp_comp_init(struct device_node *node, struct mtk_ddp_comp *comp,
int ret;
#endif
- if (comp_id < 0 || comp_id >= DDP_COMPONENT_DRM_ID_MAX)
+ if (comp_id >= DDP_COMPONENT_DRM_ID_MAX)
return -EINVAL;
type = mtk_ddp_matches[comp_id].type;
--
2.18.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/mediatek: Remove less-than-zero comparison of an unsigned value
2024-06-14 3:49 [PATCH] drm/mediatek: Remove less-than-zero comparison of an unsigned value Shawn Sung
@ 2024-06-17 1:19 ` CK Hu (胡俊光)
0 siblings, 0 replies; 2+ messages in thread
From: CK Hu (胡俊光) @ 2024-06-17 1:19 UTC (permalink / raw)
To: linux-mediatek, linux-kernel, chunkuang.hu,
Shawn Sung (宋孝謙),
Nancy Lin (林欣螢),
daniel, p.zabel, dri-devel, airlied, linux-arm-kernel,
matthias.bgg, angelogioacchino.delregno
Hi, Shawn:
On Fri, 2024-06-14 at 11:49 +0800, Shawn Sung wrote:
> From: Hsiao Chien Sung <shawn.sung@mediatek.com>
>
> Fix a Coverity error that less-than-zero comparison of an unsigned value
> is never true.
Reviewed-by: CK Hu <ck.hu@mediatek.com>
>
> Fixes: 0d9eee9118b7 ("drm/mediatek: Add drm ovl_adaptor sub driver for MT8195")
> Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.com>
> ---
> drivers/gpu/drm/mediatek/mtk_ddp_comp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_ddp_comp.c b/drivers/gpu/drm/mediatek/mtk_ddp_comp.c
> index 17b036411292..a66e46d0b45e 100644
> --- a/drivers/gpu/drm/mediatek/mtk_ddp_comp.c
> +++ b/drivers/gpu/drm/mediatek/mtk_ddp_comp.c
> @@ -593,7 +593,7 @@ int mtk_ddp_comp_init(struct device_node *node, struct mtk_ddp_comp *comp,
> int ret;
> #endif
>
> - if (comp_id < 0 || comp_id >= DDP_COMPONENT_DRM_ID_MAX)
> + if (comp_id >= DDP_COMPONENT_DRM_ID_MAX)
> return -EINVAL;
>
> type = mtk_ddp_matches[comp_id].type;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-06-17 1:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-14 3:49 [PATCH] drm/mediatek: Remove less-than-zero comparison of an unsigned value Shawn Sung
2024-06-17 1:19 ` CK Hu (胡俊光)
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®