From a1a6ff11006c3a056cda9e8b13e7388fba3e69a1 Mon Sep 17 00:00:00 2001
From: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
Date: Thu, 12 Jul 2007 17:49:02 +0200
Subject: IB/ehca: Use common error code mapping instead of specific ones

Instead of one error mapping function for each potential error source
in ehca_mrmw.c, use a centralized function that handles all cases,
saving a three-figure line count.

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
---
 drivers/infiniband/hw/ehca/ehca_tools.h | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'drivers/infiniband/hw/ehca/ehca_tools.h')

diff --git a/drivers/infiniband/hw/ehca/ehca_tools.h b/drivers/infiniband/hw/ehca/ehca_tools.h
index 03b185f873da..fd8238b32153 100644
--- a/drivers/infiniband/hw/ehca/ehca_tools.h
+++ b/drivers/infiniband/hw/ehca/ehca_tools.h
@@ -161,8 +161,11 @@ static inline int ehca2ib_return_code(u64 ehca_rc)
 	switch (ehca_rc) {
 	case H_SUCCESS:
 		return 0;
+	case H_RESOURCE:             /* Resource in use */
 	case H_BUSY:
 		return -EBUSY;
+	case H_NOT_ENOUGH_RESOURCES: /* insufficient resources */
+	case H_CONSTRAINED:          /* resource constraint */
 	case H_NO_MEM:
 		return -ENOMEM;
 	default:
-- 
cgit v1.2.2