Re: IS_ERR Threshold Value

From: Ralf Baechle
Date: Thu Jun 29 2006 - 14:08:50 EST


On Wed, Jun 28, 2006 at 02:08:25PM -0700, Randy.Dunlap wrote:

> Hi,
> Peter Anvin mentioned just a few days ago that this threshold value
> should be 4095 for all arches. I think we need to get that patch
> done & submitted to Andrew for -mm.

So here the patch is:

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@xxxxxxxxxxxxxx>

diff --git a/include/linux/err.h b/include/linux/err.h
index ff71d2a..cd3b367 100644
--- a/include/linux/err.h
+++ b/include/linux/err.h
@@ -13,7 +13,9 @@ #include <asm/errno.h>
* 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)
{
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/