]> Git Repo - linux.git/commitdiff
ipc/util.c: update return value of ipc_getref from int to bool
authorManfred Spraul <[email protected]>
Wed, 22 Aug 2018 05:02:04 +0000 (22:02 -0700)
committerLinus Torvalds <[email protected]>
Wed, 22 Aug 2018 17:52:52 +0000 (10:52 -0700)
ipc_getref has still a return value of type "int", matching the atomic_t
interface of atomic_inc_not_zero()/atomic_add_unless().

ipc_getref now uses refcount_inc_not_zero, which has a return value of
type "bool".

Therefore, update the return code to avoid implicit conversions.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Manfred Spraul <[email protected]>
Cc: Davidlohr Bueso <[email protected]>
Cc: Davidlohr Bueso <[email protected]>
Cc: Dmitry Vyukov <[email protected]>
Cc: Herbert Xu <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Michael Kerrisk <[email protected]>
Cc: Michal Hocko <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
ipc/util.c
ipc/util.h

index 6f30ba80ca15237677038f6912e7b15467776644..0af05752969f1bc4641a591d717edd1b46a18b5a 100644 (file)
@@ -462,7 +462,7 @@ void ipc_set_key_private(struct ipc_ids *ids, struct kern_ipc_perm *ipcp)
        ipcp->key = IPC_PRIVATE;
 }
 
-int ipc_rcu_getref(struct kern_ipc_perm *ptr)
+bool ipc_rcu_getref(struct kern_ipc_perm *ptr)
 {
        return refcount_inc_not_zero(&ptr->refcount);
 }
index e74564fe3375fdfe5c4814a479c79488cbd2718e..0a159f69b3bbeb82440268a263c33be8d0dc71dd 100644 (file)
@@ -138,7 +138,7 @@ static inline int ipc_get_maxidx(struct ipc_ids *ids)
  * refcount is initialized by ipc_addid(), before that point call_rcu()
  * must be used.
  */
-int ipc_rcu_getref(struct kern_ipc_perm *ptr);
+bool ipc_rcu_getref(struct kern_ipc_perm *ptr);
 void ipc_rcu_putref(struct kern_ipc_perm *ptr,
                        void (*func)(struct rcu_head *head));
 
This page took 0.061469 seconds and 4 git commands to generate.