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>

authored by Hoang-Nam Nguyen and committed by Roland Dreier 51d2bfbd 633a5aed

+18 -18
+17
drivers/infiniband/hw/ehca/ehca_main.c
··· 130 } 131 #endif 132 133 static int ehca_create_slab_caches(void) 134 { 135 int ret;
··· 130 } 131 #endif 132 133 + int 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 + 150 static int ehca_create_slab_caches(void) 151 { 152 int ret;
+1 -18
drivers/infiniband/hw/ehca/ehca_tools.h
··· 154 #define EHCA_BMASK_GET(mask, value) \ 155 (EHCA_BMASK_MASK(mask) & (((u64)(value)) >> EHCA_BMASK_SHIFTPOS(mask))) 156 157 - 158 /* Converts ehca to ib return code */ 159 - static inline int 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 177 #endif /* EHCA_TOOLS_H */
··· 154 #define EHCA_BMASK_GET(mask, value) \ 155 (EHCA_BMASK_MASK(mask) & (((u64)(value)) >> EHCA_BMASK_SHIFTPOS(mask))) 156 157 /* Converts ehca to ib return code */ 158 + int ehca2ib_return_code(u64 ehca_rc); 159 160 #endif /* EHCA_TOOLS_H */