From patchwork Tue Sep 4 16:14:29 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: 1403241 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 4EFCD3FC71 for ; Tue, 4 Sep 2012 16:16:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757313Ab2IDQPp (ORCPT ); Tue, 4 Sep 2012 12:15:45 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:52034 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757379Ab2IDQOx (ORCPT ); Tue, 4 Sep 2012 12:14:53 -0400 Received: by mail-wg0-f44.google.com with SMTP id dr13so5825739wgb.1 for ; Tue, 04 Sep 2012 09:14:52 -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=QtYrAA0n3gD0OIZiNuPFLeAFKkFDoCkJfFfUwXCaGvc=; b=hR8ikiwYHsV51CV8wwF3PQ/3SpQhrSanrnrW5yqkxGdHpnsu7OJspJRAPilao23kWN j4bhDeRcRn8DLpO503uXWV3IxuHBmazmMXWbQuE738Tev9YFnN5KSKSmmxkDuhQxwxh1 Er8I0OGeqmR7zrLlWcHZukYYyRo1hQf0mVIccgBjrkvqEMLRmDFZge/LkwK+CMBCrhqm jGIqnLnbRGwsjjR+7fCio19CX+dKB/C7pA0JTm6mXzxQ97927hdRXn6oZcV11zbKf2lp GV+hjYOQt+wlzNr7r1mwFNLw+vylDVx2WdERpZr2++B5Jd5aUpyqg1sGFtWTPRZlsuaz H22w== Received: by 10.216.195.143 with SMTP id p15mr4902397wen.167.1346775292686; Tue, 04 Sep 2012 09:14:52 -0700 (PDT) Received: from localhost.localdomain ([132.227.100.38]) by mx.google.com with ESMTPS id l6sm24969613wiz.4.2012.09.04.09.14.51 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 04 Sep 2012 09:14:52 -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 1/5] drivers/media/platform/davinci/vpbe.c: fix error return code Date: Tue, 4 Sep 2012 18:14:29 +0200 Message-Id: <1346775269-12191-5-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/vpbe.c | 13 ++++++------- 1 file changed, 6 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/vpbe.c b/drivers/media/platform/davinci/vpbe.c index c4a82a1..2e4a0da 100644 --- a/drivers/media/platform/davinci/vpbe.c +++ b/drivers/media/platform/davinci/vpbe.c @@ -603,7 +603,6 @@ static int vpbe_initialize(struct device *dev, struct vpbe_device *vpbe_dev) int output_index; int num_encoders; int ret = 0; - int err; int i; /* @@ -646,10 +645,10 @@ static int vpbe_initialize(struct device *dev, struct vpbe_device *vpbe_dev) } v4l2_info(&vpbe_dev->v4l2_dev, "vpbe v4l2 device registered\n"); - err = bus_for_each_dev(&platform_bus_type, NULL, vpbe_dev, + ret = bus_for_each_dev(&platform_bus_type, NULL, vpbe_dev, platform_device_get); - if (err < 0) - return err; + if (ret < 0) + return ret; vpbe_dev->venc = venc_sub_dev_init(&vpbe_dev->v4l2_dev, vpbe_dev->cfg->venc.module_name); @@ -664,11 +663,11 @@ static int vpbe_initialize(struct device *dev, struct vpbe_device *vpbe_dev) osd_device = vpbe_dev->osd_device; if (NULL != osd_device->ops.initialize) { - err = osd_device->ops.initialize(osd_device); - if (err) { + ret = osd_device->ops.initialize(osd_device); + if (ret) { v4l2_err(&vpbe_dev->v4l2_dev, "unable to initialize the OSD device"); - err = -ENOMEM; + ret = -ENOMEM; goto vpbe_fail_v4l2_device; } }