lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1371357768-4968-1-git-send-email-rusty@rustcorp.com.au>
Date:	Sun, 16 Jun 2013 14:12:40 +0930
From:	Rusty Russell <rusty@...tcorp.com.au>
To:	linux-kernel@...r.kernel.org
Cc:	Rusty Russell <rusty@...tcorp.com.au>,
	Julia Lawall <julia.lawall@...6.fr>,
	"Michael S. Tsirkin" <mst@...hat.com>
Subject: [PATCH 1/9] PTR_RET is now PTR_ERR_OR_ZERO

True, it's often used in return statements, but after much bikeshedding
it's probably better to have an explicit name.

(I tried just putting the IS_ERR check inside PTR_ERR itself and gcc
usually generated no more code.  But that clashes current expectations
of how PTR_ERR behaves, so having a separate function is better).

Suggested-by: Julia Lawall <julia.lawall@...6.fr>
Suggested-by: "Michael S. Tsirkin" <mst@...hat.com>
Cc: Julia Lawall <julia.lawall@...6.fr>
Cc: "Michael S. Tsirkin" <mst@...hat.com>
Signed-off-by: Rusty Russell <rusty@...tcorp.com.au>
---
 include/linux/err.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/linux/err.h b/include/linux/err.h
index f2edce2..ee365c4 100644
--- a/include/linux/err.h
+++ b/include/linux/err.h
@@ -52,7 +52,7 @@ static inline void * __must_check ERR_CAST(const void *ptr)
 	return (void *) ptr;
 }
 
-static inline int __must_check PTR_RET(const void *ptr)
+static inline int __must_check PTR_ERR_OR_ZERO(const void *ptr)
 {
 	if (IS_ERR(ptr))
 		return PTR_ERR(ptr);
@@ -60,6 +60,9 @@ static inline int __must_check PTR_RET(const void *ptr)
 		return 0;
 }
 
+/* Deprecated */
+#define PTR_RET(p) PTR_ERR_OR_ZERO(p)
+
 #endif
 
 #endif /* _LINUX_ERR_H */
-- 
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ