Commit 2a50e8d7 authored by Tomi Valkeinen's avatar Tomi Valkeinen Committed by Mauro Carvalho Chehab

media: ti: cal: fix useless variable init

'ret' is initialized needlessly in cal_legacy_try_fmt_vid_cap(). We can
also move the variable to the for block, which is the only place where
it is used.
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 3028fb90
...@@ -191,7 +191,7 @@ static int cal_legacy_try_fmt_vid_cap(struct file *file, void *priv, ...@@ -191,7 +191,7 @@ static int cal_legacy_try_fmt_vid_cap(struct file *file, void *priv,
struct cal_ctx *ctx = video_drvdata(file); struct cal_ctx *ctx = video_drvdata(file);
const struct cal_format_info *fmtinfo; const struct cal_format_info *fmtinfo;
struct v4l2_subdev_frame_size_enum fse; struct v4l2_subdev_frame_size_enum fse;
int ret, found; int found;
fmtinfo = find_format_by_pix(ctx, f->fmt.pix.pixelformat); fmtinfo = find_format_by_pix(ctx, f->fmt.pix.pixelformat);
if (!fmtinfo) { if (!fmtinfo) {
...@@ -206,12 +206,13 @@ static int cal_legacy_try_fmt_vid_cap(struct file *file, void *priv, ...@@ -206,12 +206,13 @@ static int cal_legacy_try_fmt_vid_cap(struct file *file, void *priv,
f->fmt.pix.field = ctx->v_fmt.fmt.pix.field; f->fmt.pix.field = ctx->v_fmt.fmt.pix.field;
/* check for/find a valid width/height */ /* check for/find a valid width/height */
ret = 0;
found = false; found = false;
fse.pad = 0; fse.pad = 0;
fse.code = fmtinfo->code; fse.code = fmtinfo->code;
fse.which = V4L2_SUBDEV_FORMAT_ACTIVE; fse.which = V4L2_SUBDEV_FORMAT_ACTIVE;
for (fse.index = 0; ; fse.index++) { for (fse.index = 0; ; fse.index++) {
int ret;
ret = v4l2_subdev_call(ctx->phy->source, pad, enum_frame_size, ret = v4l2_subdev_call(ctx->phy->source, pad, enum_frame_size,
NULL, &fse); NULL, &fse);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment