Patchwork [powerpc] Use VPA subfunction macros instead of numbers for vpa calls

login
register
mail settings
Submitter Li Zhong
Date Jan. 25, 2013, 8:12 a.m.
Message ID <1359101541.2666.59.camel@ThinkPad-T5421.cn.ibm.com>
Download mbox | patch
Permalink /patch/215571/
State Accepted
Commit bb18b3a47d5998d0c94f12b8334e660a0d70b272
Delegated to: Michael Ellerman
Headers show

Comments

Li Zhong - Jan. 25, 2013, 8:12 a.m.
Use macros in vpa calls. 

Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/pseries/plpar_wrappers.h |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
Michael Ellerman - Feb. 4, 2013, 5:30 a.m.
On Fri, 2013-01-25 at 16:12 +0800, Li Zhong wrote:
> Use macros in vpa calls. 
> 
> Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>

Looks good.

cheers

Patch

diff --git a/arch/powerpc/platforms/pseries/plpar_wrappers.h b/arch/powerpc/platforms/pseries/plpar_wrappers.h
index f368668..f35787b 100644
--- a/arch/powerpc/platforms/pseries/plpar_wrappers.h
+++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h
@@ -58,40 +58,39 @@  static inline long extended_cede_processor(unsigned long latency_hint)
 static inline long vpa_call(unsigned long flags, unsigned long cpu,
 		unsigned long vpa)
 {
-	/* flags are in bits 16-18 (counting from most significant bit) */
-	flags = flags << (63 - 18);
+	flags = flags << H_VPA_FUNC_SHIFT;
 
 	return plpar_hcall_norets(H_REGISTER_VPA, flags, cpu, vpa);
 }
 
 static inline long unregister_vpa(unsigned long cpu)
 {
-	return vpa_call(0x5, cpu, 0);
+	return vpa_call(H_VPA_DEREG_VPA, cpu, 0);
 }
 
 static inline long register_vpa(unsigned long cpu, unsigned long vpa)
 {
-	return vpa_call(0x1, cpu, vpa);
+	return vpa_call(H_VPA_REG_VPA, cpu, vpa);
 }
 
 static inline long unregister_slb_shadow(unsigned long cpu)
 {
-	return vpa_call(0x7, cpu, 0);
+	return vpa_call(H_VPA_DEREG_SLB, cpu, 0);
 }
 
 static inline long register_slb_shadow(unsigned long cpu, unsigned long vpa)
 {
-	return vpa_call(0x3, cpu, vpa);
+	return vpa_call(H_VPA_REG_SLB, cpu, vpa);
 }
 
 static inline long unregister_dtl(unsigned long cpu)
 {
-	return vpa_call(0x6, cpu, 0);
+	return vpa_call(H_VPA_DEREG_DTL, cpu, 0);
 }
 
 static inline long register_dtl(unsigned long cpu, unsigned long vpa)
 {
-	return vpa_call(0x2, cpu, vpa);
+	return vpa_call(H_VPA_REG_DTL, cpu, vpa);
 }
 
 static inline long plpar_page_set_loaned(unsigned long vpa)