diff mbox

intel_th: Show a correct number of masters in debug message

Message ID 1454041497-12382-1-git-send-email-zhang.chunyan@linaro.org
State New
Headers show

Commit Message

Chunyan Zhang Jan. 29, 2016, 4:24 a.m. UTC
Since both sw_start and sw_end are master indices, the number of
software masters should be sw_end - sw_start + 1, which the current
code gets wrong, calculating one less than the actual value.

With this patch, the correct number of masters would be showed in the
debug message.

Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org>

---
 drivers/hwtracing/intel_th/sth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
1.9.1
diff mbox

Patch

diff --git a/drivers/hwtracing/intel_th/sth.c b/drivers/hwtracing/intel_th/sth.c
index 56101c3..28917d7 100644
--- a/drivers/hwtracing/intel_th/sth.c
+++ b/drivers/hwtracing/intel_th/sth.c
@@ -173,7 +173,7 @@  static int intel_th_sw_init(struct sth_device *sth)
 	sth->stm.sw_start = reg & 0xffff;
 	sth->stm.sw_end = reg >> 16;
 
-	sth->sw_nmasters = sth->stm.sw_end - sth->stm.sw_start;
+	sth->sw_nmasters = sth->stm.sw_end - sth->stm.sw_start + 1;
 	dev_dbg(sth->dev, "sw_start: %x sw_end: %x masters: %x nchannels: %x\n",
 		sth->stm.sw_start, sth->stm.sw_end, sth->sw_nmasters,
 		sth->stm.sw_nchannels);