From patchwork Thu Feb 10 10:34:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Celix X-Patchwork-Id: 545991 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 p1AAYscp012656 for ; Thu, 10 Feb 2011 10:35:15 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4ECB29E887 for ; Thu, 10 Feb 2011 02:34:49 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ey0-f177.google.com (mail-ey0-f177.google.com [209.85.215.177]) by gabe.freedesktop.org (Postfix) with ESMTP id D16259E78A for ; Thu, 10 Feb 2011 02:34:16 -0800 (PST) Received: by eyd9 with SMTP id 9so585470eyd.36 for ; Thu, 10 Feb 2011 02:34:15 -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:cc:content-type; bh=n/jbYYcgt0IlPz+UAhcooHWvuelXfpGpeM8GVNOK62U=; b=BE/Auf+1J1sJDA1doI2Y6J4iirfSAABiItuC5hWUctAXtWJ16OhaMMcBcO6BZdEXj1 vW0bML6Av0b9ZDrY/gCmJWL2XEPQsJP1lcWPYMLhGw/Kklwt0IkDyLW5wxps8pKxqEl7 fLrrmg+yAuvGyXenVgd57ZxHy5CmUmyp5Fy2Q= 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 :cc:content-type; b=Z88fY8Sk8Uu75iLFDCsa9y/sIUg+IlmRdtRTaZYqI5c/D4jQLgAtg1eUX1QG9pIpZS 4MWY6slhCmVce+BwDsoqaLTiNTrhwc20jx2VdguksALRHT5dLhU37kWdAdTDbopoIPij e0ZqxRXszlZWUBeT37mc0Ssao9qxaZCYycObg= MIME-Version: 1.0 Received: by 10.213.29.77 with SMTP id p13mr3466849ebc.2.1297334055525; Thu, 10 Feb 2011 02:34:15 -0800 (PST) Received: by 10.213.25.145 with HTTP; Thu, 10 Feb 2011 02:34:15 -0800 (PST) In-Reply-To: <20110209213424.GT20496@radis.liafa.jussieu.fr> References: <20110209213424.GT20496@radis.liafa.jussieu.fr> Date: Thu, 10 Feb 2011 10:34:15 +0000 Message-ID: From: Diego Celix To: Julien Cristau Cc: intel-gfx@lists.freedesktop.org Subject: Re: [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]); Thu, 10 Feb 2011 10:35:28 +0000 (UTC) From 46bb97f04cfce10a1c8ca00ed0bc423f2fb7ed41 Mon Sep 17 00:00:00 2001 From: Diego Celix Date: Thu, 10 Feb 2011 10:07:34 +0000 Subject: [PATCH] intel_reg_dumper: if-else fix in i830_debug_fp function This commit adds a change in the i830_debug_fp function. In this function the result value of asprintf seems to be always overwritten even if the if condition is satisfied. Also, this commit fixes the next compile warnings: intel_reg_dumper.c:279: warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result intel_reg_dumper.c:286: warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result --- 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 3f26179..c20e95e 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