From patchwork Tue Sep 18 12:07:57 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: 1472401 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 861A4DF24C for ; Tue, 18 Sep 2012 12:09:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932856Ab2IRMJT (ORCPT ); Tue, 18 Sep 2012 08:09:19 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:63124 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932644Ab2IRMIP (ORCPT ); Tue, 18 Sep 2012 08:08:15 -0400 Received: by wibhq12 with SMTP id hq12so5489817wib.1 for ; Tue, 18 Sep 2012 05:08: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:in-reply-to:references; bh=d562aji2tKX7hzrHM0i3EHGeUk5EuhUF7XDuaEB7org=; b=sC+q9evep+0WcEN2dC4P5Uk1/hfLtlhtsS59eWEsGBe98adPCq6INLOK043XYLXWyN /9jViSfjXciopZbKN2UXSVRH3WHhd2J4HvjCkgXAUZ6Xph8ar0i0L7qcoCg7f3XbyMPI 9/BM8GyH08trpUaH5Q2FubKMNgbSc2wcAdB2zCtgNFQI6/u2VI6GFMfeScq3DSDtE1Tn 1e5f0bR4sVcWjstwtrgflsjsdB3oLizmcZIzoOmbw2tVDeWEoZ1u36jkwMApe1/eqDgb B1Of9vpSuF9gTmJRCn7uEURbFS8vu9sduBp41h00d7gW5V0sgrUbs+ZERmIaJQKZvF5g cwJg== Received: by 10.216.218.201 with SMTP id k51mr8338554wep.145.1347970094313; Tue, 18 Sep 2012 05:08:14 -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: FlorianSchandinat@gmx.de Cc: linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Peter Senna Tschudin Subject: [PATCH 07/10] drivers/video/bw2.c: fix error return code Date: Tue, 18 Sep 2012 14:07:57 +0200 Message-Id: <1347970080-25175-7-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/bw2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/video/bw2.c b/drivers/video/bw2.c index 7ba74cd..6bea9a9 100644 --- a/drivers/video/bw2.c +++ b/drivers/video/bw2.c @@ -319,8 +319,10 @@ static int __devinit bw2_probe(struct platform_device *op) info->screen_base = of_ioremap(&op->resource[0], 0, info->fix.smem_len, "bw2 ram"); - if (!info->screen_base) + if (!info->screen_base) { + err = -ENOMEM; goto out_unmap_regs; + } bw2_blank(FB_BLANK_UNBLANK, info);