From patchwork Tue Sep 18 12:07:56 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: 1472451 Return-Path: X-Original-To: patchwork-linux-fbdev@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 DA8B5DFFFF for ; Tue, 18 Sep 2012 12:10:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757190Ab2IRMJs (ORCPT ); Tue, 18 Sep 2012 08:09:48 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:33307 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932509Ab2IRMIO (ORCPT ); Tue, 18 Sep 2012 08:08:14 -0400 Received: by mail-wi0-f172.google.com with SMTP id hi8so4064369wib.1 for ; Tue, 18 Sep 2012 05:08: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:in-reply-to:references; bh=52TfmqAA8br6+Xg82oCE5e5X0JFGyVbEP7JgEMriw+Q=; b=oGbWkVyrDkpDeNZVGiqJW3gH0iNhdeIPShFBCj9a+n2euU8Fm29J437peDS+iC9LVh Fmf+v16KlW5EGTfHT8lbSZphqykXyHKPN/Xh0WIBaB+BgXjHjPa+R4OqcLPGbcVhgYlc AgEGDzLD+JsCZ+TJIVosCEh4NGZjnRF2BUlrzlxITtMCf5d6T7Z6Pgu0uPxQGBHsGunB JAEPSiwRPPGIpFn7sM8PE0YIONG1xai1Bp/MaxLyxhGw/lzkOOmpHMlswGAkuXmQLIRf UmkakgqOiYXuLpQODh6zlMvztVwCtsUHo/aND3BlX0AYOXpdvN2Pfdkh+qJzLFlpyCI/ qdqQ== Received: by 10.180.107.163 with SMTP id hd3mr22886360wib.19.1347970093710; Tue, 18 Sep 2012 05:08:13 -0700 (PDT) Received: from ace.home.fr (ppeter.rsr.lip6.fr. [132.227.76.16]) by mx.google.com with ESMTPS id eu4sm22494251wib.2.2012.09.18.05.08.13 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 18 Sep 2012 05:08:13 -0700 (PDT) From: Peter Senna Tschudin To: kernel@pengutronix.de Cc: FlorianSchandinat@gmx.de, linux-fbdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Peter Senna Tschudin Subject: [PATCH 06/10] drivers/video/imxfb.c: fix error return code Date: Tue, 18 Sep 2012 14:07:56 +0200 Message-Id: <1347970080-25175-6-git-send-email-peter.senna@gmail.com> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1347970080-25175-1-git-send-email-peter.senna@gmail.com> References: <1347970080-25175-1-git-send-email-peter.senna@gmail.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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/video/imxfb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c index caad368..469b07c 100644 --- a/drivers/video/imxfb.c +++ b/drivers/video/imxfb.c @@ -803,6 +803,7 @@ static int __init imxfb_probe(struct platform_device *pdev) fbi->regs = ioremap(res->start, resource_size(res)); if (fbi->regs == NULL) { dev_err(&pdev->dev, "Cannot map frame buffer registers\n"); + ret = -ENOMEM; goto failed_ioremap; }