diff options
author | Theodore Ts'o <tytso@mit.edu> | 2013-01-01 13:28:27 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2013-01-01 13:28:27 -0500 |
commit | e3507739e4185bdb2394928eb6479e48f4e690a8 (patch) | |
tree | 96606990005080b07170d45807c94a157600c027 | |
parent | 2508eaa71e8bbe93155052ded448e5e78d213715 (diff) | |
download | e2fsprogs-e3507739e4185bdb2394928eb6479e48f4e690a8.tar.gz |
Fix gcc -Wall nits
This fixes the last set of gcc -Wall complaints.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r-- | debugfs/extent_inode.c | 10 | ||||
-rw-r--r-- | debugfs/htree.c | 2 | ||||
-rw-r--r-- | debugfs/zap.c | 5 | ||||
-rw-r--r-- | e2fsck/pass1.c | 3 | ||||
-rw-r--r-- | e2fsck/recovery.c | 8 | ||||
-rw-r--r-- | e2fsck/rehash.c | 3 | ||||
-rw-r--r-- | e2fsck/unix.c | 8 | ||||
-rw-r--r-- | e2fsck/util.c | 6 | ||||
-rw-r--r-- | lib/e2p/getversion.c | 2 | ||||
-rw-r--r-- | lib/ext2fs/blkmap64_rb.c | 3 | ||||
-rw-r--r-- | lib/ext2fs/imager.c | 8 | ||||
-rw-r--r-- | lib/ext2fs/openfs.c | 5 | ||||
-rw-r--r-- | misc/e2initrd_helper.c | 8 | ||||
-rw-r--r-- | misc/filefrag.c | 1 | ||||
-rw-r--r-- | misc/tune2fs.c | 2 |
15 files changed, 22 insertions, 52 deletions
diff --git a/debugfs/extent_inode.c b/debugfs/extent_inode.c index 69628a9e..d726b2b6 100644 --- a/debugfs/extent_inode.c +++ b/debugfs/extent_inode.c @@ -66,9 +66,8 @@ static char *orig_prompt, *extent_prompt; void do_extent_open(int argc, char *argv[]) { - struct ext3_extent_header *eh; ext2_ino_t inode; - int i, ret; + int ret; errcode_t retval; char *cp; @@ -220,7 +219,6 @@ void do_delete_node(int argc, char *argv[]) { struct ext2fs_extent extent; errcode_t retval; - int err; if (common_extent_args_process(argc, argv, 1, 1, "delete_node", "", CHECK_FS_RW | CHECK_FS_BITMAPS)) @@ -286,8 +284,6 @@ void do_replace_node(int argc, char *argv[]) void do_split_node(int argc, char *argv[]) { errcode_t retval; - struct ext2fs_extent extent; - int err; if (common_extent_args_process(argc, argv, 1, 1, "split_node", "", CHECK_FS_RW | CHECK_FS_BITMAPS)) @@ -465,8 +461,6 @@ void do_print_all(int argc, char **argv) void do_fix_parents(int argc, char **argv) { - struct ext2fs_extent extent; - struct ext2_extent_info info; errcode_t retval; if (common_extent_args_process(argc, argv, 1, 1, "fix_parents", "", @@ -515,9 +509,7 @@ void do_info(int argc, char **argv) void do_goto_block(int argc, char **argv) { - struct ext2fs_extent extent; errcode_t retval; - int op = EXT2_EXTENT_NEXT_LEAF; blk64_t blk; int level = 0, err; diff --git a/debugfs/htree.c b/debugfs/htree.c index 29ddf9c5..24f8250c 100644 --- a/debugfs/htree.c +++ b/debugfs/htree.c @@ -201,7 +201,6 @@ void do_htree_dump(int argc, char *argv[]) char *buf = NULL; struct ext2_dx_root_info *rootnode; struct ext2_dx_entry *ent; - struct ext2_dx_countlimit *limit; errcode_t errcode; if (check_fs_open(argv[0])) @@ -255,7 +254,6 @@ void do_htree_dump(int argc, char *argv[]) fprintf(pager, "\t Flags: %d\n", rootnode->unused_flags); ent = (struct ext2_dx_entry *) (buf + 24 + rootnode->info_length); - limit = (struct ext2_dx_countlimit *) ent; htree_dump_int_node(current_fs, ino, &inode, rootnode, ent, buf + current_fs->blocksize, diff --git a/debugfs/zap.c b/debugfs/zap.c index 3f3620b4..4a1afbe0 100644 --- a/debugfs/zap.c +++ b/debugfs/zap.c @@ -32,9 +32,7 @@ void do_zap_block(int argc, char *argv[]) ext2_ino_t inode; errcode_t errcode; blk64_t block; - int retval; char *file = NULL; - char *in_file = NULL; int c, err; int offset = -1; int length = -1; @@ -171,14 +169,11 @@ errout: void do_dump_block(int argc, char *argv[]) { - unsigned long pattern = 0; unsigned char *buf; ext2_ino_t inode; errcode_t errcode; blk64_t block; - int retval; char *file = NULL; - char *in_file = NULL; int c, err, i, j; int suppress = -1; diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index a8231f49..9c375154 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -274,7 +274,7 @@ static void check_ea_in_inode(e2fsck_t ctx, struct problem_context *pctx) struct ext2_super_block *sb = ctx->fs->super; struct ext2_inode_large *inode; struct ext2_ext_attr_entry *entry; - char *start, *end; + char *start; unsigned int storage_size, remain; int problem = 0; @@ -283,7 +283,6 @@ static void check_ea_in_inode(e2fsck_t ctx, struct problem_context *pctx) inode->i_extra_isize; start = ((char *) inode) + EXT2_GOOD_OLD_INODE_SIZE + inode->i_extra_isize + sizeof(__u32); - end = (char *) inode + EXT2_INODE_SIZE(ctx->fs->super); entry = (struct ext2_ext_attr_entry *) start; /* scan all entry's headers first */ diff --git a/e2fsck/recovery.c b/e2fsck/recovery.c index fcacabb4..34c9e599 100644 --- a/e2fsck/recovery.c +++ b/e2fsck/recovery.c @@ -283,12 +283,9 @@ int journal_recover(journal_t *journal) int journal_skip_recovery(journal_t *journal) { int err; - journal_superblock_t * sb; - struct recovery_info info; memset (&info, 0, sizeof(info)); - sb = journal->j_superblock; err = do_one_pass(journal, &info, PASS_SCAN); @@ -363,11 +360,6 @@ static int do_one_pass(journal_t *journal, int tag_bytes = journal_tag_bytes(journal); __u32 crc32_sum = ~0; /* Transactional Checksums */ - /* Precompute the maximum metadata descriptors in a descriptor block */ - int MAX_BLOCKS_PER_DESC; - MAX_BLOCKS_PER_DESC = ((journal->j_blocksize-sizeof(journal_header_t)) - / tag_bytes); - /* * First thing is to establish what we expect to find in the log * (in terms of transaction IDs), and where (in terms of log diff --git a/e2fsck/rehash.c b/e2fsck/rehash.c index aa7f4069..1f0a0b8f 100644 --- a/e2fsck/rehash.c +++ b/e2fsck/rehash.c @@ -828,7 +828,7 @@ void e2fsck_rehash_directories(e2fsck_t ctx) struct dir_info_iter * dirinfo_iter = 0; ext2_ino_t ino; errcode_t retval; - int cur, max, all_dirs, dir_index, first = 1; + int cur, max, all_dirs, first = 1; init_resource_track(&rtrack, ctx->fs->io); all_dirs = ctx->options & E2F_OPT_COMPRESS_DIRS; @@ -840,7 +840,6 @@ void e2fsck_rehash_directories(e2fsck_t ctx) clear_problem_context(&pctx); - dir_index = ctx->fs->super->s_feature_compat & EXT2_FEATURE_COMPAT_DIR_INDEX; cur = 0; if (all_dirs) { dirinfo_iter = e2fsck_dir_info_iter_begin(ctx); diff --git a/e2fsck/unix.c b/e2fsck/unix.c index 48db71ab..6471592a 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -204,8 +204,7 @@ static void show_stats(e2fsck_t ctx) ctx->fs_blockdev_count), ctx->fs_blockdev_count); log_out(ctx, P_("%12u fifo\n", "%12u fifos\n", ctx->fs_fifo_count), ctx->fs_fifo_count); - log_out(ctx, P_("%12u link\n", "%12u links\n", - ctx->fs_links_count - dir_links), + log_out(ctx, P_("%12u link\n", "%12u links\n", num_links), ctx->fs_links_count - dir_links); log_out(ctx, P_("%12u symbolic link", "%12u symbolic links", ctx->fs_symlinks_count), ctx->fs_symlinks_count); @@ -217,9 +216,8 @@ static void show_stats(e2fsck_t ctx) ctx->fs_sockets_count), ctx->fs_sockets_count); log_out(ctx, "------------\n"); - log_out(ctx, P_("%12u file\n", "%12u files\n", - ctx->fs_total_count - dir_links), - ctx->fs_total_count - dir_links); + log_out(ctx, P_("%12u file\n", "%12u files\n", num_files), + num_files); } static void check_mount(e2fsck_t ctx) diff --git a/e2fsck/util.c b/e2fsck/util.c index f3ba6453..a6b9e864 100644 --- a/e2fsck/util.c +++ b/e2fsck/util.c @@ -616,7 +616,7 @@ int ext2_file_type(unsigned int mode) errcode_t e2fsck_zero_blocks(ext2_filsys fs, blk_t blk, int num, blk_t *ret_blk, int *ret_count) { - int j, count, next_update, next_update_incr; + int j, count; static char *buf; errcode_t retval; @@ -639,10 +639,6 @@ errcode_t e2fsck_zero_blocks(ext2_filsys fs, blk_t blk, int num, memset(buf, 0, fs->blocksize * STRIDE_LENGTH); } /* OK, do the write loop */ - next_update = 0; - next_update_incr = num / 100; - if (next_update_incr < 1) - next_update_incr = 1; for (j = 0; j < num; j += STRIDE_LENGTH, blk += STRIDE_LENGTH) { count = num - j; if (count > STRIDE_LENGTH) diff --git a/lib/e2p/getversion.c b/lib/e2p/getversion.c index e7c6feca..71031ffc 100644 --- a/lib/e2p/getversion.c +++ b/lib/e2p/getversion.c @@ -31,7 +31,7 @@ int getversion (int fd, unsigned long * version) r = ioctl (fd, EXT2_IOC_GETVERSION, &ver); *version = ver; - return 0; + return r; #else /* ! HAVE_EXT2_IOCTLS */ extern int errno; errno = EOPNOTSUPP; diff --git a/lib/ext2fs/blkmap64_rb.c b/lib/ext2fs/blkmap64_rb.c index 6007238c..9a8938a4 100644 --- a/lib/ext2fs/blkmap64_rb.c +++ b/lib/ext2fs/blkmap64_rb.c @@ -677,12 +677,11 @@ static errcode_t rb_set_bmap_range(ext2fs_generic_bitmap bitmap, unsigned char *cp = in; size_t i; int first_set = -1; - int ret; bp = (struct ext2fs_rb_private *) bitmap->private; for (i = 0; i < num; i++) { - if (i & 7 == 0) { + if ((i & 7) == 0) { unsigned char c = cp[i/8]; if (c == 0xFF) { if (first_set == -1) diff --git a/lib/ext2fs/imager.c b/lib/ext2fs/imager.c index a0fb81e4..7f3b25b5 100644 --- a/lib/ext2fs/imager.c +++ b/lib/ext2fs/imager.c @@ -279,7 +279,7 @@ errout: errcode_t ext2fs_image_bitmap_write(ext2_filsys fs, int fd, int flags) { ext2fs_generic_bitmap bmap; - errcode_t err, retval; + errcode_t retval; ssize_t actual; __u32 itr, cnt, size; int c, total_size; @@ -292,7 +292,6 @@ errcode_t ext2fs_image_bitmap_write(ext2_filsys fs, int fd, int flags) return retval; } bmap = fs->inode_map; - err = EXT2_ET_MAGIC_INODE_BITMAP; itr = 1; cnt = EXT2_INODES_PER_GROUP(fs->super) * fs->group_desc_count; size = (EXT2_INODES_PER_GROUP(fs->super) / 8); @@ -303,7 +302,6 @@ errcode_t ext2fs_image_bitmap_write(ext2_filsys fs, int fd, int flags) return retval; } bmap = fs->block_map; - err = EXT2_ET_MAGIC_BLOCK_BITMAP; itr = fs->super->s_first_data_block; cnt = EXT2_BLOCKS_PER_GROUP(fs->super) * fs->group_desc_count; size = EXT2_BLOCKS_PER_GROUP(fs->super) / 8; @@ -356,7 +354,7 @@ errcode_t ext2fs_image_bitmap_write(ext2_filsys fs, int fd, int flags) errcode_t ext2fs_image_bitmap_read(ext2_filsys fs, int fd, int flags) { ext2fs_generic_bitmap bmap; - errcode_t err, retval; + errcode_t retval; __u32 itr, cnt; char buf[1024]; unsigned int size; @@ -369,7 +367,6 @@ errcode_t ext2fs_image_bitmap_read(ext2_filsys fs, int fd, int flags) return retval; } bmap = fs->inode_map; - err = EXT2_ET_MAGIC_INODE_BITMAP; itr = 1; cnt = EXT2_INODES_PER_GROUP(fs->super) * fs->group_desc_count; size = (EXT2_INODES_PER_GROUP(fs->super) / 8); @@ -380,7 +377,6 @@ errcode_t ext2fs_image_bitmap_read(ext2_filsys fs, int fd, int flags) return retval; } bmap = fs->block_map; - err = EXT2_ET_MAGIC_BLOCK_BITMAP; itr = fs->super->s_first_data_block; cnt = EXT2_BLOCKS_PER_GROUP(fs->super) * fs->group_desc_count; size = EXT2_BLOCKS_PER_GROUP(fs->super) / 8; diff --git a/lib/ext2fs/openfs.c b/lib/ext2fs/openfs.c index 482e4aba..d483bd95 100644 --- a/lib/ext2fs/openfs.c +++ b/lib/ext2fs/openfs.c @@ -99,10 +99,11 @@ errcode_t ext2fs_open2(const char *name, const char *io_options, errcode_t retval; unsigned long i, first_meta_bg; __u32 features; - unsigned int groups_per_block, blocks_per_group, io_flags; + unsigned int blocks_per_group, io_flags; blk64_t group_block, blk; char *dest, *cp; #ifdef WORDS_BIGENDIAN + unsigned int groups_per_block; struct ext2_group_desc *gdp; int j; #endif @@ -332,7 +333,9 @@ errcode_t ext2fs_open2(const char *name, const char *io_options, if (group_block == 0 && fs->blocksize == 1024) group_block = 1; /* Deal with 1024 blocksize && bigalloc */ dest = (char *) fs->group_desc; +#ifdef WORDS_BIGENDIAN groups_per_block = EXT2_DESC_PER_BLOCK(fs->super); +#endif if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) first_meta_bg = fs->super->s_first_meta_bg; else diff --git a/misc/e2initrd_helper.c b/misc/e2initrd_helper.c index b2f39bc4..aa97557c 100644 --- a/misc/e2initrd_helper.c +++ b/misc/e2initrd_helper.c @@ -39,7 +39,7 @@ extern char *optarg; #include "../version.h" #include "nls-enable.h" -const char * program_name = "get_fstab"; +const char * program_name = "e2initrd_helper"; char * device_name; static int open_flag; static int root_type; @@ -327,7 +327,7 @@ static void PRS(int argc, char **argv) usage(); device_name = blkid_get_devname(NULL, argv[optind], NULL); if (!device_name) { - com_err("tune2fs", 0, _("Unable to resolve '%s'"), + com_err(program_name, 0, _("Unable to resolve '%s'"), argv[optind]); exit(1); } @@ -342,6 +342,10 @@ static void get_root_type(ext2_filsys fs) int ret; retval = get_file(fs, "/etc/fstab", &file); + if (retval) { + com_err(program_name, retval, "couldn't open /etc/fstab"); + exit(1); + } while (!mem_file_eof(&file)) { buf = get_line(&file); diff --git a/misc/filefrag.c b/misc/filefrag.c index 13f5e151..ee03a07a 100644 --- a/misc/filefrag.c +++ b/misc/filefrag.c @@ -336,7 +336,6 @@ static void frag_report(const char *filename) static struct statfs fsinfo; ext2fs_struct_stat st; int blk_shift; - int bs; long fd; unsigned long numblocks; int data_blocks_per_cyl = 1; diff --git a/misc/tune2fs.c b/misc/tune2fs.c index 84fe4cea..2c8b9e89 100644 --- a/misc/tune2fs.c +++ b/misc/tune2fs.c @@ -1092,7 +1092,7 @@ static void parse_tune2fs_options(int argc, char **argv) *io_options++ = 0; device_name = blkid_get_devname(NULL, argv[optind], NULL); if (!device_name) { - com_err("tune2fs", 0, _("Unable to resolve '%s'"), + com_err(program_name, 0, _("Unable to resolve '%s'"), argv[optind]); exit(1); } |