From patchwork Tue Sep 18 12:07:55 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: 1472431 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 DB2303FCFC for ; Tue, 18 Sep 2012 12:10:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932868Ab2IRMJt (ORCPT ); Tue, 18 Sep 2012 08:09:49 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:34299 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932505Ab2IRMIO (ORCPT ); Tue, 18 Sep 2012 08:08:14 -0400 Received: by weyx8 with SMTP id x8so4513036wey.19 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=+HMX19r0wzH0UKHBn03NRqLughTs/mUKCPj+vWqDqLA=; b=efhrXIaJv3idooN9xJFvPp3dzNDYYBmE1+38g+o8g0mcxAjySxOpxdboEEwe2yXtGf OCC9cycP1bUlG01v7jpf0z0jYFtGB1t2HfUjks9O+qFLPqklsw1wP1ExPG3Bys3ud4yF dL1W9mEfuqO0TEnrDyg2YVji6SSeBn9ggsL9CXKhEnkQ/qvy3V3Ped0QLgET/wr81c5x lrTH7VfI1oSET4OfgYwvIPdhqMYMRG8xLClvZoU6t+n9B6QLgFvpsMB2Nh+F+V2O0IXC JbZeyy0RX0djytq281W0LSmntp1n6vGP/oLm2hGMB4jpCG37w9t3aJgQReLGkEezpCwc y3Mw== Received: by 10.216.214.209 with SMTP id c59mr7604355wep.214.1347970093048; 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.12 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 18 Sep 2012 05:08:12 -0700 (PDT) From: Peter Senna Tschudin To: nicolas.ferre@atmel.com Cc: FlorianSchandinat@gmx.de, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Peter Senna Tschudin Subject: [PATCH 05/10] drivers/video/atmel_lcdfb.c: fix error return code Date: Tue, 18 Sep 2012 14:07:55 +0200 Message-Id: <1347970080-25175-5-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/atmel_lcdfb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index 1505539..94cac9f 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c @@ -931,8 +931,10 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) } info->screen_base = ioremap(info->fix.smem_start, info->fix.smem_len); - if (!info->screen_base) + if (!info->screen_base) { + ret = -ENOMEM; goto release_intmem; + } /* * Don't clear the framebuffer -- someone may have set @@ -960,6 +962,7 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) sinfo->mmio = ioremap(info->fix.mmio_start, info->fix.mmio_len); if (!sinfo->mmio) { dev_err(dev, "cannot map LCDC registers\n"); + ret = -ENOMEM; goto release_mem; }