Skip to contentSkip to conversation

powerpc/lpar/debug: Initialize flags before printing debug message

PATCH Applied Alexey Kardashevskiy 2 participants 3 messages Jan 9, 2018 – Mar 28, 2018 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/lpar/debug: Initialize flags before printing debug message

With enabled DEBUG, there is a compile error:
"error: ‘flags’ is used uninitialized in this function".

This moves pr_devel() little further where @flags are initialized.

---

/home/aik/p/guest-kernel/arch/powerpc/platforms/pseries/lpar.c: In function ‘pSeries_lpar_hpte_updatepp’:
/home/aik/p/guest-kernel/include/linux/printk.h:320:2: error: ‘flags’ is used uninitialized in this function [-Werror=un initialized]
printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
^
/home/aik/p/guest-kernel/arch/powerpc/platforms/pseries/lpar.c:304:16: note: ‘flags’ was declared here

  unsigned long flags;
                ^
---
 arch/powerpc/platforms/pseries/lpar.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
arch/powerpc/platforms/pseries/lpar.c +5 -5
index 0ee4a46..1365424 100644
@@ -306,14 +306,14 @@ static long pSeries_lpar_hpte_updatepp(unsigned long slot,
 
 	want_v = hpte_encode_avpn(vpn, psize, ssize);
 
+	flags = (newpp & 7) | H_AVPN;
+	if (mmu_has_feature(MMU_FTR_KERNEL_RO))
+		/* Move pp0 into bit 8 (IBM 55) */
+		flags |= (newpp & HPTE_R_PP0) >> 55;
+
 	pr_devel("    update: avpnv=%016lx, hash=%016lx, f=%lx, psize: %d ...",
 		 want_v, slot, flags, psize);
 
-	flags = (newpp & 7) | H_AVPN;
-	if (mmu_has_feature(MMU_FTR_KERNEL_RO))
-		/* Move pp0 into bit 8 (IBM 55) */
-		flags |= (newpp & HPTE_R_PP0) >> 55;
-
 	lpar_rc = plpar_pte_protect(flags, slot, want_v);
 
 	if (lpar_rc == H_NOT_FOUND) {
Signature · 1 line
2.11.0
#1 lore raw
Quoted 6 lines · Alexey Kardashevskiy

With enabled DEBUG, there is a compile error:
"error: ‘flags’ is used uninitialized in this function".

This moves pr_devel() little further where @flags are initialized.

Ping?

Quoted 39 lines

---

/home/aik/p/guest-kernel/arch/powerpc/platforms/pseries/lpar.c: In function ‘pSeries_lpar_hpte_updatepp’:
/home/aik/p/guest-kernel/include/linux/printk.h:320:2: error: ‘flags’ is used uninitialized in this function [-Werror=un initialized]
printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
^
/home/aik/p/guest-kernel/arch/powerpc/platforms/pseries/lpar.c:304:16: note: ‘flags’ was declared here

  unsigned long flags;
                ^
---
 arch/powerpc/platforms/pseries/lpar.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
arch/powerpc/platforms/pseries/lpar.c +5 -5
index 0ee4a46..1365424 100644
@@ -306,14 +306,14 @@ static long pSeries_lpar_hpte_updatepp(unsigned long slot,
 
 	want_v = hpte_encode_avpn(vpn, psize, ssize);
 
+	flags = (newpp & 7) | H_AVPN;
+	if (mmu_has_feature(MMU_FTR_KERNEL_RO))
+		/* Move pp0 into bit 8 (IBM 55) */
+		flags |= (newpp & HPTE_R_PP0) >> 55;
+
 	pr_devel("    update: avpnv=%016lx, hash=%016lx, f=%lx, psize: %d ...",
 		 want_v, slot, flags, psize);
 
-	flags = (newpp & 7) | H_AVPN;
-	if (mmu_has_feature(MMU_FTR_KERNEL_RO))
-		/* Move pp0 into bit 8 (IBM 55) */
-		flags |= (newpp & HPTE_R_PP0) >> 55;
-
 	lpar_rc = plpar_pte_protect(flags, slot, want_v);
 
 	if (lpar_rc == H_NOT_FOUND) {
Signature · 1 line
Alexey