aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/ehca/ehca_main.c17
-rw-r--r--drivers/infiniband/hw/ehca/ehca_tools.h19
2 files changed, 18 insertions, 18 deletions
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c
index ec0145192228..bb104b7f73e3 100644
--- a/drivers/infiniband/hw/ehca/ehca_main.c
+++ b/drivers/infiniband/hw/ehca/ehca_main.c
@@ -130,6 +130,23 @@ void ehca_free_fw_ctrlblock(void *ptr)
130} 130}
131#endif 131#endif
132 132
133int ehca2ib_return_code(u64 ehca_rc)
134{
135 switch (ehca_rc) {
136 case H_SUCCESS:
137 return 0;
138 case H_RESOURCE: /* Resource in use */
139 case H_BUSY:
140 return -EBUSY;
141 case H_NOT_ENOUGH_RESOURCES: /* insufficient resources */
142 case H_CONSTRAINED: /* resource constraint */
143 case H_NO_MEM:
144 return -ENOMEM;
145 default:
146 return -EINVAL;
147 }
148}
149
133static int ehca_create_slab_caches(void) 150static int ehca_create_slab_caches(void)
134{ 151{
135 int ret; 152 int ret;
diff --git a/drivers/infiniband/hw/ehca/ehca_tools.h b/drivers/infiniband/hw/ehca/ehca_tools.h
index 678b81391861..57c77a715f46 100644
--- a/drivers/infiniband/hw/ehca/ehca_tools.h
+++ b/drivers/infiniband/hw/ehca/ehca_tools.h
@@ -154,24 +154,7 @@ extern int ehca_debug_level;
154#define EHCA_BMASK_GET(mask, value) \ 154#define EHCA_BMASK_GET(mask, value) \
155 (EHCA_BMASK_MASK(mask) & (((u64)(value)) >> EHCA_BMASK_SHIFTPOS(mask))) 155 (EHCA_BMASK_MASK(mask) & (((u64)(value)) >> EHCA_BMASK_SHIFTPOS(mask)))
156 156
157
158/* Converts ehca to ib return code */ 157/* Converts ehca to ib return code */
159static inline int ehca2ib_return_code(u64 ehca_rc) 158int ehca2ib_return_code(u64 ehca_rc);
160{
161 switch (ehca_rc) {
162 case H_SUCCESS:
163 return 0;
164 case H_RESOURCE: /* Resource in use */
165 case H_BUSY:
166 return -EBUSY;
167 case H_NOT_ENOUGH_RESOURCES: /* insufficient resources */
168 case H_CONSTRAINED: /* resource constraint */
169 case H_NO_MEM:
170 return -ENOMEM;
171 default:
172 return -EINVAL;
173 }
174}
175
176 159
177#endif /* EHCA_TOOLS_H */ 160#endif /* EHCA_TOOLS_H */