Skip to content

Commit

Permalink
[PATCH] Fix IS_ERR Threshold Value
Browse files Browse the repository at this point in the history
 o Raise the maximum error number in IS_ERR_VALUE to 4095.
 o Make that number available as a new constant MAX_ERRNO.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Ralf Baechle authored and Linus Torvalds committed Jul 1, 2006
1 parent 10e5dce commit fa79837
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/linux/err.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
* This should be a per-architecture thing, to allow different
* error and pointer decisions.
*/
#define IS_ERR_VALUE(x) unlikely((x) > (unsigned long)-1000L)
#define MAX_ERRNO 4095

#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)

static inline void *ERR_PTR(long error)
{
Expand Down

0 comments on commit fa79837

Please sign in to comment.