All of lore.kernel.org
 help / color / mirror / Atom feed
* + include-linux-errh-add-a-function-to-cast-error-pointers-to-a-return-value.patch added to -mm tree
@ 2011-01-27 22:26 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2011-01-27 22:26 UTC (permalink / raw)
  To: mm-commits; +Cc: u.kleine-koenig, akpm


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@pengutronix.de>

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@pengutronix.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 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@pengutronix.de 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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-01-27 22:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-27 22:26 + include-linux-errh-add-a-function-to-cast-error-pointers-to-a-return-value.patch added to -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.