misc: clean up compiler warnings
PATCH 1/1 misc: clean up compiler warnings
Fix several types of compiler warnings (unused variables/labels), uninitialized variables, etc that are hit with gcc -Wall.
--- debugfs/debugfs.c | 5 ++--- debugfs/debugfs.h | 1 + debugfs/dump.c | 2 ++ e2fsck/message.c | 1 - e2fsck/pass1.c | 5 +++-- e2fsck/pass2.c | 3 ++- e2fsck/pass5.c | 1 - e2fsck/rehash.c | 3 ++- e2fsprogs.spec.in | 1 + lib/blkid/probe.c | 7 ++++--- lib/e2p/ls.c | 4 ++-- lib/ext2fs/ext2fs.h | 3 ++- lib/ext2fs/fileio.c | 2 +- lib/ext2fs/openfs.c | 1 - lib/ext2fs/progress.c | 2 -- lib/ext2fs/res_gdt.c | 2 +- lib/ext2fs/unix_io.c | 2 ++ misc/badblocks.c | 2 ++ misc/e2freefrag.c | 4 ++-- misc/e2undo.c | 9 ++++----- misc/tune2fs.c | 5 ++--- 21 files changed, 35 insertions(+), 30 deletions(-)
debugfs/debugfs.c +2 -3
@@ -855,7 +855,7 @@ void do_stat(int argc, char *argv[])return ; } -void do_dump_extents (int argc,char *argv[]) +void do_dump_extents (int argc,char **argv) {struct ext2_inode inode;ext2_ino_t ino;
@@ -876,8 +876,7 @@ void do_dump_extents(int argc, char *argv[]) } } -if (argc != optind+1 ) { - print_usage: +if (argc != optind +1 ) {com_err (0 ,0 ,"Usage: dump_extents [-n] [-l] file" );return ; }
debugfs/debugfs.h +1 -0
@@ -103,6 +103,7 @@ extern void do_unlink(int argc, char **argv);extern void do_find_free_block (int argc,char **argv);extern void do_find_free_inode (int argc,char **argv);extern void do_stat (int argc,char **argv); +extern void do_dump_extents (int argc,char **argv);extern void do_chroot (int argc,char **argv);extern void do_clri (int argc,char **argv);
debugfs/dump.c +2 -0
@@ -5,7 +5,9 @@* under the terms of the GNU Public License. */ +#ifndef _GNU_SOURCE#define _GNU_SOURCE/* for O_LARGEFILE */ +#endif #include <stdio.h> #include <unistd.h>
e2fsck/message.c +0 -1
@@ -263,7 +263,6 @@ static _INLINE_ void expand_inode_expression(ext2_filsys fs, char ch, {struct ext2_inode *inode;struct ext2_inode_large *large_inode; -time_t t;if (!ctx || !ctx->inode) goto no_inode;
e2fsck/pass1.c +3 -2
@@ -404,7 +404,7 @@ static void check_is_really_dir(e2fsck_t ctx, struct problem_context *pctx,struct ext2_dir_entry *dirent;const char *old_op;errcode_t retval; -blk64_t blk, first_dir_blk; +blk64_t blk;unsigned int i, rec_len, not_device =0 ;int extent_fs;
@@ -436,7 +436,8 @@ static void check_is_really_dir(e2fsck_t ctx, struct problem_context *pctx,* with it. */ - extent_fs = (ctx->fs->super->s_feature_incompat &EXT3_FEATURE_INCOMPAT_EXTENTS ); + extent_fs = (ctx->fs->super->s_feature_incompat & +EXT3_FEATURE_INCOMPAT_EXTENTS );if (extent_fs && (inode->i_flags &EXT4_EXTENTS_FL )) {/* extent mapped */ if (ext2fs_bmap2(ctx->fs, pctx->ino, inode, 0, 0, 0, 0,
e2fsck/pass2.c +2 -1
@@ -404,7 +404,8 @@ static int check_dotdot(e2fsck_t ctx,struct ext2_dir_entry *dirent, ext2_ino_t ino, struct problem_context *pctx) { - int rec_len, problem = 0; + int problem = 0; +unsigned int rec_len;if (!dirent->inode) problem =PR_2_MISSING_DOT_DOT ;
e2fsck/pass5.c +0 -1
@@ -77,7 +77,6 @@ static void e2fsck_discard_blocks(e2fsck_t ctx, io_manager manager, blk64_t start, blk64_t count) {ext2_filsys fs = ctx->fs; -int ret =0 ;/* * If the filesystem has changed it means that there was an corruption
e2fsck/rehash.c +2 -1
@@ -430,12 +430,13 @@ static errcode_t copy_dir_entries(e2fsck_t ctx,return retval; dirent = (struct ext2_dir_entry *) block_start; prev_rec_len =0 ; + rec_len =0 ; left = fs->blocksize; slack = fd->compress ?12 : (fs->blocksize * ctx->htree_slack_percentage)/100 ;if (slack <12 ) slack =12 ; -for (i=0 ; i < fd->num_array; i++) { +for (i =0 ; i < fd->num_array; i++) { ent = fd->harray + i;if (ent->dir->inode ==0 )continue ;
e2fsprogs.spec.in +1 -0
@@ -212,6 +212,7 @@ exit 0 %{_includedir}/blkid %{_includedir}/e2p %{_includedir}/et +%{_includedir}/com_err.h %{_includedir}/ext2fs %{_includedir}/ss %{_includedir}/uuid
lib/blkid/probe.c +4 -3
@@ -248,7 +248,7 @@ static int linux_version_code() {#ifdef __linux__struct utsname ut; - static version_code = -1; +static int version_code =-1 ;int major, minor, rev;char *endptr;const char *cp;
@@ -1175,7 +1175,7 @@ static int probe_hfs(struct blkid_probe *probe __BLKID_ATTR((unused)),sprintf (uuid_str,"%016llX" , uuid);blkid_set_tag (probe->dev,"UUID" , uuid_str,0 ); } -blkid_set_tag (probe->dev,"LABEL" , hfs->label, hfs->label_len); +blkid_set_tag (probe->dev,"LABEL" , (char *)hfs->label, hfs->label_len);return 0 ; }
@@ -1296,7 +1296,8 @@ static int probe_hfsplus(struct blkid_probe *probe,return 0 ; label_len =blkid_be16 (key->unicode_len) *2 ; -unicode_16be_to_utf8 (label,sizeof (label), key->unicode, label_len); +unicode_16be_to_utf8 ((unsigned char *)label,sizeof (label), + key->unicode, label_len);blkid_set_tag (probe->dev,"LABEL" , label,0 );return 0 ; }
lib/e2p/ls.c +2 -2
@@ -383,7 +383,7 @@ void list_super2(struct ext2_super_block * sb, FILE *f) tm = sb->s_first_error_time;fprintf (f,"First error time: %s" ,ctime (&tm));memset (buf,0 ,sizeof (buf)); -strncpy (buf, sb->s_first_error_func, +strncpy (buf, (char *)sb->s_first_error_func,sizeof (sb->s_first_error_func));fprintf (f,"First error function: %s\n" , buf); fprintf(f, "First error line #: %u\n",
@@ -397,7 +397,7 @@ void list_super2(struct ext2_super_block * sb, FILE *f) tm = sb->s_last_error_time;fprintf (f,"Last error time: %s" ,ctime (&tm));memset (buf,0 ,sizeof (buf)); -strncpy (buf, sb->s_last_error_func, +strncpy (buf, (char *)sb->s_last_error_func,sizeof (sb->s_last_error_func));fprintf (f,"Last error function: %s\n" , buf); fprintf(f, "Last error line #: %u\n",
lib/ext2fs/ext2fs.h +2 -1
@@ -1396,7 +1396,8 @@ _INLINE_ errcode_t ext2fs_get_memalign(unsigned long size,if (align ==0 ) align =8 ; -if (retval =posix_memalign ((void **) ptr, align, size)) { + retval =posix_memalign ((void **) ptr, align, size); +if (retval) {if (retval ==ENOMEM )return EXT2_ET_NO_MEMORY ;return retval;
lib/ext2fs/fileio.c +1 -1
@@ -377,7 +377,7 @@ errcode_t ext2fs_file_set_size2(ext2_file_t file, ext2_off64_t size) truncate_block = ((size + file->fs->blocksize -1 ) >>EXT2_BLOCK_SIZE_BITS (file->fs->super)) +1 ; old_size = file->inode.i_size + - ((blk64_t ) file->inode.i_size_high) <<32 ; + ((blk64_t )file->inode.i_size_high <<32 ); old_truncate = ((old_size + file->fs->blocksize -1 ) >>EXT2_BLOCK_SIZE_BITS (file->fs->super)) +1 ;
lib/ext2fs/openfs.c +0 -1
@@ -353,7 +353,6 @@ errcode_t ext2fs_open2(const char *name, const char *io_options,*/ if (superblock >1 &&EXT2_HAS_RO_COMPAT_FEATURE (fs->super,EXT4_FEATURE_RO_COMPAT_GDT_CSUM )) { -struct ext2_group_desc *gd;dgrp_t group;for (group =0 ; group < fs->group_desc_count; group++) {
lib/ext2fs/progress.c +0 -2
@@ -77,8 +77,6 @@ void ext2fs_numeric_progress_close(ext2_filsys fs, struct ext2fs_numeric_progress_struct * progress, const char *message) { - unsigned int len; -if (!(fs->flags &EXT2_FLAG_PRINT_PROGRESS ))return ;fprintf (stdout,"%.*s" , (2 *progress->log_max)+1 , spaces);
lib/ext2fs/res_gdt.c +1 -1
@@ -75,7 +75,7 @@ errcode_t ext2fs_create_resize_inode(ext2_filsys fs) retval =ext2fs_get_array (2 , fs->blocksize, &dindir_buf);if (retval) - goto out_free; +return retval; gdt_buf = (__u32 *)((char *)dindir_buf + fs->blocksize); retval =ext2fs_read_inode (fs,EXT2_RESIZE_INO , &inode);
lib/ext2fs/unix_io.c +2 -0
@@ -17,7 +17,9 @@#define _LARGEFILE_SOURCE#define _LARGEFILE64_SOURCE +#ifndef _GNU_SOURCE#define _GNU_SOURCE +#endif #include <stdio.h> #include <string.h>
misc/badblocks.c +2 -0
@@ -29,7 +29,9 @@* list. (Work done by David Beattie) */ +#ifndef _GNU_SOURCE#define _GNU_SOURCE/* for O_DIRECT */ +#endif #ifndef O_LARGEFILE #define O_LARGEFILE 0
misc/e2freefrag.c +2 -2
@@ -144,7 +144,7 @@ errcode_t get_chunk_info(ext2_filsys fs, struct chunk_info *info)unsigned long total_chunks;char *unitp ="KMGTPEZY" ;int units =10 ; -unsigned long start =0 , end, cum; +unsigned long start =0 , end;int i, retval =0 ;scan_block_bitmap (fs, info);
@@ -218,7 +218,7 @@ void close_device(char *device_name, ext2_filsys fs)void collect_info (ext2_filsys fs,struct chunk_info *chunk_info) { -unsigned int retval =0 , i, free_blks; +unsigned int retval =0 ;printf ("Device: %s\n" , fs->device_name);printf ("Blocksize: %u bytes\n" , fs->blocksize);
misc/e2undo.c +4 -5
@@ -29,12 +29,11 @@ unsigned char blksize_key[] = "filesystem BLKSIZE";char *prg_name; -static void usage (char *prg_name) +static void usage (void ) {fprintf (stderr,_ ("Usage: %s <transaction file> <filesystem>\n" ), prg_name);exit (1 ); - }static int check_filesystem (TDB_CONTEXT *tdb,io_channel channel)
@@ -145,12 +144,12 @@ int main(int argc, char *argv[]) force =1 ;break ;default : -usage (prg_name); +usage (); } } -if (argc != optind+2 ) -usage (prg_name); +if (argc != optind +2 ) +usage (); tdb_file = argv[optind]; device_name = argv[optind+1 ];
misc/tune2fs.c +2 -3
@@ -348,7 +348,6 @@ static void update_feature_set(ext2_filsys fs, char *features) {struct ext2_super_block *sb = fs->super;struct ext2_group_desc *gd; -errcode_t retval;__u32 old_features[3 ];int i, type_err;unsigned int mask_err;
@@ -992,7 +991,7 @@ static void parse_extended_opts(ext2_filsys fs, const char *opts) "Extended mount options too long\n");continue ; } -strcpy (fs->super->s_mount_opts, arg); +strcpy ((char *)fs->super->s_mount_opts, arg);ext2fs_mark_super_dirty (fs); }else r_usage++;
@@ -1097,7 +1096,7 @@ static int move_block(ext2_filsys fs, ext2fs_block_bitmap bmap) {char *buf; -dgrp_t group; +dgrp_t group =0 ;errcode_t retval;int meta_data =0 ;blk64_t blk, new_blk, goal;
Signature · 1 line
1.7.3.4
I'm starting to send a bunch of patches that have accumulated on the Lustre e2fsprogs branch. The initial ones, like this, shouldn't controversial.
They are based against the current git master branch.
Quoted 409 lines · Andreas Dilger
Fix several types of compiler warnings (unused variables/labels), uninitialized variables, etc that are hit with gcc -Wall.
Signed-off-by Andreas Dilger <[email protected]>---
debugfs/debugfs.c | 5 ++--- debugfs/debugfs.h | 1 + debugfs/dump.c | 2 ++ e2fsck/message.c | 1 - e2fsck/pass1.c | 5 +++-- e2fsck/pass2.c | 3 ++- e2fsck/pass5.c | 1 - e2fsck/rehash.c | 3 ++- e2fsprogs.spec.in | 1 + lib/blkid/probe.c | 7 ++++--- lib/e2p/ls.c | 4 ++-- lib/ext2fs/ext2fs.h | 3 ++- lib/ext2fs/fileio.c | 2 +- lib/ext2fs/openfs.c | 1 - lib/ext2fs/progress.c | 2 -- lib/ext2fs/res_gdt.c | 2 +- lib/ext2fs/unix_io.c | 2 ++ misc/badblocks.c | 2 ++ misc/e2freefrag.c | 4 ++-- misc/e2undo.c | 9 ++++----- misc/tune2fs.c | 5 ++--- 21 files changed, 35 insertions(+), 30 deletions(-)debugfs/debugfs.c +2
-3@@ -855,7 +855,7 @@ void do_stat(int argc, char *argv[])return ; } -void do_dump_extents (int argc,char *argv[]) +void do_dump_extents (int argc,char **argv) {struct ext2_inode inode;ext2_ino_t ino;@@ -876,8 +876,7 @@ void do_dump_extents(int argc, char *argv[]) } } -if (argc != optind+1 ) { - print_usage: +if (argc != optind +1 ) {com_err (0 ,0 ,"Usage: dump_extents [-n] [-l] file" );return ; }debugfs/debugfs.h +1
-0@@ -103,6 +103,7 @@ extern void do_unlink(int argc, char **argv);extern void do_find_free_block (int argc,char **argv);extern void do_find_free_inode (int argc,char **argv);extern void do_stat (int argc,char **argv); +extern void do_dump_extents (int argc,char **argv);extern void do_chroot (int argc,char **argv);extern void do_clri (int argc,char **argv);debugfs/dump.c +2
-0@@ -5,7 +5,9 @@* under the terms of the GNU Public License. */ +#ifndef _GNU_SOURCE#define _GNU_SOURCE/* for O_LARGEFILE */ +#endif #include <stdio.h> #include <unistd.h> e2fsck/message.c +0
-1@@ -263,7 +263,6 @@ static _INLINE_ void expand_inode_expression(ext2_filsys fs, char ch, {struct ext2_inode *inode;struct ext2_inode_large *large_inode; -time_t t;if (!ctx || !ctx->inode) goto no_inode;e2fsck/pass1.c +3
-2@@ -404,7 +404,7 @@ static void check_is_really_dir(e2fsck_t ctx, struct problem_context *pctx,struct ext2_dir_entry *dirent;const char *old_op;errcode_t retval; -blk64_t blk, first_dir_blk; +blk64_t blk;unsigned int i, rec_len, not_device =0 ;int extent_fs;@@ -436,7 +436,8 @@ static void check_is_really_dir(e2fsck_t ctx, struct problem_context *pctx,* with it. */ - extent_fs = (ctx->fs->super->s_feature_incompat &EXT3_FEATURE_INCOMPAT_EXTENTS ); + extent_fs = (ctx->fs->super->s_feature_incompat & +EXT3_FEATURE_INCOMPAT_EXTENTS );if (extent_fs && (inode->i_flags &EXT4_EXTENTS_FL )) {/* extent mapped */ if (ext2fs_bmap2(ctx->fs, pctx->ino, inode, 0, 0, 0, 0,e2fsck/pass2.c +2
-1@@ -404,7 +404,8 @@ static int check_dotdot(e2fsck_t ctx,struct ext2_dir_entry *dirent, ext2_ino_t ino, struct problem_context *pctx) { - int rec_len, problem = 0; + int problem = 0; +unsigned int rec_len;if (!dirent->inode) problem =PR_2_MISSING_DOT_DOT ;e2fsck/pass5.c +0
-1@@ -77,7 +77,6 @@ static void e2fsck_discard_blocks(e2fsck_t ctx, io_manager manager, blk64_t start, blk64_t count) {ext2_filsys fs = ctx->fs; -int ret =0 ;/* * If the filesystem has changed it means that there was an corruption e2fsck/rehash.c +2
-1@@ -430,12 +430,13 @@ static errcode_t copy_dir_entries(e2fsck_t ctx,return retval; dirent = (struct ext2_dir_entry *) block_start; prev_rec_len =0 ; + rec_len =0 ; left = fs->blocksize; slack = fd->compress ?12 : (fs->blocksize * ctx->htree_slack_percentage)/100 ;if (slack <12 ) slack =12 ; -for (i=0 ; i < fd->num_array; i++) { +for (i =0 ; i < fd->num_array; i++) { ent = fd->harray + i;if (ent->dir->inode ==0 )continue ;e2fsprogs.spec.in +0
-0@@ -212,6 +212,7 @@ exit 0%{_includedir}/blkid
%{_includedir}/e2p
%{_includedir}/et
+%{_includedir}/com_err.h
%{_includedir}/ext2fs
%{_includedir}/ss
%{_includedir}/uuidlib/blkid/probe.c +4
-3@@ -248,7 +248,7 @@ static int linux_version_code() {#ifdef __linux__struct utsname ut; - static version_code = -1; +static int version_code =-1 ;int major, minor, rev;char *endptr;const char *cp;@@ -1175,7 +1175,7 @@ static int probe_hfs(struct blkid_probe *probe __BLKID_ATTR((unused)),sprintf (uuid_str,"%016llX" , uuid);blkid_set_tag (probe->dev,"UUID" , uuid_str,0 ); } -blkid_set_tag (probe->dev,"LABEL" , hfs->label, hfs->label_len); +blkid_set_tag (probe->dev,"LABEL" , (char *)hfs->label, hfs->label_len);return 0 ; }@@ -1296,7 +1296,8 @@ static int probe_hfsplus(struct blkid_probe *probe,return 0 ; label_len =blkid_be16 (key->unicode_len) *2 ; -unicode_16be_to_utf8 (label,sizeof (label), key->unicode, label_len); +unicode_16be_to_utf8 ((unsigned char *)label,sizeof (label), + key->unicode, label_len);blkid_set_tag (probe->dev,"LABEL" , label,0 );return 0 ; }lib/e2p/ls.c +2
-2@@ -383,7 +383,7 @@ void list_super2(struct ext2_super_block * sb, FILE *f) tm = sb->s_first_error_time;fprintf (f,"First error time: %s" ,ctime (&tm));memset (buf,0 ,sizeof (buf)); -strncpy (buf, sb->s_first_error_func, +strncpy (buf, (char *)sb->s_first_error_func,sizeof (sb->s_first_error_func));fprintf (f,"First error function: %s\n" , buf); fprintf(f, "First error line #: %u\n",@@ -397,7 +397,7 @@ void list_super2(struct ext2_super_block * sb, FILE *f) tm = sb->s_last_error_time;fprintf (f,"Last error time: %s" ,ctime (&tm));memset (buf,0 ,sizeof (buf)); -strncpy (buf, sb->s_last_error_func, +strncpy (buf, (char *)sb->s_last_error_func,sizeof (sb->s_last_error_func));fprintf (f,"Last error function: %s\n" , buf); fprintf(f, "Last error line #: %u\n",lib/ext2fs/ext2fs.h +2
-1@@ -1396,7 +1396,8 @@ _INLINE_ errcode_t ext2fs_get_memalign(unsigned long size,if (align ==0 ) align =8 ; -if (retval =posix_memalign ((void **) ptr, align, size)) { + retval =posix_memalign ((void **) ptr, align, size); +if (retval) {if (retval ==ENOMEM )return EXT2_ET_NO_MEMORY ;return retval;lib/ext2fs/fileio.c +1
-1@@ -377,7 +377,7 @@ errcode_t ext2fs_file_set_size2(ext2_file_t file, ext2_off64_t size) truncate_block = ((size + file->fs->blocksize -1 ) >>EXT2_BLOCK_SIZE_BITS (file->fs->super)) +1 ; old_size = file->inode.i_size + - ((blk64_t ) file->inode.i_size_high) <<32 ; + ((blk64_t )file->inode.i_size_high <<32 ); old_truncate = ((old_size + file->fs->blocksize -1 ) >>EXT2_BLOCK_SIZE_BITS (file->fs->super)) +1 ;lib/ext2fs/openfs.c +0
-1@@ -353,7 +353,6 @@ errcode_t ext2fs_open2(const char *name, const char *io_options,*/ if (superblock >1 &&EXT2_HAS_RO_COMPAT_FEATURE (fs->super,EXT4_FEATURE_RO_COMPAT_GDT_CSUM )) { -struct ext2_group_desc *gd;dgrp_t group;for (group =0 ; group < fs->group_desc_count; group++) {lib/ext2fs/progress.c +0
-2@@ -77,8 +77,6 @@ void ext2fs_numeric_progress_close(ext2_filsys fs, struct ext2fs_numeric_progress_struct * progress, const char *message) { - unsigned int len; -if (!(fs->flags &EXT2_FLAG_PRINT_PROGRESS ))return ;fprintf (stdout,"%.*s" , (2 *progress->log_max)+1 , spaces);lib/ext2fs/res_gdt.c +1
-1@@ -75,7 +75,7 @@ errcode_t ext2fs_create_resize_inode(ext2_filsys fs) retval =ext2fs_get_array (2 , fs->blocksize, &dindir_buf);if (retval) - goto out_free; +return retval; gdt_buf = (__u32 *)((char *)dindir_buf + fs->blocksize); retval =ext2fs_read_inode (fs,EXT2_RESIZE_INO , &inode);lib/ext2fs/unix_io.c +2
-0@@ -17,7 +17,9 @@#define _LARGEFILE_SOURCE#define _LARGEFILE64_SOURCE +#ifndef _GNU_SOURCE#define _GNU_SOURCE +#endif #include <stdio.h> #include <string.h> misc/badblocks.c +2
-0@@ -29,7 +29,9 @@* list. (Work done by David Beattie) */ +#ifndef _GNU_SOURCE#define _GNU_SOURCE/* for O_DIRECT */ +#endif #ifndef O_LARGEFILE #define O_LARGEFILE 0misc/e2freefrag.c +2
-2@@ -144,7 +144,7 @@ errcode_t get_chunk_info(ext2_filsys fs, struct chunk_info *info)unsigned long total_chunks;char *unitp ="KMGTPEZY" ;int units =10 ; -unsigned long start =0 , end, cum; +unsigned long start =0 , end;int i, retval =0 ;scan_block_bitmap (fs, info);@@ -218,7 +218,7 @@ void close_device(char *device_name, ext2_filsys fs)void collect_info (ext2_filsys fs,struct chunk_info *chunk_info) { -unsigned int retval =0 , i, free_blks; +unsigned int retval =0 ;printf ("Device: %s\n" , fs->device_name);printf ("Blocksize: %u bytes\n" , fs->blocksize);misc/e2undo.c +4
-5@@ -29,12 +29,11 @@ unsigned char blksize_key[] = "filesystem BLKSIZE";char *prg_name; -static void usage (char *prg_name) +static void usage (void ) {fprintf (stderr,_ ("Usage: %s <transaction file> <filesystem>\n" ), prg_name);exit (1 ); - }static int check_filesystem (TDB_CONTEXT *tdb,io_channel channel)@@ -145,12 +144,12 @@ int main(int argc, char *argv[]) force =1 ;break ;default : -usage (prg_name); +usage (); } } -if (argc != optind+2 ) -usage (prg_name); +if (argc != optind +2 ) +usage (); tdb_file = argv[optind]; device_name = argv[optind+1 ];misc/tune2fs.c +2
-3@@ -348,7 +348,6 @@ static void update_feature_set(ext2_filsys fs, char *features) {struct ext2_super_block *sb = fs->super;struct ext2_group_desc *gd; -errcode_t retval;__u32 old_features[3 ];int i, type_err;unsigned int mask_err;@@ -992,7 +991,7 @@ static void parse_extended_opts(ext2_filsys fs, const char *opts) "Extended mount options too long\n");continue ; } -strcpy (fs->super->s_mount_opts, arg); +strcpy ((char *)fs->super->s_mount_opts, arg);ext2fs_mark_super_dirty (fs); }else r_usage++;@@ -1097,7 +1096,7 @@ static int move_block(ext2_filsys fs, ext2fs_block_bitmap bmap) {char *buf; -dgrp_t group; +dgrp_t group =0 ;errcode_t retval;int meta_data =0 ;blk64_t blk, new_blk, goal;Signature · 6 lines
1.7.3.4 -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Cheers, Andreas
--
Andreas Dilger
Principal Engineer
Whamcloud, Inc.
Ted Ts'o
AppliedQuoted 4 lines · Andreas Dilger
Fix several types of compiler warnings (unused variables/labels), uninitialized variables, etc that are hit with gcc -Wall.
Signed-off-by Andreas Dilger <[email protected]>
Applied into the "next" branch, thanks! (As per usual, the commits next branch will graduate into the 'master' branch in a few days.)
- Ted