linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Neuling <mikey@neuling.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Michael Neuling <mikey@neuling.org>,
	linuxppc-dev@lists.ozlabs.org, Ian Munsie <imunsie@au1.ibm.com>,
	Matt Evans <matt@ozlabs.org>
Subject: [PATCH 12/14] powerpc: Move get_longbusy_msecs into hvcall.h and remove duplicate function
Date: Fri,  9 Nov 2012 17:19:11 +1100	[thread overview]
Message-ID: <1352441953-29096-14-git-send-email-mikey@neuling.org> (raw)
In-Reply-To: <1352441953-29096-1-git-send-email-mikey@neuling.org>

From: Ian Munsie <imunsie@au1.ibm.com>

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>
---
 arch/powerpc/include/asm/hvcall.h         |   20 ++++++++++++++++++++
 drivers/infiniband/hw/ehca/hcp_if.c       |   20 --------------------
 drivers/net/ethernet/ibm/ehea/ehea_phyp.h |   20 --------------------
 3 files changed, 20 insertions(+), 40 deletions(-)

diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h
index a3d26d8..0975e5c 100644
--- a/arch/powerpc/include/asm/hvcall.h
+++ b/arch/powerpc/include/asm/hvcall.h
@@ -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;
diff --git a/drivers/infiniband/hw/ehca/hcp_if.c b/drivers/infiniband/hw/ehca/hcp_if.c
index 2d41d04..89517ff 100644
--- a/drivers/infiniband/hw/ehca/hcp_if.c
+++ b/drivers/infiniband/hw/ehca/hcp_if.c
@@ -90,26 +90,6 @@
 
 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,
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_phyp.h b/drivers/net/ethernet/ibm/ehea/ehea_phyp.h
index 8364815..99b6c2a 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_phyp.h
+++ b/drivers/net/ethernet/ibm/ehea/ehea_phyp.h
@@ -39,26 +39,6 @@
  * 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
 
-- 
1.7.9.5

  parent reply	other threads:[~2012-11-09  6:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-09  6:18 [PATCH 00/14] powerpc: Add support for POWER8 relocation on exceptions Michael Neuling
2012-11-09  6:18 ` [PATCH 01/14] powerpc: Fix name denorm hypervisor symbol Michael Neuling
2012-11-09  6:19 ` [PATCH 02/14] powerpc: Whitespace changes in exception64s.S Michael Neuling
2012-11-09  6:19 ` [PATCH 03/14] powerpc: Remove unessessary 0x3000 location enforcement Michael Neuling
2012-11-09  6:19 ` [PATCH 04/14] powerpc: Make load_hander handle upto 64k offset Michael Neuling
2012-11-09  6:19 ` [PATCH 05/14] powerpc: Turn syscall handler into macros Michael Neuling
2012-11-09  6:19 ` [PATCH 06/14] powerpc: Add new macros needed for relocation on exceptions Michael Neuling
2012-11-09  6:19 ` [PATCH 07/14] powerpc: Add relocation on exception vector handlers Michael Neuling
2012-11-09  6:19 ` [PATCH 08/14] powerpc: Move initial mfspr LPCR out of __init_LPCR Michael Neuling
2012-11-09  6:19 ` [PATCH 09/14] powerpc: Setup relocation on exceptions for bare metal systems Michael Neuling
2012-11-12  1:32   ` Segher Boessenkool
2012-11-12  2:08     ` Michael Neuling
2012-11-09  6:19 ` [PATCH 10/14] powerpc: Add set_mode hcall Michael Neuling
2012-11-09  6:19 ` [PATCH 10/12] powerpc: Move get_longbusy_msecs into hvcall.h and remove duplicate function Michael Neuling
2012-11-09  6:19 ` [PATCH 11/14] powerpc: Add wrappers to enable/disable relocation on exceptions Michael Neuling
2012-11-09  6:19 ` Michael Neuling [this message]
2012-11-09  9:26   ` [PATCH 12/14] powerpc: Move get_longbusy_msecs into hvcall.h and remove duplicate function Stephen Rothwell
2012-11-09  9:49     ` Michael Neuling
2012-11-09  6:19 ` [PATCH 13/14] powerpc: Enable relocation on during exceptions at boot Michael Neuling
2012-11-09  6:19 ` [PATCH 14/14] powerpc: Disable relocation on exceptions when kexecing Michael Neuling
2012-11-09  8:58 ` [PATCH 00/14] powerpc: Add support for POWER8 relocation on exceptions Gabriel Paubert
2012-11-09  9:51   ` Michael Neuling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1352441953-29096-14-git-send-email-mikey@neuling.org \
    --to=mikey@neuling.org \
    --cc=benh@kernel.crashing.org \
    --cc=imunsie@au1.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=matt@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).