As reported by smatch:
        drivers/media/platform/sti/bdisp/bdisp-v4l2.c:947 bdisp_s_selection() 
warn: unsigned 'out.width' is never less than zero.
        drivers/media/platform/sti/bdisp/bdisp-v4l2.c:947 bdisp_s_selection() 
warn: unsigned 'out.height' is never less than zero.
Indeed, width and height are unsigned.

Signed-off-by: Fabien Dessenne <fabien.desse...@st.com>
---
 drivers/media/platform/sti/bdisp/bdisp-v4l2.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c 
b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
index 89d7a22..9a8405c 100644
--- a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
+++ b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
@@ -944,8 +944,7 @@ static int bdisp_s_selection(struct file *file, void *fh,
        out.width = ALIGN(in->width, frame->fmt->w_align);
        out.height = ALIGN(in->height, frame->fmt->w_align);
 
-       if ((out.width < 0) || (out.height < 0) ||
-           ((out.left + out.width) > frame->width) ||
+       if (((out.left + out.width) > frame->width) ||
            ((out.top + out.height) > frame->height)) {
                dev_err(ctx->bdisp_dev->dev,
                        "Invalid crop: %dx%d@(%d,%d) vs frame: %dx%d\n",
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to