Commit 32af858c authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] media: exynos-gsc: fix build warning

Fixes following build warnings:

gsc-core.c:350:17: warning: 'low_plane' may be used uninitialized
gsc-core.c:371:31: warning: 'high_plane' may be used uninitialized
Reported-by: default avatarPrabhakar Lad <prabhakar.csengg@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: default avatarLad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 2281c824
......@@ -319,21 +319,22 @@ int gsc_enum_fmt_mplane(struct v4l2_fmtdesc *f)
return 0;
}
static u32 get_plane_info(struct gsc_frame *frm, u32 addr, u32 *index)
static int get_plane_info(struct gsc_frame *frm, u32 addr, u32 *index, u32 *ret_addr)
{
if (frm->addr.y == addr) {
*index = 0;
return frm->addr.y;
*ret_addr = frm->addr.y;
} else if (frm->addr.cb == addr) {
*index = 1;
return frm->addr.cb;
*ret_addr = frm->addr.cb;
} else if (frm->addr.cr == addr) {
*index = 2;
return frm->addr.cr;
*ret_addr = frm->addr.cr;
} else {
pr_err("Plane address is wrong");
return -EINVAL;
}
return 0;
}
void gsc_set_prefbuf(struct gsc_dev *gsc, struct gsc_frame *frm)
......@@ -352,9 +353,11 @@ void gsc_set_prefbuf(struct gsc_dev *gsc, struct gsc_frame *frm)
u32 t_min, t_max;
t_min = min3(frm->addr.y, frm->addr.cb, frm->addr.cr);
low_addr = get_plane_info(frm, t_min, &low_plane);
if (get_plane_info(frm, t_min, &low_plane, &low_addr))
return;
t_max = max3(frm->addr.y, frm->addr.cb, frm->addr.cr);
high_addr = get_plane_info(frm, t_max, &high_plane);
if (get_plane_info(frm, t_max, &high_plane, &high_addr))
return;
mid_plane = 3 - (low_plane + high_plane);
if (mid_plane == 0)
......
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