From patchwork Tue Sep 18 12:07:52 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: 1472441 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 BFECEDF24C for ; Tue, 18 Sep 2012 12:10:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932591Ab2IRMIO (ORCPT ); Tue, 18 Sep 2012 08:08:14 -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 S1757361Ab2IRMIM (ORCPT ); Tue, 18 Sep 2012 08:08:12 -0400 Received: by wibhi8 with SMTP id hi8so4064369wib.1 for ; Tue, 18 Sep 2012 05:08:10 -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=lU+cr4Nr9v7wtpm0QMhv/4KB8y0DHIN4PLdBMjloMkI=; b=fRnjFPhNUQvOh4ke094DUp26gxy+CWpiUqv2fNKxV53lL1jrZbJ/mxcMzd7OIyhVeo n9zCu53OO/EGGIAyYH9ocGtsVjx/T/LPtnIZ3KiLWEbiB4UNE/fJFwFkAOFIsHapCKpE RB43ks8gstruiwmJW2IOo63QZMUzd7+JFm9T/KKr5LXjBIx3v4WzsdvmYsmCPyIcCq2L JAS8CTBaa++tU7Z5vsene9xVClpGjUYUFK54G+jApTV3nUSRFgorCJJRrgVjfcx9h3cV BuX0uIQOvVxW341J0hmBAAAuP2My+JegNHFWkelJb7H6oHBe2glU/O3JseiRgyXZ4nF+ MkZg== Received: by 10.180.96.3 with SMTP id do3mr22972493wib.5.1347970090779; Tue, 18 Sep 2012 05:08:10 -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.09 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 18 Sep 2012 05:08:10 -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 02/10] drivers/video/sunxvr1000.c: fix error return code Date: Tue, 18 Sep 2012 14:07:52 +0200 Message-Id: <1347970080-25175-2-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/sunxvr1000.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/video/sunxvr1000.c b/drivers/video/sunxvr1000.c index b7f27ac..729a507 100644 --- a/drivers/video/sunxvr1000.c +++ b/drivers/video/sunxvr1000.c @@ -141,8 +141,10 @@ static int __devinit gfb_probe(struct platform_device *op) gp->fb_base = of_ioremap(&op->resource[6], 0, gp->fb_size, "gfb fb"); - if (!gp->fb_base) + if (!gp->fb_base) { + err = -ENOMEM; goto err_release_fb; + } err = gfb_set_fbinfo(gp); if (err)