Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753255AbbBQXa7 (ORCPT ); Tue, 17 Feb 2015 18:30:59 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:37353 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751522AbbBQXa6 (ORCPT ); Tue, 17 Feb 2015 18:30:58 -0500 Date: Tue, 17 Feb 2015 15:30:57 -0800 From: Andrew Morton To: Daeseok Youn Cc: mfasheh@suse.com, jlbec@evilplan.org, ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] ocfs2: remove useless if statement Message-Id: <20150217153057.c911fc895051343d69a78423@linux-foundation.org> In-Reply-To: <20150217071350.GA9568@devel.8.8.4.4> References: <20150217071350.GA9568@devel.8.8.4.4> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1123 Lines: 35 On Tue, 17 Feb 2015 16:13:50 +0900 Daeseok Youn wrote: > The Local variable "i" in for loop is always less then > O2CB_MAP_STABILIZE_COUNT. > > Signed-off-by: Daeseok Youn > --- > fs/ocfs2/stack_o2cb.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/ocfs2/stack_o2cb.c b/fs/ocfs2/stack_o2cb.c > index 1724d43..813d726 100644 > --- a/fs/ocfs2/stack_o2cb.c > +++ b/fs/ocfs2/stack_o2cb.c > @@ -295,8 +295,8 @@ static int o2cb_cluster_check(void) > set_bit(node_num, netmap); > if (!memcmp(hbmap, netmap, sizeof(hbmap))) > return 0; > - if (i < O2CB_MAP_STABILIZE_COUNT) > - msleep(1000); > + > + msleep(1000); > } I assume the code was intended to do if (i < O2CB_MAP_STABILIZE_COUNT - 1) msleep(1000); to avoid a pointless 1-second delay when the operation times out. -- 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/