Last change
on this file since 695 was 679, checked in by David Azarewicz, 4 years ago |
Merge changes from Paul's uniaud32next branch.
|
File size:
615 bytes
|
Line | |
---|
1 | /* $Id: err.h,v 1.1.1.1 2003/07/02 13:57:00 eleph Exp $ */
|
---|
2 |
|
---|
3 | #ifndef _LINUX_ERR_H
|
---|
4 | #define _LINUX_ERR_H
|
---|
5 | #include <linux/types.h>
|
---|
6 |
|
---|
7 | #define IS_ERR_VALUE(x) ((x) > (unsigned long)-1000L)
|
---|
8 |
|
---|
9 | static inline void *ERR_PTR(long error)
|
---|
10 | {
|
---|
11 | return (void *) error;
|
---|
12 | }
|
---|
13 |
|
---|
14 | static inline long PTR_ERR(const void *ptr)
|
---|
15 | {
|
---|
16 | return (long) ptr;
|
---|
17 | }
|
---|
18 |
|
---|
19 | static inline long IS_ERR(const void *ptr)
|
---|
20 | {
|
---|
21 | return IS_ERR_VALUE((unsigned long)ptr);
|
---|
22 | }
|
---|
23 |
|
---|
24 | static inline int PTR_RET(const void *ptr)
|
---|
25 | {
|
---|
26 | if (IS_ERR(ptr))
|
---|
27 | return PTR_ERR(ptr);
|
---|
28 | else
|
---|
29 | return 0;
|
---|
30 | }
|
---|
31 |
|
---|
32 | #define PTR_ERR_OR_ZERO(p) PTR_RET(p)
|
---|
33 | #endif /* _LINUX_ERR_H */
|
---|
Note:
See
TracBrowser
for help on using the repository browser.