powerpc: Move get_longbusy_msecs into hvcall.h and remove duplicate function
authorIan Munsie <imunsie@au1.ibm.com>
Thu, 8 Nov 2012 05:10:29 +0000 (16:10 +1100)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 15 Nov 2012 04:08:07 +0000 (15:08 +1100)
I am going to use this in the next patch, better to have this code in
one place rather than three.

Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/include/asm/hvcall.h
drivers/infiniband/hw/ehca/hcp_if.c
drivers/net/ethernet/ibm/ehea/ehea_phyp.h

index a3d26d8f63cd1fb6613031f7541887af5f7d1767..0975e5c0bb19f93f85cfc1b6552f4c405771ead4 100644 (file)
@@ -356,6 +356,26 @@ struct hvcall_mpp_x_data {
 
 int h_get_mpp_x(struct hvcall_mpp_x_data *mpp_x_data);
 
+static inline unsigned int get_longbusy_msecs(int longbusy_rc)
+{
+       switch (longbusy_rc) {
+       case H_LONG_BUSY_ORDER_1_MSEC:
+               return 1;
+       case H_LONG_BUSY_ORDER_10_MSEC:
+               return 10;
+       case H_LONG_BUSY_ORDER_100_MSEC:
+               return 100;
+       case H_LONG_BUSY_ORDER_1_SEC:
+               return 1000;
+       case H_LONG_BUSY_ORDER_10_SEC:
+               return 10000;
+       case H_LONG_BUSY_ORDER_100_SEC:
+               return 100000;
+       default:
+               return 1;
+       }
+}
+
 #ifdef CONFIG_PPC_PSERIES
 extern int CMO_PrPSP;
 extern int CMO_SecPSP;
index 2d41d04fd959421df86e7348ea277e8e3a01f521..89517ffb4389ed8b1d781ef658b4f54b0ccd7a98 100644 (file)
 
 static DEFINE_SPINLOCK(hcall_lock);
 
-static u32 get_longbusy_msecs(int longbusy_rc)
-{
-       switch (longbusy_rc) {
-       case H_LONG_BUSY_ORDER_1_MSEC:
-               return 1;
-       case H_LONG_BUSY_ORDER_10_MSEC:
-               return 10;
-       case H_LONG_BUSY_ORDER_100_MSEC:
-               return 100;
-       case H_LONG_BUSY_ORDER_1_SEC:
-               return 1000;
-       case H_LONG_BUSY_ORDER_10_SEC:
-               return 10000;
-       case H_LONG_BUSY_ORDER_100_SEC:
-               return 100000;
-       default:
-               return 1;
-       }
-}
-
 static long ehca_plpar_hcall_norets(unsigned long opcode,
                                    unsigned long arg1,
                                    unsigned long arg2,
index 8364815c32ff63f04fd7942d2f240b980e156f2f..99b6c2a38dbf08e9458de1d165efc4719cc33506 100644 (file)
  * hcp_*  - structures, variables and functions releated to Hypervisor Calls
  */
 
-static inline u32 get_longbusy_msecs(int long_busy_ret_code)
-{
-       switch (long_busy_ret_code) {
-       case H_LONG_BUSY_ORDER_1_MSEC:
-               return 1;
-       case H_LONG_BUSY_ORDER_10_MSEC:
-               return 10;
-       case H_LONG_BUSY_ORDER_100_MSEC:
-               return 100;
-       case H_LONG_BUSY_ORDER_1_SEC:
-               return 1000;
-       case H_LONG_BUSY_ORDER_10_SEC:
-               return 10000;
-       case H_LONG_BUSY_ORDER_100_SEC:
-               return 100000;
-       default:
-               return 1;
-       }
-}
-
 /* Number of pages which can be registered at once by H_REGISTER_HEA_RPAGES */
 #define EHEA_MAX_RPAGE 512