static inline int fi_bgq_check_atomic()

in prov/bgq/include/rdma/fi_direct_atomic.h [104:151]


static inline int fi_bgq_check_atomic(struct fi_bgq_ep *bgq_ep,
		enum fi_av_type av_type, enum fi_datatype dt, enum fi_op op,
		size_t count)
{
#ifdef DEBUG
	switch((int)op) {
	case FI_MIN:
	case FI_MAX:
	case FI_SUM:
	case FI_PROD:
	case FI_LOR:
	case FI_LAND:
	case FI_BOR:
	case FI_BAND:
	case FI_LXOR:
	case FI_ATOMIC_READ:
	case FI_ATOMIC_WRITE:
	case FI_CSWAP:
	case FI_CSWAP_NE:
	case FI_CSWAP_LE:
	case FI_CSWAP_LT:
	case FI_CSWAP_GE:
	case FI_CSWAP_GT:
	case FI_MSWAP:
		break;
	default:
		return -FI_EINVAL;
	}
	if (((int) dt >= FI_DATATYPE_LAST) || ((int) dt < 0))
		return -FI_EINVAL;

	if (!bgq_ep)
		return -FI_EINVAL;
	if (bgq_ep->state != FI_BGQ_EP_ENABLED)
		return -FI_EINVAL;

	if (count == 0)
		return -FI_EINVAL;

	if (av_type == FI_AV_UNSPEC)
		return -FI_EINVAL;
	if (av_type == FI_AV_MAP && bgq_ep->av_type != FI_AV_MAP)
		return -FI_EINVAL;
	if (av_type == FI_AV_TABLE && bgq_ep->av_type != FI_AV_TABLE)
		return -FI_EINVAL;
#endif
	return 0;
}