From patchwork Thu Sep 6 15:24:01 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: 1415841 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 C914AE00A6 for ; Thu, 6 Sep 2012 15:24:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758161Ab2IFPYd (ORCPT ); Thu, 6 Sep 2012 11:24:33 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:62616 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757834Ab2IFPYV (ORCPT ); Thu, 6 Sep 2012 11:24:21 -0400 Received: by mail-wg0-f44.google.com with SMTP id dr13so1754217wgb.1 for ; Thu, 06 Sep 2012 08:24:20 -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=QhHhDMBDU7zl2w7WempVgpbx81EO22H35blz/qWRwK4=; b=Eu7PV02s6fCL8bO/jybDVbF+gVg7ie6FghP86ZFrcFzacJR/pBbSVefpY77lGVtdxA yB7LGGY/iK/UZjJSdONcN3UD217aJfKwCqlyuJ8NxB8Jp/ebUV0EaUNt+fKBpnQ+Zcmh xokl/GxoM3rz61Xu0XxoHlKgaqgKwTrDHXReVNXZdi3beFB+G+4dDqcDdSeCTRgnSemc MvW1yvvI7O7sFXH+/3dcZg9QALVSmBJsiKG//vjOg8LW3LZzUQ/Kx2z6qAke9SYe3nBR /+Fn5QTQX6nAlSDIyNz8n6PWAnH6fjFNeVY2p9pVHfDAek5Y3NKzXzde7ogd7jCc+e5d MxAg== Received: by 10.217.2.146 with SMTP id p18mr1442871wes.198.1346945060446; Thu, 06 Sep 2012 08:24:20 -0700 (PDT) Received: from localhost.localdomain ([132.227.100.38]) by mx.google.com with ESMTPS id el6sm4572331wib.8.2012.09.06.08.24.19 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 06 Sep 2012 08:24:20 -0700 (PDT) From: Peter Senna Tschudin To: Hans de Goede Cc: kernel-janitors@vger.kernel.org, Julia.Lawall@lip6.fr, Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 14/14] drivers/media/usb/gspca/cpia1.c: fix error return code Date: Thu, 6 Sep 2012 17:24:01 +0200 Message-Id: <1346945041-26676-14-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/usb/gspca/cpia1.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/gspca/cpia1.c b/drivers/media/usb/gspca/cpia1.c index 2499a88..b3ba47d 100644 --- a/drivers/media/usb/gspca/cpia1.c +++ b/drivers/media/usb/gspca/cpia1.c @@ -751,7 +751,7 @@ static int goto_high_power(struct gspca_dev *gspca_dev) if (signal_pending(current)) return -EINTR; - do_command(gspca_dev, CPIA_COMMAND_GetCameraStatus, 0, 0, 0, 0); + ret = do_command(gspca_dev, CPIA_COMMAND_GetCameraStatus, 0, 0, 0, 0); if (ret) return ret;