From 25f291c9b32d8017e6969c72a75e37d354c0570b Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 13 Jul 2015 08:31:51 -0400 Subject: [PATCH] Eliminate unused parameter warnings from Android build Signed-off-by: Theodore Ts'o --- debugfs/debugfs.c | 14 ++++++++++---- debugfs/debugfs.h | 2 +- debugfs/do_journal.c | 8 +++++--- debugfs/quota.c | 3 ++- debugfs/set_fields.c | 8 ++++++-- debugfs/util.c | 4 ++-- e2fsck/pass1.c | 7 +++---- e2fsck/pass2.c | 3 +-- lib/blkid/probe.c | 7 ++++--- lib/ext2fs/blkmap64_ba.c | 4 +++- lib/ext2fs/jfs_compat.h | 5 +++-- lib/ext2fs/mmp.c | 6 ++++++ lib/ext2fs/punch.c | 3 ++- lib/ext2fs/unix_io.c | 4 ++++ lib/ss/get_readline.c | 10 ++++++---- lib/support/mkquota.c | 13 ++++++++----- lib/support/plausible.c | 11 +++++++---- lib/support/quotaio.c | 27 ++++++--------------------- lib/support/quotaio.h | 4 +--- lib/support/quotaio_v2.c | 3 ++- lib/uuid/gen_uuid.c | 5 +++++ misc/create_inode.c | 22 ++++++++++++++-------- misc/create_inode.h | 3 +-- misc/e4crypt.c | 11 +++++++---- misc/tune2fs.c | 6 ++---- misc/util.c | 2 +- resize/resize2fs.c | 9 ++++++--- util/android_config.h | 2 ++ 28 files changed, 120 insertions(+), 86 deletions(-) diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c index 749796b2..e5134bf8 100644 --- a/debugfs/debugfs.c +++ b/debugfs/debugfs.c @@ -1734,7 +1734,7 @@ void do_mkdir(int argc, char *argv[]) "", CHECK_FS_RW)) return; - retval = do_mkdir_internal(current_fs, cwd, argv[1], NULL, root); + retval = do_mkdir_internal(current_fs, cwd, argv[1], root); if (retval) com_err(argv[0], retval, 0); @@ -2247,9 +2247,9 @@ void do_symlink(int argc, char *argv[]) } +#if CONFIG_MMP void do_dump_mmp(int argc EXT2FS_ATTR((unused)), char *argv[]) { -#if CONFIG_MMP struct mmp_struct *mmp_s; time_t t; errcode_t retval = 0; @@ -2286,11 +2286,17 @@ void do_dump_mmp(int argc EXT2FS_ATTR((unused)), char *argv[]) fprintf(stdout, "device_name: %s\n", mmp_s->mmp_bdevname); fprintf(stdout, "magic: 0x%x\n", mmp_s->mmp_magic); fprintf(stdout, "checksum: 0x%08x\n", mmp_s->mmp_checksum); -#else fprintf(stdout, "MMP is unsupported, please recompile with " "--enable-mmp\n"); -#endif } +#else +void do_dump_mmp(int argc EXT2FS_ATTR((unused)), + char *argv[] EXT2FS_ATTR((unused))) +{ + fprintf(stdout, "MMP is unsupported, please recompile with " + "--enable-mmp\n"); +} +#endif static int source_file(const char *cmd_file, int ss_idx) { diff --git a/debugfs/debugfs.h b/debugfs/debugfs.h index c9a444c2..6972d502 100644 --- a/debugfs/debugfs.h +++ b/debugfs/debugfs.h @@ -181,7 +181,7 @@ extern void do_get_quota(int argc, char *argv[]); /* util.c */ extern time_t string_to_time(const char *arg); -errcode_t read_list(const char *str, blk64_t **list, size_t *len); +errcode_t read_list(char *str, blk64_t **list, size_t *len); /* xattrs.c */ void dump_inode_attributes(FILE *out, ext2_ino_t ino); diff --git a/debugfs/do_journal.c b/debugfs/do_journal.c index 22322e5b..ef0db2e9 100644 --- a/debugfs/do_journal.c +++ b/debugfs/do_journal.c @@ -66,7 +66,8 @@ typedef struct journal_transaction_s journal_transaction_t; static journal_t *current_journal = NULL; -static void journal_dump_trans(journal_transaction_t *trans, const char *tag) +static void journal_dump_trans(journal_transaction_t *trans EXT2FS_ATTR((unused)), + const char *tag EXT2FS_ATTR((unused))) { dbg_printf("TRANS %p(%s): tid=%d start=%llu block=%llu end=%llu " "flags=0x%x\n", trans, tag, trans->tid, trans->start, @@ -957,7 +958,8 @@ void do_journal_open(int argc, char *argv[]) com_err(argv[0], err, "while examining journal"); } -void do_journal_close(int argc, char *argv[]) +void do_journal_close(int argc EXT2FS_ATTR((unused)), + char *argv[] EXT2FS_ATTR((unused))) { if (current_journal == NULL) { printf("Journal not open.\n"); @@ -967,7 +969,7 @@ void do_journal_close(int argc, char *argv[]) ext2fs_close_journal(current_fs, ¤t_journal); } -void do_journal_run(int argc, char *argv[]) +void do_journal_run(int argc EXT2FS_ATTR((unused)), char *argv[]) { errcode_t err; diff --git a/debugfs/quota.c b/debugfs/quota.c index 9612f642..7aa0f3b2 100644 --- a/debugfs/quota.c +++ b/debugfs/quota.c @@ -90,7 +90,8 @@ static int parse_quota_type(const char *cmdname, const char *str) } -static int list_quota_callback(struct dquot *dq, void *cb_data) +static int list_quota_callback(struct dquot *dq, + void *cb_data EXT2FS_ATTR((unused))) { printf("%8u %8lld %8lld %8lld %8lld %8lld %8lld\n", dq->dq_id, (long long)dq->dq_dqb.dqb_curspace, diff --git a/debugfs/set_fields.c b/debugfs/set_fields.c index 45fc7506..b14fec99 100644 --- a/debugfs/set_fields.c +++ b/debugfs/set_fields.c @@ -849,9 +849,9 @@ static errcode_t parse_mmp_clear(struct field_set_info *info, return 1; /* we don't need the MMP block written again */ } +#ifdef CONFIG_MMP void do_set_mmp_value(int argc, char *argv[]) { -#ifdef CONFIG_MMP const char *usage = " \n" "\t\"set_mmp_value -l\" will list the names of " "MMP fields\n\twhich can be set."; @@ -906,9 +906,13 @@ void do_set_mmp_value(int argc, char *argv[]) &set_mmp); *mmp_s = set_mmp; } +} #else +void do_set_mmp_value(int argc EXT2FS_ATTR((unused)), + char *argv[] EXT2FS_ATTR((unused))) +{ fprintf(stdout, "MMP is unsupported, please recompile with " "--enable-mmp\n"); -#endif } +#endif diff --git a/debugfs/util.c b/debugfs/util.c index 4fef89ae..56ea695c 100644 --- a/debugfs/util.c +++ b/debugfs/util.c @@ -498,11 +498,11 @@ int ext2_file_type(unsigned int mode) return 0; } -errcode_t read_list(const char *str, blk64_t **list, size_t *len) +errcode_t read_list(char *str, blk64_t **list, size_t *len) { blk64_t *lst = *list; size_t ln = *len; - char *tok, *p = optarg; + char *tok, *p = str; errcode_t retval; while ((tok = strtok(p, ","))) { diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index c894e7af..23d2e99f 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -856,8 +856,8 @@ static int fix_inline_data_extents_file(e2fsck_t ctx, } /* If it looks short enough to be inline data, try to clear extents */ - if (EXT2_INODE_SIZE(fs->super) > EXT2_GOOD_OLD_INODE_SIZE) - max_inline_ea_size = EXT2_INODE_SIZE(fs->super) - + if (inode_size > EXT2_GOOD_OLD_INODE_SIZE) + max_inline_ea_size = inode_size - (EXT2_GOOD_OLD_INODE_SIZE + ((struct ext2_inode_large *)inode)->i_extra_isize); else @@ -975,7 +975,7 @@ void e2fsck_pass1(e2fsck_t ctx) unsigned int save_type; int imagic_fs, extent_fs, inlinedata_fs; int low_dtime_check = 1; - int inode_size; + int inode_size = EXT2_INODE_SIZE(fs->super); int failed_csum = 0; ext2_ino_t ino_threshold = 0; dgrp_t ra_group = 0; @@ -1083,7 +1083,6 @@ void e2fsck_pass1(e2fsck_t ctx) ctx->flags |= E2F_FLAG_ABORT; return; } - inode_size = EXT2_INODE_SIZE(fs->super); inode = (struct ext2_inode *) e2fsck_allocate_memory(ctx, inode_size, "scratch inode"); diff --git a/e2fsck/pass2.c b/e2fsck/pass2.c index d0bb755b..f4913f6a 100644 --- a/e2fsck/pass2.c +++ b/e2fsck/pass2.c @@ -475,7 +475,6 @@ static int check_dotdot(e2fsck_t ctx, */ static int check_name(e2fsck_t ctx, struct ext2_dir_entry *dirent, - ext2_ino_t dir_ino, struct problem_context *pctx) { int i; @@ -1381,7 +1380,7 @@ skip_checksum: } } - if (!encrypted && check_name(ctx, dirent, ino, &cd->pctx)) + if (!encrypted && check_name(ctx, dirent, &cd->pctx)) dir_modified++; if (check_filetype(ctx, dirent, ino, &cd->pctx)) diff --git a/lib/blkid/probe.c b/lib/blkid/probe.c index 4b797ab1..b260862e 100644 --- a/lib/blkid/probe.c +++ b/lib/blkid/probe.c @@ -874,8 +874,9 @@ static int probe_jfs(struct blkid_probe *probe, return 0; } -static int probe_zfs(struct blkid_probe *probe, struct blkid_magic *id, - unsigned char *buf) +static int probe_zfs(struct blkid_probe *probe __BLKID_ATTR((unused)), + struct blkid_magic *id __BLKID_ATTR((unused)), + unsigned char *buf __BLKID_ATTR((unused))) { #if 0 char *vdev_label; @@ -1376,7 +1377,7 @@ static int probe_lvm2(struct blkid_probe *probe, } static int probe_btrfs(struct blkid_probe *probe, - struct blkid_magic *id, + struct blkid_magic *id __BLKID_ATTR((unused)), unsigned char *buf) { struct btrfs_super_block *bs; diff --git a/lib/ext2fs/blkmap64_ba.c b/lib/ext2fs/blkmap64_ba.c index 87946c7a..4671c50d 100644 --- a/lib/ext2fs/blkmap64_ba.c +++ b/lib/ext2fs/blkmap64_ba.c @@ -318,7 +318,9 @@ static void ba_print_stats(ext2fs_generic_bitmap bitmap) sizeof(struct ext2fs_ba_private_struct)); } #else -static void ba_print_stats(ext2fs_generic_bitmap bitmap) {} +static void ba_print_stats(ext2fs_generic_bitmap bitmap EXT2FS_ATTR((unused))) +{ +} #endif /* Find the first zero bit between start and end, inclusive. */ diff --git a/lib/ext2fs/jfs_compat.h b/lib/ext2fs/jfs_compat.h index a3261ad0..75a05966 100644 --- a/lib/ext2fs/jfs_compat.h +++ b/lib/ext2fs/jfs_compat.h @@ -37,8 +37,9 @@ typedef __u64 u64; #define put_bh(x) brelse(x) #define be64_to_cpu(x) ext2fs_be64_to_cpu(x) -static inline __u32 jbd2_chksum(journal_t *j, __u32 crc, const void *address, - unsigned int length) +static inline __u32 jbd2_chksum(journal_t *j EXT2FS_ATTR((unused)), + __u32 crc, const void *address, + unsigned int length) { return ext2fs_crc32c_le(crc, address, length); } diff --git a/lib/ext2fs/mmp.c b/lib/ext2fs/mmp.c index 8d927d92..ac278370 100644 --- a/lib/ext2fs/mmp.c +++ b/lib/ext2fs/mmp.c @@ -31,6 +31,11 @@ #define O_DIRECT 0 #endif +#pragma GCC diagnostic push +#ifndef CONFIG_MMP +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif + errcode_t ext2fs_mmp_read(ext2_filsys fs, blk64_t mmp_blk, void *buf) { #ifdef CONFIG_MMP @@ -453,3 +458,4 @@ mmp_error: return EXT2_ET_OP_NOT_SUPPORTED; #endif } +#pragma GCC diagnostic pop diff --git a/lib/ext2fs/punch.c b/lib/ext2fs/punch.c index 3cce1f87..db4aa191 100644 --- a/lib/ext2fs/punch.c +++ b/lib/ext2fs/punch.c @@ -436,7 +436,8 @@ errout: static errcode_t ext2fs_punch_inline_data(ext2_filsys fs, ext2_ino_t ino, struct ext2_inode *inode, - blk64_t start, blk64_t end) + blk64_t start, + blk64_t end EXT2FS_ATTR((unused))) { errcode_t retval; diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c index e6407ce2..dd842711 100644 --- a/lib/ext2fs/unix_io.c +++ b/lib/ext2fs/unix_io.c @@ -991,6 +991,9 @@ unimplemented: return EXT2_ET_UNIMPLEMENTED; } +/* parameters might not be used if OS doesn't support zeroout */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" static errcode_t unix_zeroout(io_channel channel, unsigned long long block, unsigned long long count) { @@ -1056,6 +1059,7 @@ err: unimplemented: return EXT2_ET_UNIMPLEMENTED; } +#pragma GCC diagnostic pop static struct struct_io_manager struct_unix_manager = { .magic = EXT2_ET_MAGIC_IO_MANAGER, diff --git a/lib/ss/get_readline.c b/lib/ss/get_readline.c index 6eb66a91..9365be06 100644 --- a/lib/ss/get_readline.c +++ b/lib/ss/get_readline.c @@ -39,9 +39,9 @@ static void ss_release_readline(ss_data *info) /* Libraries we will try to use for readline/editline functionality */ #define DEFAULT_LIBPATH "libreadline.so.6:libreadline.so.5:libreadline.so.4:libreadline.so:libedit.so.2:libedit.so:libeditline.so.0:libeditline.so" +#ifdef HAVE_DLOPEN void ss_get_readline(int sci_idx) { -#ifdef HAVE_DLOPEN void *handle = NULL; ss_data *info = ss_info(sci_idx); const char **t, *libpath = 0; @@ -92,7 +92,9 @@ void ss_get_readline(int sci_idx) dlsym(handle, "rl_attempted_completion_function")) != NULL) *completion_func = ss_rl_completion; info->readline_shutdown = ss_release_readline; -#endif } - - +#else +void ss_get_readline(int sci_idx __SS_ATTR((unused))) +{ +} +#endif diff --git a/lib/support/mkquota.c b/lib/support/mkquota.c index b45ae71e..00e96f8c 100644 --- a/lib/support/mkquota.c +++ b/lib/support/mkquota.c @@ -57,7 +57,8 @@ static void print_dquot(const char *desc, struct dquot *dq) dq->dq_dqb.dqb_isoftlimit, dq->dq_dqb.dqb_ihardlimit); } #else -static void print_dquot(const char *desc, struct dquot *dq) +static void print_dquot(const char *desc EXT2FS_ATTR((unused)), + struct dquot *dq EXT2FS_ATTR((unused))) { } #endif @@ -66,7 +67,7 @@ static void print_dquot(const char *desc, struct dquot *dq) * Returns 0 if not able to find the quota file, otherwise returns its * inode number. */ -int quota_file_exists(ext2_filsys fs, int qtype, int fmt) +int quota_file_exists(ext2_filsys fs, int qtype) { char qf_name[256]; errcode_t ret; @@ -339,7 +340,8 @@ static struct dquot *get_dq(dict_t *dict, __u32 key) /* * Called to update the blocks used by a particular inode */ -void quota_data_add(quota_ctx_t qctx, struct ext2_inode *inode, ext2_ino_t ino, +void quota_data_add(quota_ctx_t qctx, struct ext2_inode *inode, + ext2_ino_t ino EXT2FS_ATTR((unused)), qsize_t space) { struct dquot *dq; @@ -365,7 +367,8 @@ void quota_data_add(quota_ctx_t qctx, struct ext2_inode *inode, ext2_ino_t ino, /* * Called to remove some blocks used by a particular inode */ -void quota_data_sub(quota_ctx_t qctx, struct ext2_inode *inode, ext2_ino_t ino, +void quota_data_sub(quota_ctx_t qctx, struct ext2_inode *inode, + ext2_ino_t ino EXT2FS_ATTR((unused)), qsize_t space) { struct dquot *dq; @@ -391,7 +394,7 @@ void quota_data_sub(quota_ctx_t qctx, struct ext2_inode *inode, ext2_ino_t ino, * Called to count the files used by an inode's user/group */ void quota_data_inodes(quota_ctx_t qctx, struct ext2_inode *inode, - ext2_ino_t ino, int adjust) + ext2_ino_t ino EXT2FS_ATTR((unused)), int adjust) { struct dquot *dq; dict_t *dict; diff --git a/lib/support/plausible.c b/lib/support/plausible.c index e2b7ff4a..0a029e26 100644 --- a/lib/support/plausible.c +++ b/lib/support/plausible.c @@ -118,9 +118,9 @@ static void print_ext2_info(const char *device) * return 1 if there is no partition table, 0 if a partition table is * detected, and -1 on an error. */ +#ifdef HAVE_BLKID_PROBE_ENABLE_PARTITIONS static int check_partition_table(const char *device) { -#ifdef HAVE_BLKID_PROBE_ENABLE_PARTITIONS blkid_probe pr; const char *value; int ret; @@ -151,10 +151,13 @@ static int check_partition_table(const char *device) errout: blkid_free_probe(pr); return ret; -#else - return -1; -#endif } +#else +static int check_partition_table(const char *device EXT2FS_ATTR((unused))) +{ + return -1; +} +#endif /* * return 1 if the device looks plausible, creating the file if necessary diff --git a/lib/support/quotaio.c b/lib/support/quotaio.c index c7e5f87b..3af82f7d 100644 --- a/lib/support/quotaio.c +++ b/lib/support/quotaio.c @@ -55,22 +55,6 @@ const char *quota_get_qf_name(int type, int fmt, char *buf) return buf; } -const char *quota_get_qf_path(const char *mntpt, int qtype, int fmt, - char *path_buf, size_t path_buf_size) -{ - char qf_name[QUOTA_NAME_LEN]; - - if (!mntpt || !path_buf || !path_buf_size) - return NULL; - - strncpy(path_buf, mntpt, path_buf_size); - strncat(path_buf, "/", 1); - strncat(path_buf, quota_get_qf_name(qtype, fmt, qf_name), - path_buf_size - strlen(path_buf)); - - return path_buf; -} - /* * Set grace time if needed */ @@ -98,11 +82,12 @@ void update_grace_times(struct dquot *q) } } -static int compute_num_blocks_proc(ext2_filsys fs, blk64_t *blocknr, - e2_blkcnt_t blockcnt EXT2FS_ATTR((unused)), - blk64_t ref_block EXT2FS_ATTR((unused)), - int ref_offset EXT2FS_ATTR((unused)), - void *private) +static int compute_num_blocks_proc(ext2_filsys fs EXT2FS_ATTR((unused)), + blk64_t *blocknr EXT2FS_ATTR((unused)), + e2_blkcnt_t blockcnt EXT2FS_ATTR((unused)), + blk64_t ref_block EXT2FS_ATTR((unused)), + int ref_offset EXT2FS_ATTR((unused)), + void *private) { blk64_t *num_blocks = private; diff --git a/lib/support/quotaio.h b/lib/support/quotaio.h index 96661ac1..9d580ae2 100644 --- a/lib/support/quotaio.h +++ b/lib/support/quotaio.h @@ -198,8 +198,6 @@ void update_grace_times(struct dquot *q); #define QUOTA_NAME_LEN 16 const char *quota_get_qf_name(int type, int fmt, char *buf); -const char *quota_get_qf_path(const char *mntpt, int qtype, int fmt, - char *path_buf, size_t path_buf_size); /* In mkquota.c */ errcode_t quota_init_context(quota_ctx_t *qctx, ext2_filsys fs, int qtype); @@ -215,7 +213,7 @@ errcode_t quota_compute_usage(quota_ctx_t qctx); void quota_release_context(quota_ctx_t *qctx); errcode_t quota_remove_inode(ext2_filsys fs, int qtype); -int quota_file_exists(ext2_filsys fs, int qtype, int fmt); +int quota_file_exists(ext2_filsys fs, int qtype); void quota_set_sb_inum(ext2_filsys fs, ext2_ino_t ino, int qtype); errcode_t quota_compare_and_update(quota_ctx_t qctx, int qtype, int *usage_inconsistent); diff --git a/lib/support/quotaio_v2.c b/lib/support/quotaio_v2.c index 504b3ea3..38be2a34 100644 --- a/lib/support/quotaio_v2.c +++ b/lib/support/quotaio_v2.c @@ -277,7 +277,8 @@ static int v2_scan_dquots(struct quota_handle *h, * TODO: Not used right now, but we should be able to use this when we add * support to debugfs to read quota files. */ -static int v2_report(struct quota_handle *h, int verbose) +static int v2_report(struct quota_handle *h EXT2FS_ATTR((unused)), + int verbose EXT2FS_ATTR((unused))) { log_err("Not Implemented."); return -1; diff --git a/lib/uuid/gen_uuid.c b/lib/uuid/gen_uuid.c index e89cccce..794c5851 100644 --- a/lib/uuid/gen_uuid.c +++ b/lib/uuid/gen_uuid.c @@ -478,6 +478,10 @@ static void close_all_fds(void) } #endif /* defined(USE_UUIDD) && defined(HAVE_SYS_UN_H) */ +#pragma GCC diagnostic push +#if !defined(USE_UUIDD) || !defined(HAVE_SYS_UN_H) +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* * Try using the uuidd daemon to generate the UUID * @@ -560,6 +564,7 @@ fail: #endif return -1; } +#pragma GCC diagnostic pop void uuid__generate_time(uuid_t out, int *num) { diff --git a/misc/create_inode.c b/misc/create_inode.c index a3b477f1..4dd31083 100644 --- a/misc/create_inode.c +++ b/misc/create_inode.c @@ -106,8 +106,8 @@ static errcode_t add_link(ext2_filsys fs, ext2_ino_t parent_ino, } /* Set the uid, gid, mode and time for the inode */ -static errcode_t set_inode_extra(ext2_filsys fs, ext2_ino_t cwd, - ext2_ino_t ino, struct stat *st) +static errcode_t set_inode_extra(ext2_filsys fs, ext2_ino_t ino, + struct stat *st) { errcode_t retval; struct ext2_inode inode; @@ -131,10 +131,10 @@ static errcode_t set_inode_extra(ext2_filsys fs, ext2_ino_t cwd, return retval; } +#ifdef HAVE_LLISTXATTR static errcode_t set_inode_xattr(ext2_filsys fs, ext2_ino_t ino, const char *filename) { -#ifdef HAVE_LLISTXATTR errcode_t retval, close_retval; struct ext2_xattr_handle *handle; ssize_t size, value_size; @@ -220,10 +220,16 @@ static errcode_t set_inode_xattr(ext2_filsys fs, ext2_ino_t ino, retval = retval ? retval : close_retval; } return retval; -#else /* HAVE_LLISTXATTR */ return 0; -#endif /* HAVE_LLISTXATTR */ } +#else /* HAVE_LLISTXATTR */ +static errcode_t set_inode_xattr(ext2_filsys fs EXT2FS_ATTR((unused)), + ext2_ino_t ino EXT2FS_ATTR((unused)), + const char *filename EXT2FS_ATTR((unused))) +{ + return 0; +} +#endif /* HAVE_LLISTXATTR */ /* Make a special files (block and character devices), fifo's, and sockets */ errcode_t do_mknod_internal(ext2_filsys fs, ext2_ino_t cwd, const char *name, @@ -348,7 +354,7 @@ errcode_t do_symlink_internal(ext2_filsys fs, ext2_ino_t cwd, const char *name, /* Make a directory in the fs */ errcode_t do_mkdir_internal(ext2_filsys fs, ext2_ino_t cwd, const char *name, - struct stat *st, ext2_ino_t root) + ext2_ino_t root) { char *cp; ext2_ino_t parent_ino; @@ -791,7 +797,7 @@ static errcode_t __populate_fs(ext2_filsys fs, ext2_ino_t parent_ino, if (parent_ino == EXT2_ROOT_INO && strcmp(name, "lost+found") == 0) goto find_lnf; - retval = do_mkdir_internal(fs, parent_ino, name, &st, + retval = do_mkdir_internal(fs, parent_ino, name, root); if (retval) { com_err(__func__, retval, @@ -828,7 +834,7 @@ find_lnf: goto out; } - retval = set_inode_extra(fs, parent_ino, ino, &st); + retval = set_inode_extra(fs, ino, &st); if (retval) { com_err(__func__, retval, _("while setting inode for \"%s\""), name); diff --git a/misc/create_inode.h b/misc/create_inode.h index 145fd57b..cf49df2e 100644 --- a/misc/create_inode.h +++ b/misc/create_inode.h @@ -33,8 +33,7 @@ extern errcode_t do_symlink_internal(ext2_filsys fs, ext2_ino_t cwd, const char *name, char *target, ext2_ino_t root); extern errcode_t do_mkdir_internal(ext2_filsys fs, ext2_ino_t cwd, - const char *name, struct stat *st, - ext2_ino_t root); + const char *name, ext2_ino_t root); extern errcode_t do_write_internal(ext2_filsys fs, ext2_ino_t cwd, const char *src, const char *dest, ext2_ino_t root); diff --git a/misc/e4crypt.c b/misc/e4crypt.c index 3fd6c1ce..f7d6b5a3 100644 --- a/misc/e4crypt.c +++ b/misc/e4crypt.c @@ -228,8 +228,9 @@ static void clear_secrets(void) memset(passphrase, 0, sizeof(passphrase)); } -static void die_signal_handler(int signum, siginfo_t *siginfo, - void *context) +static void die_signal_handler(int signum EXT2FS_ATTR((unused)), + siginfo_t *siginfo EXT2FS_ATTR((unused)), + void *context EXT2FS_ATTR((unused))) { clear_secrets(); exit(-1); @@ -795,7 +796,8 @@ void do_get_policy(int argc, char **argv, const struct cmd_desc *cmd) "Give the invoking process (typically a shell) a new session keyring,\n" \ "discarding its old session keyring.\n" -void do_new_session(int argc, char **argv, const struct cmd_desc *cmd) +void do_new_session(int argc, char **argv EXT2FS_ATTR((unused)), + const struct cmd_desc *cmd) { long keyid, ret; @@ -830,7 +832,8 @@ const struct cmd_desc cmd_list[] = { { NULL, NULL, NULL, NULL, 0 } }; -void do_help(int argc, char **argv, const struct cmd_desc *cmd) +void do_help(int argc, char **argv, + const struct cmd_desc *cmd EXT2FS_ATTR((unused))) { const struct cmd_desc *p; diff --git a/misc/tune2fs.c b/misc/tune2fs.c index 48052163..be031688 100644 --- a/misc/tune2fs.c +++ b/misc/tune2fs.c @@ -1432,8 +1432,7 @@ static void handle_quota_options(ext2_filsys fs) quota_compute_usage(qctx); if (usrquota == QOPT_ENABLE && !fs->super->s_usr_quota_inum) { - if ((qf_ino = quota_file_exists(fs, USRQUOTA, - QFMT_VFS_V1)) > 0) + if ((qf_ino = quota_file_exists(fs, USRQUOTA)) > 0) quota_update_limits(qctx, qf_ino, USRQUOTA); quota_write_inode(qctx, USRQUOTA); } else if (usrquota == QOPT_DISABLE) { @@ -1441,8 +1440,7 @@ static void handle_quota_options(ext2_filsys fs) } if (grpquota == QOPT_ENABLE && !fs->super->s_grp_quota_inum) { - if ((qf_ino = quota_file_exists(fs, GRPQUOTA, - QFMT_VFS_V1)) > 0) + if ((qf_ino = quota_file_exists(fs, GRPQUOTA)) > 0) quota_update_limits(qctx, qf_ino, GRPQUOTA); quota_write_inode(qctx, GRPQUOTA); } else if (grpquota == QOPT_DISABLE) { diff --git a/misc/util.c b/misc/util.c index 346cd111..36cea7bc 100644 --- a/misc/util.c +++ b/misc/util.c @@ -79,7 +79,7 @@ char *get_progname(char *argv_zero) static jmp_buf alarm_env; -static void alarm_signal(int signal) +static void alarm_signal(int signal EXT2FS_ATTR((unused))) { longjmp(alarm_env, 1); } diff --git a/resize/resize2fs.c b/resize/resize2fs.c index 041ff750..07c6a0c1 100644 --- a/resize/resize2fs.c +++ b/resize/resize2fs.c @@ -1614,7 +1614,8 @@ static blk64_t get_new_block(ext2_resize_t rfs) } } -static errcode_t resize2fs_get_alloc_block(ext2_filsys fs, blk64_t goal, +static errcode_t resize2fs_get_alloc_block(ext2_filsys fs, + blk64_t goal EXT2FS_ATTR((unused)), blk64_t *ret) { ext2_resize_t rfs = (ext2_resize_t) fs->priv_data; @@ -1959,8 +1960,10 @@ out: return errcode; } -static void quiet_com_err_proc(const char *whoami, errcode_t code, - const char *fmt, va_list args) +static void quiet_com_err_proc(const char *whoami EXT2FS_ATTR((unused)), + errcode_t code EXT2FS_ATTR((unused)), + const char *fmt EXT2FS_ATTR((unused)), + va_list args EXT2FS_ATTR((unused))) { } diff --git a/util/android_config.h b/util/android_config.h index 9825bb5e..4c5b7a01 100644 --- a/util/android_config.h +++ b/util/android_config.h @@ -19,7 +19,9 @@ #define HAVE_LSEEK64_PROTOTYPE 1 #define HAVE_MMAP 1 #define HAVE_NETINET_IN_H 1 +#define HAVE_NET_IF_H 1 #define HAVE_SETJMP_H 1 +#define HAVE_SNPRINTF 1 #define HAVE_STDLIB_H 1 #define HAVE_STRCASECMP 1 #define HAVE_STRDUP 1