+ include-linux-errh-add-a-function-to-cast-error-pointers-to-a-return-value.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     include/linux/err.h: add a function to cast error-pointers to a return value
has been added to the -mm tree.  Its filename is
     include-linux-errh-add-a-function-to-cast-error-pointers-to-a-return-value.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: include/linux/err.h: add a function to cast error-pointers to a return value
From: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>

PTR_RET() can be used if you have an error-pointer and are only interested
in the eventual error value, but not the pointer.  Yields the usual 0 for
no error, -ESOMETHING otherwise.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 include/linux/err.h |    8 ++++++++
 1 file changed, 8 insertions(+)

diff -puN include/linux/err.h~include-linux-errh-add-a-function-to-cast-error-pointers-to-a-return-value include/linux/err.h
--- a/include/linux/err.h~include-linux-errh-add-a-function-to-cast-error-pointers-to-a-return-value
+++ a/include/linux/err.h
@@ -52,6 +52,14 @@ static inline void * __must_check ERR_CA
 	return (void *) ptr;
 }
 
+static inline int __must_check PTR_RET(const void *ptr)
+{
+	if (IS_ERR(ptr))
+		return PTR_ERR(ptr);
+	else
+		return 0;
+}
+
 #endif
 
 #endif /* _LINUX_ERR_H */
_

Patches currently in -mm which might be from u.kleine-koenig@xxxxxxxxxxxxxx are

origin.patch
linux-next.patch
include-linux-errh-add-a-function-to-cast-error-pointers-to-a-return-value.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux