Release 4.12 include/linux/err.h
#ifndef _LINUX_ERR_H
#define _LINUX_ERR_H
#include <linux/compiler.h>
#include <linux/types.h>
#include <asm/errno.h>
/*
* Kernel pointers have redundant information, so we can use a
* scheme where we can return either an error code or a normal
* pointer with the same return value.
*
* This should be a per-architecture thing, to allow different
* error and pointer decisions.
*/
#define MAX_ERRNO 4095
#ifndef __ASSEMBLY__
#define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO)
static inline void * __must_check ERR_PTR(long error)
{
return (void *) error;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Dave Jones | 18 | 94.74% | 1 | 50.00% |
Jani Nikula | 1 | 5.26% | 1 | 50.00% |
Total | 19 | 100.00% | 2 | 100.00% |
static inline long __must_check PTR_ERR(__force const void *ptr)
{
return (long) ptr;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Dave Jones | 18 | 90.00% | 1 | 33.33% |
Dan Carpenter | 1 | 5.00% | 1 | 33.33% |
Jani Nikula | 1 | 5.00% | 1 | 33.33% |
Total | 20 | 100.00% | 3 | 100.00% |
static inline bool __must_check IS_ERR(__force const void *ptr)
{
return IS_ERR_VALUE((unsigned long)ptr);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Dave Jones | 18 | 75.00% | 1 | 16.67% |
Andrew Morton | 2 | 8.33% | 1 | 16.67% |
Jani Nikula | 1 | 4.17% | 1 | 16.67% |
Joe Perches | 1 | 4.17% | 1 | 16.67% |
Linus Torvalds | 1 | 4.17% | 1 | 16.67% |
Dan Carpenter | 1 | 4.17% | 1 | 16.67% |
Total | 24 | 100.00% | 6 | 100.00% |
static inline bool __must_check IS_ERR_OR_NULL(__force const void *ptr)
{
return unlikely(!ptr) || IS_ERR_VALUE((unsigned long)ptr);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Phil Carmody | 24 | 80.00% | 1 | 20.00% |
Viresh Kumar | 3 | 10.00% | 1 | 20.00% |
Dan Carpenter | 1 | 3.33% | 1 | 20.00% |
Jani Nikula | 1 | 3.33% | 1 | 20.00% |
Joe Perches | 1 | 3.33% | 1 | 20.00% |
Total | 30 | 100.00% | 5 | 100.00% |
/**
* ERR_CAST - Explicitly cast an error-valued pointer to another pointer type
* @ptr: The pointer to cast.
*
* Explicitly cast an error-valued pointer to another pointer type in such a
* way as to make it clear that's what's going on.
*/
static inline void * __must_check ERR_CAST(__force const void *ptr)
{
/* cast away the const */
return (void *) ptr;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David Howells | 21 | 91.30% | 1 | 33.33% |
Dan Carpenter | 1 | 4.35% | 1 | 33.33% |
Jani Nikula | 1 | 4.35% | 1 | 33.33% |
Total | 23 | 100.00% | 3 | 100.00% |
static inline int __must_check PTR_ERR_OR_ZERO(__force const void *ptr)
{
if (IS_ERR(ptr))
return PTR_ERR(ptr);
else
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Uwe Kleine-König | 29 | 93.55% | 1 | 33.33% |
Rusty Russell | 1 | 3.23% | 1 | 33.33% |
Dan Carpenter | 1 | 3.23% | 1 | 33.33% |
Total | 31 | 100.00% | 3 | 100.00% |
/* Deprecated */
#define PTR_RET(p) PTR_ERR_OR_ZERO(p)
#endif
#endif /* _LINUX_ERR_H */
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Dave Jones | 66 | 34.55% | 1 | 7.14% |
Uwe Kleine-König | 29 | 15.18% | 1 | 7.14% |
Phil Carmody | 24 | 12.57% | 1 | 7.14% |
David Howells | 22 | 11.52% | 1 | 7.14% |
Rusty Russell | 9 | 4.71% | 1 | 7.14% |
Linus Torvalds | 8 | 4.19% | 2 | 14.29% |
Joe Perches | 6 | 3.14% | 1 | 7.14% |
Dan Carpenter | 5 | 2.62% | 1 | 7.14% |
Andrew Morton | 5 | 2.62% | 1 | 7.14% |
Randy Dunlap | 5 | 2.62% | 1 | 7.14% |
Jani Nikula | 5 | 2.62% | 1 | 7.14% |
Ralf Bächle | 4 | 2.09% | 1 | 7.14% |
Viresh Kumar | 3 | 1.57% | 1 | 7.14% |
Total | 191 | 100.00% | 14 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.