summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJunlin Yang <yangjunlin@yulong.com>2021-03-12 15:14:45 +0800
committerTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2021-03-17 13:59:23 +0200
commit6909115442759efef3d4bc5d9c54d7943f1afc14 (patch)
tree0998ef1579b1b6da1601e4e2c7bf2caa2028a6b1 /drivers
parent6c5403173a13a08ff61dbdafa4c0ed4a9dedbfe0 (diff)
drm/omap: dsi: fix unsigned expression compared with zerodrm-misc-fixes-2021-03-18
r is "u32" always >= 0,mipi_dsi_create_packet may return little than zero. so r < 0 condition is never accessible. Fixes coccicheck warnings: ./drivers/gpu/drm/omapdrm/dss/dsi.c:2155:5-6: WARNING: Unsigned expression compared with zero: r < 0 Signed-off-by: Junlin Yang <yangjunlin@yulong.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210312071445.1721-1-angkery@163.com
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/omapdrm/dss/dsi.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
index 8e11612f5fe1..b31d750c425a 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -2149,11 +2149,12 @@ static int dsi_vc_send_short(struct dsi_data *dsi, int vc,
const struct mipi_dsi_msg *msg)
{
struct mipi_dsi_packet pkt;
+ int ret;
u32 r;
- r = mipi_dsi_create_packet(&pkt, msg);
- if (r < 0)
- return r;
+ ret = mipi_dsi_create_packet(&pkt, msg);
+ if (ret < 0)
+ return ret;
WARN_ON(!dsi_bus_is_locked(dsi));