Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751083AbaKYPTJ (ORCPT ); Tue, 25 Nov 2014 10:19:09 -0500 Received: from mail-wi0-f180.google.com ([209.85.212.180]:35195 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750881AbaKYPTH (ORCPT ); Tue, 25 Nov 2014 10:19:07 -0500 MIME-Version: 1.0 In-Reply-To: <20141125130416.457e48b0@recife.lan> References: <1416308268-22957-1-git-send-email-prabhakar.csengg@gmail.com> <20141125130416.457e48b0@recife.lan> From: Prabhakar Lad Date: Tue, 25 Nov 2014 15:18:34 +0000 Message-ID: Subject: Re: [PATCH] media: exynos-gsc: fix build warning To: Mauro Carvalho Chehab Cc: Kukjin Kim , LMML , linux-samsung-soc , LKML , Sylwester Nawrocki Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mauro, On Tue, Nov 25, 2014 at 3:04 PM, Mauro Carvalho Chehab 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 Acked-by: Lad, Prabhakar 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-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/