From patchwork Thu Sep 6 15:23:52 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: 1416001 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 49C543FC71 for ; Thu, 6 Sep 2012 15:27:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758464Ab2IFP1K (ORCPT ); Thu, 6 Sep 2012 11:27:10 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:62287 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752895Ab2IFPYP (ORCPT ); Thu, 6 Sep 2012 11:24:15 -0400 Received: by wibhr14 with SMTP id hr14so1620808wib.1 for ; Thu, 06 Sep 2012 08:24:14 -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=I9dzI1Um1E9yljjzbDyFLjsevjVpPVgASIWCQ/TL388=; b=kH0YdenXtx4tWSpY37p3FaPoZ2aGoXvIV0vVktXytZXL/3YAFjJyfdnrmCEV6uCs+j 3d4zrhZ2rpBxJlSw7E9vA4o+qxT3bYKQlGAysH4ymTjdFszrmH+kukekfFcHXflylxav o+GdCqpH+nfEynwmwjgdMVuP7j693XgNbTuKSR4+vvJN4YA4q5wWLlC9oyjVSVXBzCGK ouBpGWpiQDmI8FaY67iPNwjB3ffdIMuGOhElHSfLeFiu+3hCLKLWh+wv6RH+vk6obdsk 6fBCnhGyOmVyKqfat2h8l6jq1QWNqGGQnVxKloDQn1sfV2ll8VxTGItateSSU+vDBhz/ Sd0A== Received: by 10.180.103.4 with SMTP id fs4mr5590722wib.16.1346945054264; Thu, 06 Sep 2012 08:24:14 -0700 (PDT) Received: from localhost.localdomain ([132.227.100.38]) by mx.google.com with ESMTPS id el6sm4572331wib.8.2012.09.06.08.24.13 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 06 Sep 2012 08:24:13 -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 9/14] drivers/media/radio/radio-cadet.c: fix error return code Date: Thu, 6 Sep 2012 17:23:52 +0200 Message-Id: <1346945041-26676-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/radio/radio-cadet.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/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c index 697a421..643d80a 100644 --- a/drivers/media/radio/radio-cadet.c +++ b/drivers/media/radio/radio-cadet.c @@ -645,7 +645,8 @@ static int __init cadet_init(void) set_bit(V4L2_FL_USE_FH_PRIO, &dev->vdev.flags); video_set_drvdata(&dev->vdev, dev); - if (video_register_device(&dev->vdev, VFL_TYPE_RADIO, radio_nr) < 0) + res = video_register_device(&dev->vdev, VFL_TYPE_RADIO, radio_nr); + if (res < 0) goto err_hdl; v4l2_info(v4l2_dev, "ADS Cadet Radio Card at 0x%x\n", dev->io); return 0;