From patchwork Wed Feb 9 18:00:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Celix X-Patchwork-Id: 544581 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p19I1MdT012919 for ; Wed, 9 Feb 2011 18:01:43 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 10C0E9E9B7 for ; Wed, 9 Feb 2011 10:01:22 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ew0-f49.google.com (mail-ew0-f49.google.com [209.85.215.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 718AD9E7D7 for ; Wed, 9 Feb 2011 10:00:35 -0800 (PST) Received: by ewy20 with SMTP id 20so279393ewy.36 for ; Wed, 09 Feb 2011 10:00:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=C2D1oksMSJQHwKu37BbZX70DUy6azP6yPpTvjR/FFRM=; b=SFGWOTsngzI2Ql/p4V9nY94wZ7tu/mowlRzmZ5TXUDE6O2NAatVYQqW0bRzPdtAgOP NhwBdoBQStofAimCNkDgvQIka2m0xN0Q0DcTIIIg+Xf0jo4txeavKDStBEbbW3fOaTzD XNiIrFLi7ImSb3JvCwkYJorlGngMwcSXQDX2g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=cGEvRNGhiS1C/yURFwgRKp8u6G44d4VMcwAs74MFvR0HE3qaqoEnJw76Q3Jp58hABA 6BscfefNXIPLiVHzuT/T27s6PEHPJ1v1hd9/bfLwRwE2L4plxcbgAL1lgYWk1Edl06gq M0SEYG1Qz6EKQIPZXPztqhxbYhBjXW3KRuR/A= MIME-Version: 1.0 Received: by 10.213.35.3 with SMTP id n3mr2206533ebd.36.1297274434375; Wed, 09 Feb 2011 10:00:34 -0800 (PST) Received: by 10.213.28.146 with HTTP; Wed, 9 Feb 2011 10:00:34 -0800 (PST) In-Reply-To: References: Date: Wed, 9 Feb 2011 18:00:34 +0000 Message-ID: From: Diego Celix To: intel-gfx@lists.freedesktop.org Subject: [Intel-gfx] [intel-gfx][intel-gpu-tools][patch] Review of some patches to get rid of some compile warnings X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 09 Feb 2011 18:01:43 +0000 (UTC) From b284f7b4223ac837735e4cf6f6eec498e124295a Mon Sep 17 00:00:00 2001 From: Diego Celix Date: Wed, 9 Feb 2011 13:42:55 +0000 Subject: [PATCH] intel_reg_dumper: if:else fix in i830_debug_fp funcion --- tools/intel_reg_dumper.c | 26 ++++++++++++++++---------- 1 files changed, 16 insertions(+), 10 deletions(-) diff --git a/tools/intel_reg_dumper.c b/tools/intel_reg_dumper.c index ccd991f..ec3d5b4 100644 --- a/tools/intel_reg_dumper.c +++ b/tools/intel_reg_dumper.c @@ -332,18 +332,24 @@ DEBUGSTRING(i830_debug_vgacntrl) DEBUGSTRING(i830_debug_fp) { + int ret; if (IS_IGD(devid)) { - asprintf(result, "n = %d, m1 = %d, m2 = %d", - ffs((val & FP_N_IGD_DIV_MASK) >> - FP_N_DIV_SHIFT) - 1, - ((val & FP_M1_DIV_MASK) >> FP_M1_DIV_SHIFT), - ((val & FP_M2_IGD_DIV_MASK) >> - FP_M2_DIV_SHIFT)); - } - asprintf(result, "n = %d, m1 = %d, m2 = %d", - ((val & FP_N_DIV_MASK) >> FP_N_DIV_SHIFT), - ((val & FP_M1_DIV_MASK) >> FP_M1_DIV_SHIFT), - ((val & FP_M2_DIV_MASK) >> FP_M2_DIV_SHIFT)); + ret = asprintf(result, "n = %d, m1 = %d, m2 = %d", + ffs((val & FP_N_IGD_DIV_MASK) >> + FP_N_DIV_SHIFT) - 1, + ((val & FP_M1_DIV_MASK) >> FP_M1_DIV_SHIFT), + ((val & FP_M2_IGD_DIV_MASK) >> + FP_M2_DIV_SHIFT)); + } else { + ret = asprintf(result, "n = %d, m1 = %d, m2 = %d", + ((val & FP_N_DIV_MASK) >> FP_N_DIV_SHIFT), + ((val & FP_M1_DIV_MASK) >> FP_M1_DIV_SHIFT), + ((val & FP_M2_DIV_MASK) >> FP_M2_DIV_SHIFT)); + } + if (ret == -1) { + fprintf (stderr, ASPRINTF_ERROR); + exit (1); + } } DEBUGSTRING(i830_debug_vga_pd) -- 1.7.3.4