aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/vithar/osk/mali_osk_common.h
blob: 716c9aa04b4d73f006927702a6bbb9e02c81010e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
 *
 * (C) COPYRIGHT 2010, 2012 ARM Limited. All rights reserved.
 *
 * This program is free software and is provided to you under the terms of the GNU General Public License version 2
 * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
 * 
 * A copy of the licence is included with the program, and can also be obtained from Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 * 
 */



/**
 * @file mali_osk_common.h
 * This header defines macros shared by the Common Layer public interfaces for
 * all utilities, to ensure they are available even if a client does not include
 * the convenience header mali_osk.h.
 */

#ifndef _OSK_COMMON_H_
#define _OSK_COMMON_H_

#include <osk/include/mali_osk_debug.h>

/**
 * @private
 */
static INLINE mali_bool oskp_ptr_is_null(const void* ptr)
{
	CSTD_UNUSED(ptr);
	OSK_ASSERT(ptr != NULL);
	return MALI_FALSE;
}

/**
 * @brief Check if a pointer is NULL, if so an assert is triggered, otherwise the pointer itself is returned.
 *
 * @param [in] ptr Pointer to test
 *
 * @return @c ptr if it's not NULL.
 */
#define OSK_CHECK_PTR(ptr)\
	(oskp_ptr_is_null(ptr) ? NULL : ptr)

#endif /* _OSK_COMMON_H_ */