ext4_utils: clean up some warnings.
Change-Id: Ia9761e5168cfe6baabc0105ea76d5575fc378f48
diff --git a/ext4_utils/contents.c b/ext4_utils/contents.c
index 6300680..4d45f67 100644
--- a/ext4_utils/contents.c
+++ b/ext4_utils/contents.c
@@ -190,7 +190,7 @@
}
/* Creates a file on disk. Returns the inode number of the new file */
-u32 make_link(const char *filename, const char *link)
+u32 make_link(const char *link)
{
struct ext4_inode *inode;
u32 inode_num;
diff --git a/ext4_utils/contents.h b/ext4_utils/contents.h
index 35867fd..751c0b3 100644
--- a/ext4_utils/contents.h
+++ b/ext4_utils/contents.h
@@ -35,7 +35,7 @@
u32 make_directory(u32 dir_inode_num, u32 entries, struct dentry *dentries,
u32 dirs);
u32 make_file(const char *filename, u64 len);
-u32 make_link(const char *filename, const char *link);
+u32 make_link(const char *link);
int inode_set_permissions(u32 inode_num, u16 mode, u16 uid, u16 gid, u32 mtime);
int inode_set_selinux(u32 inode_num, const char *secon);
#endif
diff --git a/ext4_utils/ext2simg.c b/ext4_utils/ext2simg.c
index f4b6c93..7b63836 100644
--- a/ext4_utils/ext2simg.c
+++ b/ext4_utils/ext2simg.c
@@ -57,7 +57,6 @@
{
off64_t ret;
struct ext4_super_block sb;
- unsigned int i;
ret = lseek64(fd, 1024, SEEK_SET);
if (ret < 0)
diff --git a/ext4_utils/ext4fixup.c b/ext4_utils/ext4fixup.c
index f0124f8..d271116 100644
--- a/ext4_utils/ext4fixup.c
+++ b/ext4_utils/ext4fixup.c
@@ -200,7 +200,6 @@
{
off64_t ret;
struct ext4_super_block sb;
- unsigned int i;
read_sb(fd, &sb);
@@ -510,7 +509,7 @@
return count;
}
-static int get_extent_ents(int fd, struct ext4_extent_header *ext_hdr, unsigned long long *block_list)
+static int get_extent_ents(struct ext4_extent_header *ext_hdr, unsigned long long *block_list)
{
int i, j;
struct ext4_extent *extent;
@@ -560,7 +559,7 @@
tmp_ext_hdr = (struct ext4_extent_header *)block;
if (tmp_ext_hdr->eh_depth == 0) {
- get_extent_ents(fd, tmp_ext_hdr, block_list); /* leaf node, fill in block_list */
+ get_extent_ents(tmp_ext_hdr, block_list); /* leaf node, fill in block_list */
} else {
get_extent_idx(fd, tmp_ext_hdr, block_list); /* recurse down the tree */
}
@@ -581,7 +580,7 @@
}
if (extent_hdr->eh_depth == 0) {
- get_extent_ents(fd, (struct ext4_extent_header *)inode->i_block, block_list);
+ get_extent_ents((struct ext4_extent_header *)inode->i_block, block_list);
return 0;
}
diff --git a/ext4_utils/indirect.c b/ext4_utils/indirect.c
index 3d97ec8..cd826ac 100644
--- a/ext4_utils/indirect.c
+++ b/ext4_utils/indirect.c
@@ -387,7 +387,7 @@
}
static struct block_allocation *do_inode_allocate_indirect(
- struct ext4_inode *inode, u32 block_len)
+ u32 block_len)
{
u32 indirect_len = indirect_blocks_needed(block_len);
@@ -408,7 +408,7 @@
u32 block_len = DIV_ROUND_UP(len, info.block_size);
u32 indirect_len = indirect_blocks_needed(block_len);
- alloc = do_inode_allocate_indirect(inode, block_len);
+ alloc = do_inode_allocate_indirect(block_len);
if (alloc == NULL) {
error("failed to allocate extents for %lu bytes", len);
return;
@@ -494,7 +494,7 @@
u32 block_len = DIV_ROUND_UP(len, info.block_size);
u8 *data = NULL;
- alloc = do_inode_allocate_indirect(inode, block_len);
+ alloc = do_inode_allocate_indirect(block_len);
if (alloc == NULL) {
error("failed to allocate extents for %lu bytes", len);
return NULL;
diff --git a/ext4_utils/make_ext4fs.c b/ext4_utils/make_ext4fs.c
index b2d1426..17b7ae6 100644
--- a/ext4_utils/make_ext4fs.c
+++ b/ext4_utils/make_ext4fs.c
@@ -258,7 +258,7 @@
free(subdir_full_path);
free(subdir_dir_path);
} else if (dentries[i].file_type == EXT4_FT_SYMLINK) {
- entry_inode = make_link(dentries[i].full_path, dentries[i].link);
+ entry_inode = make_link(dentries[i].link);
} else {
error("unknown file type on %s", dentries[i].path);
entry_inode = 0;
@@ -451,7 +451,6 @@
u16 root_mode;
char *mountpoint;
char *directory = NULL;
- int ret;
if (setjmp(setjmp_env))
return EXIT_FAILURE; /* Handle a call to longjmp() */