summaryrefslogtreecommitdiff
path: root/lib/intel_reg.h
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2016-08-05 11:20:35 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2016-08-05 15:58:29 +0300
commited29d030bde3d8db592990e9fc87a8c9e29fc829 (patch)
tree96b15c733fcc3b2286bde98f62855dd94d6f6405 /lib/intel_reg.h
parent4c5ed71fa7439bea4121f229a18b897fe0715f5c (diff)
tools/intel_reg: Don't reuse stale decoded results for later registers
In case the ->debug_output() function skips decoding the register it just returns, which means the caller will reuse whatever it already has in the tmp buffer as the decoded result for this result. What it usually has in there is the decoded result of some previous register. Showing incorrect decoded results is no good, so let's allow ->debug_output() to actually return how many bytes it wrote, and the caller can then skip showing the decoded results if zero bytes were produced. We'll make a variant of snprintf() that's safe to call without having to check the return value for the case when it didn't have enough space to do its work, that is, make it return 0 in case no bytes were written. v2: Document the _DEBUGSTRING() funcion (Jani) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'lib/intel_reg.h')
0 files changed, 0 insertions, 0 deletions