From patchwork Sun Sep 23 19:34:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 1495821 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 38A63DFFD0 for ; Sun, 23 Sep 2012 19:34:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754346Ab2IWTeh (ORCPT ); Sun, 23 Sep 2012 15:34:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20846 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754301Ab2IWTef (ORCPT ); Sun, 23 Sep 2012 15:34:35 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q8NJYPcC011092 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 23 Sep 2012 15:34:25 -0400 Received: from [10.97.7.49] (vpn1-7-49.gru2.redhat.com [10.97.7.49]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q8NJYKIg024010 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 23 Sep 2012 15:34:22 -0400 Message-ID: <505F643C.3020203@redhat.com> Date: Sun, 23 Sep 2012 16:34:20 -0300 From: Mauro Carvalho Chehab User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120828 Thunderbird/15.0 MIME-Version: 1.0 To: Guennadi Liakhovetski CC: kernel-janitors@vger.kernel.org, Julia.Lawall@lip6.fr, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Senna Tschudin Subject: Fwd: [PATCH 1/14] drivers/media/platform/soc_camera/soc_camera.c: fix error return code References: <1346945041-26676-13-git-send-email-peter.senna@gmail.com> In-Reply-To: <1346945041-26676-13-git-send-email-peter.senna@gmail.com> X-Enigmail-Version: 1.4.4 X-Forwarded-Message-Id: <1346945041-26676-13-git-send-email-peter.senna@gmail.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Please review. Please review. Regards, Mauro. -------- Mensagem original -------- Assunto: [PATCH 1/14] drivers/media/platform/soc_camera/soc_camera.c: fix error return code Data: Thu, 6 Sep 2012 17:24:00 +0200 De: Peter Senna Tschudin Para: Mauro Carvalho Chehab CC: kernel-janitors@vger.kernel.org, Julia.Lawall@lip6.fr, linux-media@vger.kernel.org, linux-kernel@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/soc_camera/soc_camera.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 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/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c index 10b57f8..a4beb6c 100644 --- a/drivers/media/platform/soc_camera/soc_camera.c +++ b/drivers/media/platform/soc_camera/soc_camera.c @@ -1184,7 +1184,8 @@ static int soc_camera_probe(struct soc_camera_device *icd) sd->grp_id = soc_camera_grp_id(icd); v4l2_set_subdev_hostdata(sd, icd); - if (v4l2_ctrl_add_handler(&icd->ctrl_handler, sd->ctrl_handler)) + ret = v4l2_ctrl_add_handler(&icd->ctrl_handler, sd->ctrl_handler); + if (ret) goto ectrl; /* At this point client .probe() should have run already */