This is an automatic generated email to let you know that the following patch 
were queued:

Subject: media: ti-vpe: cal: Drop unneeded check in cal_calc_format_size()
Author:  Laurent Pinchart <[email protected]>
Date:    Mon Dec 7 00:53:46 2020 +0100

The cal_calc_format_size() function checks that the passed fmtinfo
argument is not NULL. All callers ensure that the pointer is valid. Drop
the check.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Benoit Parrot <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/platform/ti-vpe/cal-video.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

---

diff --git a/drivers/media/platform/ti-vpe/cal-video.c 
b/drivers/media/platform/ti-vpe/cal-video.c
index 32dd4d9ca212..ad1e85189831 100644
--- a/drivers/media/platform/ti-vpe/cal-video.c
+++ b/drivers/media/platform/ti-vpe/cal-video.c
@@ -146,17 +146,12 @@ static int __subdev_set_format(struct cal_ctx *ctx,
        return 0;
 }
 
-static int cal_calc_format_size(struct cal_ctx *ctx,
-                               const struct cal_format_info *fmtinfo,
-                               struct v4l2_format *f)
+static void cal_calc_format_size(struct cal_ctx *ctx,
+                                const struct cal_format_info *fmtinfo,
+                                struct v4l2_format *f)
 {
        u32 bpl, max_width;
 
-       if (!fmtinfo) {
-               ctx_dbg(3, ctx, "No cal_fmt provided!\n");
-               return -EINVAL;
-       }
-
        /*
         * Maximum width is bound by the DMA max width in bytes.
         * We need to recalculate the actual maxi width depending on the
@@ -177,8 +172,6 @@ static int cal_calc_format_size(struct cal_ctx *ctx,
                __func__, fourcc_to_str(f->fmt.pix.pixelformat),
                f->fmt.pix.width, f->fmt.pix.height,
                f->fmt.pix.bytesperline, f->fmt.pix.sizeimage);
-
-       return 0;
 }
 
 static int cal_g_fmt_vid_cap(struct file *file, void *priv,
@@ -247,7 +240,8 @@ static int cal_try_fmt_vid_cap(struct file *file, void 
*priv,
         * updated properly during s_fmt
         */
        f->fmt.pix.colorspace = ctx->v_fmt.fmt.pix.colorspace;
-       return cal_calc_format_size(ctx, fmtinfo, f);
+       cal_calc_format_size(ctx, fmtinfo, f);
+       return 0;
 }
 
 static int cal_s_fmt_vid_cap(struct file *file, void *priv,

_______________________________________________
linuxtv-commits mailing list
[email protected]
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to