mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
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). Change-Id: I8379ab1f9517703e51c5a94b213ba9c66013f858 Suggested-by: Julia Lawall <julia.lawall@lip6.fr> Suggested-by: "Michael S. Tsirkin" <mst@redhat.com> Cc: Julia Lawall <julia.lawall@lip6.fr> Cc: "Michael S. Tsirkin" <mst@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
0639e5b7f3
commit
55efcf3ed3
1 changed files with 4 additions and 1 deletions
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue