From patchwork Tue Sep 18 12:07:53 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: 1472521 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 34DEEDF24C for ; Tue, 18 Sep 2012 12:12:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932893Ab2IRMLa (ORCPT ); Tue, 18 Sep 2012 08:11:30 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:58280 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757403Ab2IRMIN (ORCPT ); Tue, 18 Sep 2012 08:08:13 -0400 Received: by weyx8 with SMTP id x8so4513019wey.19 for ; Tue, 18 Sep 2012 05:08:11 -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=GK0KFEhaS9KfpszpI6MPdQv3Dc4FDmeB2krIQ20uXuM=; b=C2qk63nyiBEKhTk2Ief+6AVwM9KWoKdJtppr0qd41WMlkg8cf6faGDibEP2ax9dYFC Y9b/IisDdd2yaAAPbxdfcQcbCLmES5HWNiPn8Ow1/or5vIzAVHiU8JsGpzeIxAZy8l/i rhcr2lWpPvETGRBkNoeg5EiIQpC46xLtFE7pVS3qPhu8G/Dbas0dxtCQJNkDNHzYovgj KTBsYb/f29Fj0AUJUQa9UAo9IxxMNL9+wpEJTlNuSx/cbx9n2BMQB1461Dd+bojXUqeb 8QYG+0Rjo7XIGWyCeU3D8hRfsnkZtKyDrigE3nMPIzXjTZf/ZBvw1Yxi6dfOu/LGR21G OPeQ== Received: by 10.216.30.136 with SMTP id k8mr8204187wea.103.1347970091552; Tue, 18 Sep 2012 05:08:11 -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.10 (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 03/10] drivers/video/cg3.c: fix error return code Date: Tue, 18 Sep 2012 14:07:53 +0200 Message-Id: <1347970080-25175-3-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/cg3.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/video/cg3.c b/drivers/video/cg3.c index f927a7b..c5e7612 100644 --- a/drivers/video/cg3.c +++ b/drivers/video/cg3.c @@ -398,7 +398,8 @@ static int __devinit cg3_probe(struct platform_device *op) goto out_unmap_screen; } - if (fb_alloc_cmap(&info->cmap, 256, 0)) + err = fb_alloc_cmap(&info->cmap, 256, 0); + if (err) goto out_unmap_screen; fb_set_cmap(&info->cmap, info);