X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=include%2Flinux%2Ferr.h;h=22e5756eddc25865fc594c12c979319b16d68829;hb=24b77393a5fcc3e1f51b4e3a1080c0efb60b52eb;hp=5b3c8bcf700af26f88812491f0bf52b8a00537fa;hpb=6defdc0b5552ab1af4a66a8abac8196cbb6b9e15;p=oweals%2Fu-boot.git diff --git a/include/linux/err.h b/include/linux/err.h index 5b3c8bcf70..22e5756edd 100644 --- a/include/linux/err.h +++ b/include/linux/err.h @@ -4,7 +4,7 @@ #include #include -#include +#include /* @@ -36,6 +36,11 @@ static inline long IS_ERR(const void *ptr) return IS_ERR_VALUE((unsigned long)ptr); } +static inline bool IS_ERR_OR_NULL(const void *ptr) +{ + return !ptr || IS_ERR_VALUE((unsigned long)ptr); +} + /** * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type * @ptr: The pointer to cast.