Message ID | 20141125130416.457e48b0@recife.lan (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
Hi Mauro, On Tue, Nov 25, 2014 at 3:04 PM, Mauro Carvalho Chehab <mchehab@osg.samsung.com> wrote: > Em Tue, 18 Nov 2014 10:57:48 +0000 [Snip] > > -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; the control wont reach here! may be you can remove the complete else part outside ? with that change, Reported-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Thanks, --Prabhakar Lad > } > > 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) -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi, On Tue, Nov 25, 2014 at 3:18 PM, Prabhakar Lad <prabhakar.csengg@gmail.com> wrote: > Hi Mauro, > > On Tue, Nov 25, 2014 at 3:04 PM, Mauro Carvalho Chehab > <mchehab@osg.samsung.com> wrote: >> Em Tue, 18 Nov 2014 10:57:48 +0000 > [Snip] >> >> -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; > the control wont reach here! may be you can remove the complete else > part outside ? > Ah my bad :(, I missread 'ret_addr' to return. Thanks, --Prabhakar Lad > with that change, > > Reported-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> > Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> > > Thanks, > --Prabhakar Lad > >> } >> >> 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) -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c index 91d226b8fe5c..3062e9fac6da 100644 --- a/drivers/media/platform/exynos-gsc/gsc-core.c +++ b/drivers/media/platform/exynos-gsc/gsc-core.c @@ -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)