Btrfs: trivial sparse fixes

Fix a bunch of trivial sparse complaints.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 6cd4e92..ab07557 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -2749,7 +2749,6 @@
 	BUG_ON(slot < 0);
 
 	if (slot != nritems) {
-		int i;
 		unsigned int old_data = btrfs_item_end_nr(leaf, slot);
 
 		if (old_data < data_end) {
@@ -2913,7 +2912,6 @@
 	nritems = btrfs_header_nritems(leaf);
 
 	if (slot + nr != nritems) {
-		int i;
 		int data_end = leaf_data_end(root, leaf);
 
 		memmove_extent_buffer(leaf, btrfs_leaf_data(leaf) +
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 7ca89c4..239e7c9 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -3400,10 +3400,8 @@
 	}
 	/* at this point we can safely release the extent buffer */
 	num_pages = num_extent_pages(eb->start, eb->len);
-	for (i = 0; i < num_pages; i++) {
-		struct page *page = extent_buffer_page(eb, i);
-		page_cache_release(page);
-	}
+	for (i = 0; i < num_pages; i++)
+		page_cache_release(extent_buffer_page(eb, i));
 	rb_erase(&eb->rb_node, &tree->buffer);
 	__free_extent_buffer(eb);
 out:
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 59b64c7..f84b5f6 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -739,7 +739,7 @@
 		goto out;
 	}
 	btrfs_end_transaction(trans, root);
-	file->private_data = 0;
+	file->private_data = NULL;
 
 	mutex_lock(&root->fs_info->trans_mutex);
 	root->fs_info->open_ioctl_trans--;
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index 1cf4f4f..61af5d8 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -254,7 +254,7 @@
 	wait_for_completion(&fs->kobj_unregister);
 }
 
-int btrfs_init_sysfs()
+int btrfs_init_sysfs(void)
 {
 	btrfs_kset = kset_create_and_add("btrfs", NULL, fs_kobj);
 	if (!btrfs_kset)
@@ -262,7 +262,7 @@
 	return 0;
 }
 
-void btrfs_exit_sysfs()
+void btrfs_exit_sysfs(void)
 {
 	kset_unregister(btrfs_kset);
 }
@@ -289,12 +289,12 @@
 	return;
 }
 
-int btrfs_init_sysfs()
+int btrfs_init_sysfs(void)
 {
 	return 0;
 }
 
-void btrfs_exit_sysfs()
+void btrfs_exit_sysfs(void)
 {
 	return;
 }