From patchwork Thu Sep 6 15:23:50 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: 1416061 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 4C5763FC71 for ; Thu, 6 Sep 2012 15:28:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757806Ab2IFP14 (ORCPT ); Thu, 6 Sep 2012 11:27:56 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:52253 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757624Ab2IFPYO (ORCPT ); Thu, 6 Sep 2012 11:24:14 -0400 Received: by weyx8 with SMTP id x8so1173024wey.19 for ; Thu, 06 Sep 2012 08:24:13 -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=PBEcV2i9YXYakdVf9c8r6MjjdtmTRnTfOs4eDf3IHx0=; b=wv4o3KWBMQXljdCVoxvDcD4yFwBinVlxQO4Nv4rq2LfPvDZ6mDkEaF7/Tqpno4+HcN HVkkfsvQLCy7rg/zZSidMc+7fWWy5SUN+ysKenNu+QvZLJH8lgxpBqOI8p6BMvg/poHp /0+8YS15eB3bXmLEkunZsn85eKnN/GoJ8xnDU74fy8j+x9LHlWIGs0yKnCPnTcnofGSd BXtXzDgDcw650H4Vsx/ZUfq7zWJihOYQX5e1yNHx4rJL6PU+kDSJEHJ/6rWAD09fp0UQ agu9xWsRZaYNPEn/4lg7BFGHy+qtcmgBH+Zf8ZRAKxgI9XM8zWwPNoKS9jzpn4L+wE8v YllA== Received: by 10.180.74.33 with SMTP id q1mr46539681wiv.4.1346945053084; Thu, 06 Sep 2012 08:24:13 -0700 (PDT) Received: from localhost.localdomain ([132.227.100.38]) by mx.google.com with ESMTPS id el6sm4572331wib.8.2012.09.06.08.24.12 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 06 Sep 2012 08:24:12 -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 11/14] drivers/media/usb/stk1160/stk1160-i2c.c: fix error return code Date: Thu, 6 Sep 2012 17:23:50 +0200 Message-Id: <1346945041-26676-3-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 Acked-by: Ezequiel Garcia --- drivers/media/usb/stk1160/stk1160-i2c.c | 2 +- 1 file changed, 1 insertion(+), 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/usb/stk1160/stk1160-i2c.c b/drivers/media/usb/stk1160/stk1160-i2c.c index 176ac93..850cf28 100644 --- a/drivers/media/usb/stk1160/stk1160-i2c.c +++ b/drivers/media/usb/stk1160/stk1160-i2c.c @@ -116,7 +116,7 @@ static int stk1160_i2c_read_reg(struct stk1160 *dev, u8 addr, if (rc < 0) return rc; - stk1160_read_reg(dev, STK1160_SBUSR_RD, value); + rc = stk1160_read_reg(dev, STK1160_SBUSR_RD, value); if (rc < 0) return rc;