xfs
[Top] [All Lists]

[PATCH] remove remaining useless if-before-frees

To: xfs mailing list <xfs@xxxxxxxxxxx>
Subject: [PATCH] remove remaining useless if-before-frees
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Thu, 28 May 2009 13:22:25 -0500
User-agent: Thunderbird 2.0.0.21 (X11/20090320)
Just janitorial work, but this removes the last couple
if-before-frees I could find in xfs with the tool from

http://git.savannah.gnu.org/cgit/gnulib.git/plain/build-aux/useless-if-before-free

Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxxx>
---

Index: linux-2.6/fs/xfs/xfs_da_btree.c
===================================================================
--- linux-2.6.orig/fs/xfs/xfs_da_btree.c
+++ linux-2.6/fs/xfs/xfs_da_btree.c
@@ -2116,9 +2116,7 @@ xfs_da_do_buf(
                        goto exit1;
                }
        }
-       if (bplist) {
-               kmem_free(bplist);
-       }
+       kmem_free(bplist);
        if (mapp != &map) {
                kmem_free(mapp);
        }
Index: linux-2.6/fs/xfs/xfs_mount.c
===================================================================
--- linux-2.6.orig/fs/xfs/xfs_mount.c
+++ linux-2.6/fs/xfs/xfs_mount.c
@@ -211,8 +211,7 @@ xfs_free_perag(
                int     agno;
 
                for (agno = 0; agno < mp->m_maxagi; agno++)
-                       if (mp->m_perag[agno].pagb_list)
-                               kmem_free(mp->m_perag[agno].pagb_list);
+                       kmem_free(mp->m_perag[agno].pagb_list);
                kmem_free(mp->m_perag);
        }
 }

<Prev in Thread] Current Thread [Next in Thread>