aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHoang-Nam Nguyen <hnguyen@linux.vnet.ibm.com>2007-07-20 10:02:46 -0400
committerRoland Dreier <rolandd@cisco.com>2007-07-21 00:19:44 -0400
commit51d2bfbddb33dc59786a3a41f7eeb59e30fa561c (patch)
tree1b8b007c88015afb57264dd75b73454ec3a415c1 /drivers
parent633a5aedaee1c96347b8a6c2ae7dceb47d0c910f (diff)
IB/ehca: Move ehca2ib_return_code() out of line
ehca2ib_return_code() is not used in any fast path, and making it non-inline saves ~1.5K of code. Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers')
-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 */