cregit-Linux how code gets into the kernel

Release 4.7 include/linux/err.h

Directory: include/linux
#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

PersonTokensPropCommitsCommitProp
dave jonesdave jones1894.74%150.00%
jani nikulajani nikula15.26%150.00%
Total19100.00%2100.00%


static inline long __must_check PTR_ERR(__force const void *ptr) { return (long) ptr; }

Contributors

PersonTokensPropCommitsCommitProp
dave jonesdave jones1890.00%133.33%
dan carpenterdan carpenter15.00%133.33%
jani nikulajani nikula15.00%133.33%
Total20100.00%3100.00%


static inline bool __must_check IS_ERR(__force const void *ptr) { return IS_ERR_VALUE((unsigned long)ptr); }

Contributors

PersonTokensPropCommitsCommitProp
dave jonesdave jones1875.00%116.67%
andrew mortonandrew morton28.33%116.67%
joe perchesjoe perches14.17%116.67%
jani nikulajani nikula14.17%116.67%
linus torvaldslinus torvalds14.17%116.67%
dan carpenterdan carpenter14.17%116.67%
Total24100.00%6100.00%


static inline bool __must_check IS_ERR_OR_NULL(__force const void *ptr) { return unlikely(!ptr) || IS_ERR_VALUE((unsigned long)ptr); }

Contributors

PersonTokensPropCommitsCommitProp
phil carmodyphil carmody2480.00%120.00%
viresh kumarviresh kumar310.00%120.00%
jani nikulajani nikula13.33%120.00%
joe perchesjoe perches13.33%120.00%
dan carpenterdan carpenter13.33%120.00%
Total30100.00%5100.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

PersonTokensPropCommitsCommitProp
david howellsdavid howells2191.30%133.33%
jani nikulajani nikula14.35%133.33%
dan carpenterdan carpenter14.35%133.33%
Total23100.00%3100.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

PersonTokensPropCommitsCommitProp
uwe kleine-koeniguwe kleine-koenig2993.55%133.33%
dan carpenterdan carpenter13.23%133.33%
rusty russellrusty russell13.23%133.33%
Total31100.00%3100.00%

/* Deprecated */ #define PTR_RET(p) PTR_ERR_OR_ZERO(p) #endif #endif /* _LINUX_ERR_H */

Overall Contributors

PersonTokensPropCommitsCommitProp
dave jonesdave jones6634.55%17.14%
uwe kleine-koeniguwe kleine-koenig2915.18%17.14%
phil carmodyphil carmody2412.57%17.14%
david howellsdavid howells2211.52%17.14%
rusty russellrusty russell94.71%17.14%
linus torvaldslinus torvalds84.19%214.29%
joe perchesjoe perches63.14%17.14%
randy dunlaprandy dunlap52.62%17.14%
jani nikulajani nikula52.62%17.14%
dan carpenterdan carpenter52.62%17.14%
andrew mortonandrew morton52.62%17.14%
ralf baechleralf baechle42.09%17.14%
viresh kumarviresh kumar31.57%17.14%
Total191100.00%14100.00%
Directory: include/linux
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
{% endraw %}