[Ocfs2-devel] [PATCH 01/39] ocfs2: POSIX file locks support

Mark Fasheh mfasheh at suse.com
Tue Oct 7 13:09:19 PDT 2008


On Wed, Oct 01, 2008 at 11:11:44PM -0700, Andrew Morton wrote:
> > On Wed, 24 Sep 2008 15:00:42 -0700 Mark Fasheh <mfasheh at suse.com> wrote:
> > +int ocfs2_stack_supports_plocks(void)
> > +{
> > +	return !!(active_stack && active_stack->sp_ops->plock);
> > +}
> 
> It's pointless doing !! on something which is already 0 or 1.

Sure - the following patch is now on the 'merge_window' branch of ocfs2.git.

Also, thanks for all the review you did on these.
	--Mark

--
Mark Fasheh

From: Mark Fasheh <mfasheh at suse.com>

ocfs2: Remove pointless !!

ocfs2_stack_supports_plocks() doesn't need this to properly return a zero or
one value.

Signed-off-by: Mark Fasheh <mfasheh at suse.com>
---
 fs/ocfs2/stackglue.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c
index 7150f5d..68b668b 100644
--- a/fs/ocfs2/stackglue.c
+++ b/fs/ocfs2/stackglue.c
@@ -290,7 +290,7 @@ EXPORT_SYMBOL_GPL(ocfs2_dlm_dump_lksb);
 
 int ocfs2_stack_supports_plocks(void)
 {
-	return !!(active_stack && active_stack->sp_ops->plock);
+	return active_stack && active_stack->sp_ops->plock;
 }
 EXPORT_SYMBOL_GPL(ocfs2_stack_supports_plocks);
 
-- 
1.5.4.1




More information about the Ocfs2-devel mailing list