/* * Kernel pointers have redundant information, so we can use a * scheme where we can return either an error code or a dentry * pointer with the same return value. * * This should be a per-architecture thing, to allow different * error and pointer decisions. */ #define MAX_ERRNO 4095
/** * 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. */ staticinlinevoid*ERR_CAST(constvoid*ptr) { /* cast away the const */ return(void*) ptr; }
文件的代码#ifndef _LINUX_ERR_H#define _LINUX_ERR_H#include linux/compiler.h>#include asm/errno.h>/* * Kernel pointers have redundant information, so we can use a * scheme wh