2 * SPDX-License-Identifier: LGPL-2.1-only
4 * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 #ifndef _UST_COMMON_ERR_PTR_H
8 #define _UST_COMMON_ERR_PTR_H
10 #include <urcu/compiler.h>
13 #define MAX_ERRNO 4095
16 int IS_ERR_VALUE(long value
)
18 if (caa_unlikely((unsigned long) value
>= (unsigned long) -MAX_ERRNO
))
25 void *ERR_PTR(long error
)
27 return (void *) error
;
31 long PTR_ERR(const void *ptr
)
37 int IS_ERR(const void *ptr
)
39 return IS_ERR_VALUE((long) ptr
);
42 #endif /* _UST_COMMON_ERR_PTR_H */
This page took 0.032014 seconds and 4 git commands to generate.