From patchwork Tue Sep 18 12:07:54 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: 1472471 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id A0AF73FCFC for ; Tue, 18 Sep 2012 12:11:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932505Ab2IRMKf (ORCPT ); Tue, 18 Sep 2012 08:10:35 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:60548 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757439Ab2IRMIO (ORCPT ); Tue, 18 Sep 2012 08:08:14 -0400 Received: by wgbdr13 with SMTP id dr13so6782462wgb.1 for ; Tue, 18 Sep 2012 05:08:12 -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=0OXdYG7jGDbK6n/HGY1kY+YFKa92Lt/86g01xUoQtfc=; b=XeOoQkbgn0zqgpqaCBPQvDvbdO7BSdV4R+1pg8xbFXCjl2MtzmHFRcxp9K7WtWd+P4 NuX0YfpoetoMqJWIgD2cEtbXataPbYTN/XMbdJPYr9RuwdJc0GnMjEAJbVPxhLCIyiiH WIokElUeuUyiX4fNGo3co3Sf5i9aIoWtgtKzN59+TdRlNXkwvWxME02oy2WwVKVIU3lm bAJDhWUTSfqJ7+/XIzurgyxMtEz1hWb9B6jgqwvO3AA7lfZbmROrUwu/MbdVKMZ9UNso msT4BR41IgSEs2rU6jbYGc3zkLi97fMUhoTjCZZz1T8FcElp6Igj3/02nWzEVJfWUwdN C6/g== Received: by 10.180.78.40 with SMTP id y8mr22944993wiw.7.1347970092298; Tue, 18 Sep 2012 05:08:12 -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.11 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 18 Sep 2012 05:08:11 -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 04/10] drivers/video/sunxvr500.c: fix error return code Date: Tue, 18 Sep 2012 14:07:54 +0200 Message-Id: <1347970080-25175-4-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/sunxvr500.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/video/sunxvr500.c b/drivers/video/sunxvr500.c index eb931b8..6c71b1b 100644 --- a/drivers/video/sunxvr500.c +++ b/drivers/video/sunxvr500.c @@ -298,8 +298,10 @@ static int __devinit e3d_pci_register(struct pci_dev *pdev, goto err_release_fb; } ep->ramdac = ioremap(ep->regs_base_phys + 0x8000, 0x1000); - if (!ep->ramdac) + if (!ep->ramdac) { + err = -ENOMEM; goto err_release_pci1; + } ep->fb8_0_off = readl(ep->ramdac + RAMDAC_VID_8FB_0); ep->fb8_0_off -= ep->fb_base_reg; @@ -343,8 +345,10 @@ static int __devinit e3d_pci_register(struct pci_dev *pdev, ep->fb_size = info->fix.line_length * ep->height; ep->fb_base = ioremap(ep->fb_base_phys, ep->fb_size); - if (!ep->fb_base) + if (!ep->fb_base) { + err = -ENOMEM; goto err_release_pci0; + } err = e3d_set_fbinfo(ep); if (err)