From 79b8ea00a1138f314d8e30a48ddaa1907b40a5ce Mon Sep 17 00:00:00 2001 From: Leonid Lobachev Date: Mon, 23 Sep 2019 14:02:37 -0700 Subject: [PATCH] staging: gasket: page_table: use total_entries for max ext lvl0 page idx The maximum number of entries in the page table is configurable at initialization time and should be used in gasket_extended_lvl0_page_idx. Change-Id: I39f2dba48083a3eef3951ecd9659ee9f4901275e Signed-off-by: Nick Ewalt Signed-off-by: Todd Poynor --- gasket_page_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gasket_page_table.c b/gasket_page_table.c index 9a239f0..a29426a 100644 --- a/gasket_page_table.c +++ b/gasket_page_table.c @@ -586,7 +586,7 @@ static ulong gasket_extended_lvl0_page_idx(struct gasket_page_table *pg_tbl, u64 dev_addr) { return (dev_addr >> GASKET_EXTENDED_LVL0_SHIFT) & - ((1 << GASKET_EXTENDED_LVL0_WIDTH) - 1); + (pg_tbl->config.total_entries - 1); } /*