From patchwork Mon Aug 16 16:25:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 4130 Return-path: Envelope-to: mchehab@pedra Delivery-date: Mon, 16 Aug 2010 13:27:30 -0300 Received: from mchehab by pedra with local (Exim 4.72) (envelope-from ) id 1Ol2X3-00043Q-O6 for mchehab@pedra; Mon, 16 Aug 2010 13:27:30 -0300 Received: from bombadil.infradead.org [18.85.46.34] by pedra with IMAP (fetchmail-6.3.17) for (single-drop); Mon, 16 Aug 2010 13:27:29 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1Ol2WC-0002a3-E2; Mon, 16 Aug 2010 16:26:36 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755047Ab0HPQZm (ORCPT + 1 other); Mon, 16 Aug 2010 12:25:42 -0400 Received: from mgw2.diku.dk ([130.225.96.92]:34721 "EHLO mgw2.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754990Ab0HPQZl (ORCPT ); Mon, 16 Aug 2010 12:25:41 -0400 Received: from localhost (localhost [127.0.0.1]) by mgw2.diku.dk (Postfix) with ESMTP id 25D7E19BE5F; Mon, 16 Aug 2010 18:25:40 +0200 (CEST) Received: from mgw2.diku.dk ([127.0.0.1]) by localhost (mgw2.diku.dk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 25053-16; Mon, 16 Aug 2010 18:25:39 +0200 (CEST) Received: from nhugin.diku.dk (nhugin.diku.dk [130.225.96.140]) by mgw2.diku.dk (Postfix) with ESMTP id 3239B19BE21; Mon, 16 Aug 2010 18:25:39 +0200 (CEST) Received: from ask.diku.dk (ask.diku.dk [130.225.96.225]) by nhugin.diku.dk (Postfix) with ESMTP id 99DF26DFD13; Mon, 16 Aug 2010 18:24:12 +0200 (CEST) Received: by ask.diku.dk (Postfix, from userid 3767) id 16FBC200C3; Mon, 16 Aug 2010 18:25:39 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by ask.diku.dk (Postfix) with ESMTP id 11EE0200BD; Mon, 16 Aug 2010 18:25:39 +0200 (CEST) Date: Mon, 16 Aug 2010 18:25:39 +0200 (CEST) From: Julia Lawall To: Mauro Carvalho Chehab , mjpeg-users@lists.sourceforge.net, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 4/16] drivers/media/video/zoran: Use available error codes Message-ID: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Mauro Carvalho Chehab From: Julia Lawall Error codes are stored in res, but the return value is always 0. Return res instead. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r@ local idexpression x; constant C; @@ if (...) { ... x = -C ... when != x ( return <+...x...+>; | return NULL; | return; | * return ...; ) } // Signed-off-by: Julia Lawall --- This changes the semantics and has not been tested. drivers/media/video/zoran/zoran_driver.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/video/zoran/zoran_driver.c b/drivers/media/video/zoran/zoran_driver.c index 6f89d0a..c155ddf 100644 --- a/drivers/media/video/zoran/zoran_driver.c +++ b/drivers/media/video/zoran/zoran_driver.c @@ -3322,7 +3322,7 @@ zoran_mmap (struct file *file, mmap_unlock_and_return: mutex_unlock(&zr->resource_lock); - return 0; + return res; } static const struct v4l2_ioctl_ops zoran_ioctl_ops = {