From patchwork Tue Sep 4 12:05:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Senna Tschudin X-Patchwork-Id: 1401971 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id EB92CDF280 for ; Tue, 4 Sep 2012 12:11:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756897Ab2IDMLD (ORCPT ); Tue, 4 Sep 2012 08:11:03 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:34012 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756869Ab2IDMLA (ORCPT ); Tue, 4 Sep 2012 08:11:00 -0400 Received: by wibhq12 with SMTP id hq12so4186251wib.1 for ; Tue, 04 Sep 2012 05:10:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=4It4R5rLCUzpE6DcngVtq4uk5kaWvV/HSt4/WQBwq+A=; b=m4xETOp5pOvz8go3Tw0kLRFLbn1Vidtp/3wQr5j1ojwlNjjaXWe1Uks7BvWZ8cPc44 FgGomEBwZKADBhxQrNN8pyG2VpnLVsRvt3Ru8iBJKSenKmJ05aL5ClHV/LD12BvNfaXx 3qevta2n7S1KaYMdabRd/BMAMauvgqrTEDvdIJpNZwS8aBZolU/TNF18h3WqR/rSm+Mu GbYfYs4n+OSbDqrjLqCuzaesdmPELPNue47OtpKriSPcV2D6tlE7SNrnj84upPJzX+wE HUmOt5cSZdUrL9ZJsdkOZDxSkKW+95f1JJkA9yjXaJfCS/WdO+1gshegz/Ex2z8Ar22Z bUww== Received: by 10.180.86.106 with SMTP id o10mr30321683wiz.22.1346760324807; Tue, 04 Sep 2012 05:05:24 -0700 (PDT) Received: from localhost.localdomain ([132.227.100.38]) by mx.google.com with ESMTPS id fp3sm24128310wib.7.2012.09.04.05.05.23 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 04 Sep 2012 05:05:23 -0700 (PDT) From: Peter Senna Tschudin To: Mauro Carvalho Chehab Cc: kernel-janitors@vger.kernel.org, Julia.Lawall@lip6.fr, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] drivers/media/platform/davinci/vpfe_capture.c: fix error return code Date: Tue, 4 Sep 2012 14:05:03 +0200 Message-Id: <1346760305-13060-1-git-send-email-peter.senna@gmail.com> X-Mailer: git-send-email 1.7.11.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Peter Senna Tschudin Convert a nonnegative error return code to a negative one, as returned elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // Signed-off-by: Peter Senna Tschudin --- drivers/media/platform/davinci/vpfe_capture.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-media" 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/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c index 843b138..f99198c 100644 --- a/drivers/media/platform/davinci/vpfe_capture.c +++ b/drivers/media/platform/davinci/vpfe_capture.c @@ -1131,11 +1131,11 @@ static int vpfe_s_input(struct file *file, void *priv, unsigned int index) ret = -EBUSY; goto unlock_out; } - - if (vpfe_get_subdev_input_index(vpfe_dev, - &subdev_index, - &inp_index, - index) < 0) { + ret = vpfe_get_subdev_input_index(vpfe_dev, + &subdev_index, + &inp_index, + index); + if (ret < 0) { v4l2_err(&vpfe_dev->v4l2_dev, "invalid input index\n"); goto unlock_out; } @@ -1748,8 +1748,9 @@ static long vpfe_param_handler(struct file *file, void *priv, "Error setting parameters in CCDC\n"); goto unlock_out; } - if (vpfe_get_ccdc_image_format(vpfe_dev, - &vpfe_dev->fmt) < 0) { + ret = vpfe_get_ccdc_image_format(vpfe_dev, + &vpfe_dev->fmt); + if (ret < 0) { v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "Invalid image format at CCDC\n"); goto unlock_out;