From b284f7b4223ac837735e4cf6f6eec498e124295a Mon Sep 17 00:00:00 2001
From: Diego Celix <dcelix@gmail.com>
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(-)
@@ -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