From 3469f66f63464439245b17a8a92dfc50bae167d4 Mon Sep 17 00:00:00 2001 From: Albert Cano Date: Mon, 30 Jul 2018 15:34:40 +0100 Subject: [PATCH] [9610] wlbt: Fixed number of entries computed in small banks Incorrect indexing when computing the number of entries in small banks. Also fixed misleading logging message Change-Id: I9ebd7e63cc184a361e7fb74f1693173a0471f342 SCSC-Bug-Id: SSB-42388 Signed-off-by: Albert Cano --- drivers/misc/samsung/scsc/mifsmapper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/samsung/scsc/mifsmapper.c b/drivers/misc/samsung/scsc/mifsmapper.c index 924459c3c688..954d67f8b0dd 100644 --- a/drivers/misc/samsung/scsc/mifsmapper.c +++ b/drivers/misc/samsung/scsc/mifsmapper.c @@ -143,7 +143,7 @@ int mifsmapper_alloc_bank(struct mifsmapper *smapper, bool large_bank, u32 entry /* Clear bank entries */ bitmap_zero(bank[which_bit + offset].entries_bm, bank[which_bit + offset].num_entries); - *entries = bank[which_bit].mem_range_bytes/entry_size; + *entries = bank[which_bit + offset].mem_range_bytes/entry_size; /* Saturate */ if (*entries > bank[which_bit + offset].num_entries) *entries = bank[which_bit + offset].num_entries; @@ -163,7 +163,7 @@ int mifsmapper_alloc_bank(struct mifsmapper *smapper, bool large_bank, u32 entry bank[which_bit + offset].in_use = true; bank[which_bit + offset].granularity = entry_size; - SCSC_TAG_INFO(MIF, "entries %d bank[which_bit].num_entries %d large bank %d logical bank %d entries left %d\n", *entries, bank[which_bit + offset].num_entries, large_bank, which_bit + offset, + SCSC_TAG_INFO(MIF, "entries %d bank.num_entries %d large bank %d logical bank %d entries left %d\n", *entries, bank[which_bit + offset].num_entries, large_bank, which_bit + offset, bank[which_bit + offset].num_entries_left); spin_unlock(&smapper->lock); -- 2.20.1