[PATCH] remove remaining useless if-before-frees

Eric Sandeen sandeen at sandeen.net
Thu May 28 13:22:25 CDT 2009


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 at sandeen.net>
---

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);
 	}
 }




More information about the xfs mailing list