Skip to contentSkip to conversation

drm: zte: fix static checker warning on variable 'fmt'

PATCH In review Shawn Guo 2 participants 2 messages Feb 20, 2017 – Feb 21, 2017

Subsystems (2)
lore
Share & tools
lore

Shawn Guo

author
#0 lore raw

PATCH 1/1 drm: zte: fix static checker warning on variable 'fmt'

From: Shawn Guo <[email protected]>

Commit 4e986d3705df ("drm: zte: add overlay plane support") introduces the following static checker warning:

drivers/gpu/drm/zte/zx_plane.c:170 zx_vl_rsz_setup()
warn: always true condition '(fmt >= 0) => (0-u32max >= 0)'

Fix it by change 'fmt' type to integer.

Fixes 4e986d3705df ("drm: zte: add overlay plane support")
---
 drivers/gpu/drm/zte/zx_plane.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/zte/zx_plane.c +2 -2
index 1d08ba381098..d646ac931663 100644
@@ -159,7 +159,7 @@ static void zx_vl_rsz_setup(struct zx_plane *zplane, uint32_t format,
 	void __iomem *rsz = zplane->rsz;
 	u32 src_chroma_w = src_w;
 	u32 src_chroma_h = src_h;
-	u32 fmt;
+	int fmt;
 
 	/* Set up source and destination resolution */
 	zx_writel(rsz + RSZ_SRC_CFG, RSZ_VER(src_h - 1) | RSZ_HOR(src_w - 1));
@@ -203,7 +203,7 @@ static void zx_vl_plane_atomic_update(struct drm_plane *plane,
 	u32 src_x, src_y, src_w, src_h;
 	u32 dst_x, dst_y, dst_w, dst_h;
 	uint32_t format;
-	u32 fmt;
+	int fmt;
 	int num_planes;
 	int i;
 
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Shawn Guo

From: Shawn Guo <[email protected]>

Commit 4e986d3705df ("drm: zte: add overlay plane support") introduces the following static checker warning:

Quoted 8 lines

drivers/gpu/drm/zte/zx_plane.c:170 zx_vl_rsz_setup()
warn: always true condition '(fmt >= 0) => (0-u32max >= 0)'

Fix it by change 'fmt' type to integer.

Fixes 4e986d3705df ("drm: zte: add overlay plane support")
Quoted 29 lines
---
 drivers/gpu/drm/zte/zx_plane.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/zte/zx_plane.c +2 -3
index 1d08ba381098..d646ac931663 100644
@@ -159,7 +159,7 @@ static void zx_vl_rsz_setup(struct zx_plane *zplane, uint32_t format,
        void __iomem *rsz = zplane->rsz;
        u32 src_chroma_w = src_w;
        u32 src_chroma_h = src_h;
-       u32 fmt;
+       int fmt;
 
        /* Set up source and destination resolution */
        zx_writel(rsz + RSZ_SRC_CFG, RSZ_VER(src_h - 1) | RSZ_HOR(src_w - 1));
@@ -203,7 +203,7 @@ static void zx_vl_plane_atomic_update(struct drm_plane *plane,
        u32 src_x, src_y, src_w, src_h;
        u32 dst_x, dst_y, dst_w, dst_h;
        uint32_t format;
-       u32 fmt;
+       int fmt;
        int num_planes;
        int i;
 
--

1.9.1

Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel