Skip to contentSkip to conversation

mpc8xxx: fsl_pamu: Update data type in config_pamu

PATCH New Priyanka Jain 1 participant 1 message Feb 5, 2021 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mpc8xxx: fsl_pamu: Update data type in config_pamu

Update data type of '1' to '1ull' in below assignment size = 1ull << sizebit;

to fix incorrect assignment issue.
e.g: when sizebit was 31, 0x80000000 got sign extended to 0xffffffff_80000000

---
 arch/powerpc/cpu/mpc8xxx/fsl_pamu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/cpu/mpc8xxx/fsl_pamu.c +1 -1
index 2c378b7615..5229949951 100644
@@ -390,7 +390,7 @@ int config_pamu(struct pamu_addr_tbl *tbl, int num_entries, uint32_t liodn)
 		return -1;
 
 	sizebit = __ilog2_roundup_64(size);
-	size = 1 << sizebit;
+	size = 1ull << sizebit;
 	debug("min start_addr is %llx\n", min_addr);
 	debug("max end_addr is %llx\n", max_addr);
 	debug("size found is  %llx\n", size);
Signature · 1 line
2.17.1