Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2027482imm; Thu, 12 Jul 2018 11:54:45 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdGQ/c2zZY/zMfL/7u455HqJMzMfJWJTjDgulJ84uNaknRI26GS6K+X4bQ3sizuJ6ZYAQJe X-Received: by 2002:a17:902:44a4:: with SMTP id l33-v6mr3295236pld.134.1531421685611; Thu, 12 Jul 2018 11:54:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531421685; cv=none; d=google.com; s=arc-20160816; b=oFUVop7uRvo7vQZLasP9+lCwInVPLhsPW9c2xzQ9fkG9kal+h1i7zp+Ww29HTqWSjx dPmOK7gHpAUpgivPe+1KD5PoC2m+qjlR/hTxm1+DtNTCupnsLUeAmmFeb7yVN8QDhkat cq647aqo8vUKrRBz+0HB0l2V7w9UYVXChG9Iu/fejT6R20PTI6hyUUr+BErASZwncAjo 5JO79HV5gFYm4UVN3X/FBtA6dt/uSjoEW7Mm8GhqD0xkHAKfXcGLVx2y01BvHYFLubdD 2nmuFgjv0ACCfVIlaUEszH/f+e7mji+56Nu4WQ9zdtgZZ5SP7+n8PUldySzFYaoa+EaC bDNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=34/lc7wzdbzbGT9TkKN03OB3zabW3AIhrTpTN2ASzm0=; b=b+4z9yeTlnaK89oBvA11I4TKhT6UFwTR9ynfJv1vT078c+b56w/jPzdEquPzfg08ZA u+AOLfrV+/P6s/7+Ay5o5f5sXHJiF+ZIcmkoIyPKZYy3bNg/EuVn8ABeNDw0n+OHMr0l lOXI3rLblKnvsVn3ya8J1gzw/iko9KKZqq17hrj85wgmH89kWnR5gdC0q9K/eTzk/Pnd GhsYFH0OwQDhTbBXDtsb/YJivyRlM/KCuZnzxYcYPeYjtGFh168WC1CkPiYJddNDaZgt YNjrfAWmC8Fjmm7ZI+AeKT4XQ3LTuuAk54bJ4n7qdz/6F8+x8aPVHZHngHqOlWYiWFB5 6Chg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@colorfullife-com.20150623.gappssmtp.com header.s=20150623 header.b=r42gTF8v; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si23000256pla.509.2018.07.12.11.54.14; Thu, 12 Jul 2018 11:54:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@colorfullife-com.20150623.gappssmtp.com header.s=20150623 header.b=r42gTF8v; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732385AbeGLTEI (ORCPT + 99 others); Thu, 12 Jul 2018 15:04:08 -0400 Received: from mail-wm0-f53.google.com ([74.125.82.53]:36133 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732344AbeGLTEH (ORCPT ); Thu, 12 Jul 2018 15:04:07 -0400 Received: by mail-wm0-f53.google.com with SMTP id s14-v6so7119864wmc.1 for ; Thu, 12 Jul 2018 11:53:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=colorfullife-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=34/lc7wzdbzbGT9TkKN03OB3zabW3AIhrTpTN2ASzm0=; b=r42gTF8vPLf/VQrS2ryNi6wPUqCZS37I451bstXsx9zygaG31Opqd7kj+SpT2IYXMD 9gmJTPDejD4pe5cBAZLeFky6h6g6qWiL6YqJ3zPXy8Mj+ijclVpacCgurg07Elxdb4jR qpiLSVRVK4AkKIpSybtgNboYbKFpROGHbcbEaMadWaf+bw2OQ3YbpIxtgBi+ABBOmd2d tDc4TcK2iyennGk2qmUvOxOTtKtasH/oXQEwSz+Xp1wkgp8ud06xE5zit/zFii0mfJcn dfa3Ij4qQed8i4uRefeHJ69dwRyTiwJR6ojeDszby8CKLUBZknxEZHzRe+4yWfTflqGz GG/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=34/lc7wzdbzbGT9TkKN03OB3zabW3AIhrTpTN2ASzm0=; b=F4QhU9xf6esAoQ/jJXLsbwgTqFIzYBdySmdWqw6b4R2dgBAkvFvR+55EnYDJHfj35U t3H8CU7Bxns1yassQVXUrwnxZy58EHXZ3thfDyx4F5nkzO3UMfsSa2CVjON8FfEi5Se1 F4M1JBKGzCkv76rmRIjs5R0atmfaM3xUc/9++t+vNrVRewa+HNxNChdFNAlpaiciBX1P WBJxm/77hioD4FBNBuMib845+n10RvlkiWZ1XtMV+RAmpUCcHxIZb322Mefd3lyggEBA cIxMFToxEA5NwYmfvABePrZ7qjO85vb6kTEWkYhqMm65r8/SwwarMoBDqyDVct+zm0QP XCuA== X-Gm-Message-State: AOUpUlF7nXVejDLBoCh7okxbrYPUVhaHTZMr7ePtAQMptCvzXsDqToEb jlFJrdD5HPF8u4X11YMk9PNDYA== X-Received: by 2002:a1c:8952:: with SMTP id l79-v6mr1982230wmd.7.1531421597373; Thu, 12 Jul 2018 11:53:17 -0700 (PDT) Received: from localhost.localdomain (p200300D993C98700CB5FA3798C189FE1.dip0.t-ipconnect.de. [2003:d9:93c9:8700:cb5f:a379:8c18:9fe1]) by smtp.googlemail.com with ESMTPSA id h5-v6sm13557841wrr.19.2018.07.12.11.53.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Jul 2018 11:53:16 -0700 (PDT) From: Manfred Spraul To: Andrew Morton , Davidlohr Bueso , Dmitry Vyukov Cc: LKML , 1vier1@web.de, Kees Cook , Manfred Spraul Subject: [PATCH 12/12] ipc/util.c: update return value of ipc_getref from int to bool Date: Thu, 12 Jul 2018 20:52:41 +0200 Message-Id: <20180712185241.4017-13-manfred@colorfullife.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180712185241.4017-1-manfred@colorfullife.com> References: <20180712185241.4017-1-manfred@colorfullife.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Manfred Spraul --- ipc/util.c | 2 +- ipc/util.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ipc/util.c b/ipc/util.c index fb69c911655a..6306eb25180b 100644 --- a/ipc/util.c +++ b/ipc/util.c @@ -461,7 +461,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); } diff --git a/ipc/util.h b/ipc/util.h index e74564fe3375..0a159f69b3bb 100644 --- a/ipc/util.h +++ b/ipc/util.h @@ -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)); -- 2.17.1