Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755621Ab3CEJgE (ORCPT ); Tue, 5 Mar 2013 04:36:04 -0500 Received: from g1t0028.austin.hp.com ([15.216.28.35]:32317 "EHLO g1t0028.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755473Ab3CEJgB (ORCPT ); Tue, 5 Mar 2013 04:36:01 -0500 Message-ID: <1362476157.2225.51.camel@buesod1.americas.hpqcorp.net> Subject: [PATCH v2 1/4] ipc: remove bogus lock comment for ipc_checkid From: Davidlohr Bueso To: Linus Torvalds , Rik van Riel Cc: Emmanuel Benisty , "Vinod, Chegu" , "Low, Jason" , Peter Zijlstra , "H. Peter Anvin" , Andrew Morton , aquini@redhat.com, Michel Lespinasse , Ingo Molnar , Larry Woodman , Linux Kernel Mailing List , Steven Rostedt , Thomas Gleixner Date: Tue, 05 Mar 2013 01:35:57 -0800 Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.4.4 (3.4.4-2.fc17) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1056 Lines: 42 There is no reason to be holding the ipc lock while reading ipcp->seq, hence remove misleading comment. Also simplify the return value for the function. Signed-off-by: Davidlohr Bueso --- ipc/util.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ipc/util.h b/ipc/util.h index eeb79a1..ac1480a 100644 --- a/ipc/util.h +++ b/ipc/util.h @@ -150,14 +150,9 @@ static inline int ipc_buildid(int id, int seq) return SEQ_MULTIPLIER * seq + id; } -/* - * Must be called with ipcp locked - */ static inline int ipc_checkid(struct kern_ipc_perm *ipcp, int uid) { - if (uid / SEQ_MULTIPLIER != ipcp->seq) - return 1; - return 0; + return uid / SEQ_MULTIPLIER != ipcp->seq; } static inline void ipc_lock_by_ptr(struct kern_ipc_perm *perm) -- 1.7.11.7 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/