Skip to content

Commit a5ed3ce

Browse files
JoePerchestorvalds
authored andcommitted
err.h: use bool for IS_ERR and IS_ERR_OR_NULL
Use the more natural return of bool for these tests. No difference observed in .o files produced by gcc for x86. Remove the dentry description of kernel pointers left over from the 90's and 2002's cleanup move of parts of fs.h to err.h. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 8e3072a commit a5ed3ce

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎include/linux/err.h‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
#define _LINUX_ERR_H
33

44
#include <linux/compiler.h>
5+
#include <linux/types.h>
56

67
#include <asm/errno.h>
78

89
/*
910
* Kernel pointers have redundant information, so we can use a
10-
* scheme where we can return either an error code or a dentry
11+
* scheme where we can return either an error code or a normal
1112
* pointer with the same return value.
1213
*
1314
* This should be a per-architecture thing, to allow different
@@ -29,12 +30,12 @@ static inline long __must_check PTR_ERR(__force const void *ptr)
2930
return (long) ptr;
3031
}
3132

32-
static inline long __must_check IS_ERR(__force const void *ptr)
33+
static inline bool __must_check IS_ERR(__force const void *ptr)
3334
{
3435
return IS_ERR_VALUE((unsigned long)ptr);
3536
}
3637

37-
static inline long __must_check IS_ERR_OR_NULL(__force const void *ptr)
38+
static inline bool __must_check IS_ERR_OR_NULL(__force const void *ptr)
3839
{
3940
return !ptr || IS_ERR_VALUE((unsigned long)ptr);
4041
}

0 commit comments

Comments
 (0)