Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 51d2bfbd authored by Hoang-Nam Nguyen's avatar Hoang-Nam Nguyen Committed by Roland Dreier
Browse files

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: default avatarJoachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 633a5aed
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -130,6 +130,23 @@ void ehca_free_fw_ctrlblock(void *ptr)
}
#endif

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:
		return -EINVAL;
	}
}

static int ehca_create_slab_caches(void)
{
	int ret;
+1 −18
Original line number Diff line number Diff line
@@ -154,24 +154,7 @@ extern int ehca_debug_level;
#define EHCA_BMASK_GET(mask, value) \
	(EHCA_BMASK_MASK(mask) & (((u64)(value)) >> EHCA_BMASK_SHIFTPOS(mask)))


/* Converts ehca to ib return code */
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:
		return -EINVAL;
	}
}

int ehca2ib_return_code(u64 ehca_rc);

#endif /* EHCA_TOOLS_H */