ocf/src/ocf_priv.h
Robert Baldyga 1373471af7 Introduce OCF_CMPL_RET() macro
This simplifies cases when we want to call completion callback
and immediately return from void-returning function, by allowing
to explicitly express programmers intent. That way we can avoid
cases when return statement is missing by mistake (this patch
fixes at least one bug related to this).

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-05-02 17:22:36 +02:00

19 lines
330 B
C

/*
* Copyright(c) 2012-2018 Intel Corporation
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#ifndef __OCF_PRIV_H__
#define __OCF_PRIV_H__
#include "ocf_env.h"
#include "ocf_def_priv.h"
#define OCF_CHECK_NULL(p) ENV_BUG_ON(!(p))
#define OCF_CMPL_RET(args...) ({ \
cmpl(args); \
return; \
})
#endif /* __OCF_PRIV_H__ */