From 53cdfb64cc96a8fc2ad0979a7a7939f0d50532a9 Mon Sep 17 00:00:00 2001 From: relan Date: Sat, 1 Apr 2017 09:39:47 +0300 Subject: [PATCH] Clean up unused parameters in libexfat. --- fsck/main.c | 2 +- fuse/main.c | 2 +- libexfat/exfat.h | 2 +- libexfat/lookup.c | 4 ++-- libexfat/node.c | 17 +++++++---------- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/fsck/main.c b/fsck/main.c index b7222f0..b5e6f48 100644 --- a/fsck/main.c +++ b/fsck/main.c @@ -98,7 +98,7 @@ static void dirck(struct exfat* ef, const char* path) exfat_put_node(ef, parent); return; } - while ((node = exfat_readdir(ef, &it))) + while ((node = exfat_readdir(&it))) { exfat_get_name(node, entry_path + path_length + 1); exfat_debug("%s: %s, %"PRIu64" bytes, cluster %u", entry_path, diff --git a/fuse/main.c b/fuse/main.c index 3c91b12..a37b451 100644 --- a/fuse/main.c +++ b/fuse/main.c @@ -128,7 +128,7 @@ static int fuse_exfat_readdir(const char* path, void* buffer, exfat_error("failed to open directory '%s'", path); return rc; } - while ((node = exfat_readdir(&ef, &it))) + while ((node = exfat_readdir(&it))) { exfat_get_name(node, name); exfat_debug("[%s] %s: %s, %"PRId64" bytes, cluster 0x%x", __func__, diff --git a/libexfat/exfat.h b/libexfat/exfat.h index 5a60499..b913ca2 100644 --- a/libexfat/exfat.h +++ b/libexfat/exfat.h @@ -161,7 +161,7 @@ ssize_t exfat_generic_pwrite(struct exfat* ef, struct exfat_node* node, int exfat_opendir(struct exfat* ef, struct exfat_node* dir, struct exfat_iterator* it); void exfat_closedir(struct exfat* ef, struct exfat_iterator* it); -struct exfat_node* exfat_readdir(struct exfat* ef, struct exfat_iterator* it); +struct exfat_node* exfat_readdir(struct exfat_iterator* it); int exfat_lookup(struct exfat* ef, struct exfat_node** node, const char* path); int exfat_split(struct exfat* ef, struct exfat_node** parent, diff --git a/libexfat/lookup.c b/libexfat/lookup.c index 4b27cc5..137a84a 100644 --- a/libexfat/lookup.c +++ b/libexfat/lookup.c @@ -46,7 +46,7 @@ void exfat_closedir(struct exfat* ef, struct exfat_iterator* it) it->current = NULL; } -struct exfat_node* exfat_readdir(struct exfat* ef, struct exfat_iterator* it) +struct exfat_node* exfat_readdir(struct exfat_iterator* it) { if (it->current == NULL) it->current = it->parent->child; @@ -93,7 +93,7 @@ static int lookup_name(struct exfat* ef, struct exfat_node* parent, rc = exfat_opendir(ef, parent, &it); if (rc != 0) return rc; - while ((*node = exfat_readdir(ef, &it))) + while ((*node = exfat_readdir(&it))) { if (compare_name(ef, buffer, (*node)->name) == 0) { diff --git a/libexfat/node.c b/libexfat/node.c index 1b96e09..3f58e9d 100644 --- a/libexfat/node.c +++ b/libexfat/node.c @@ -292,8 +292,8 @@ static bool check_node(const struct exfat* ef, struct exfat_node* node, return ret; } -static int parse_file_entries(struct exfat* ef, struct exfat_node* parent, - struct exfat_node* node, const struct exfat_entry* entries, int n) +static int parse_file_entries(struct exfat* ef, struct exfat_node* node, + const struct exfat_entry* entries, int n) { const struct exfat_entry_meta1* meta1; const struct exfat_entry_meta2* meta2; @@ -348,7 +348,7 @@ static int parse_file_entry(struct exfat* ef, struct exfat_node* parent, return -ENOMEM; (*node)->entry_offset = *offset; - rc = parse_file_entries(ef, parent, *node, entries, n); + rc = parse_file_entries(ef, *node, entries, n); if (rc != 0) { free(*node); @@ -876,7 +876,7 @@ static int find_slot(struct exfat* ef, struct exfat_node* dir, } static int commit_entry(struct exfat* ef, struct exfat_node* dir, - const le16_t* name, cluster_t cluster, off_t offset, uint16_t attrib) + const le16_t* name, off_t offset, uint16_t attrib) { struct exfat_node* node; const size_t name_length = utf16_length(name); @@ -936,7 +936,6 @@ static int create(struct exfat* ef, const char* path, uint16_t attrib) { struct exfat_node* dir; struct exfat_node* existing; - cluster_t cluster = EXFAT_CLUSTER_BAD; off_t offset = -1; le16_t name[EXFAT_NAME_MAX + 1]; int rc; @@ -958,7 +957,7 @@ static int create(struct exfat* ef, const char* path, uint16_t attrib) exfat_put_node(ef, dir); return rc; } - rc = commit_entry(ef, dir, name, cluster, offset, attrib); + rc = commit_entry(ef, dir, name, offset, attrib); if (rc != 0) { exfat_put_node(ef, dir); @@ -1006,8 +1005,7 @@ int exfat_mkdir(struct exfat* ef, const char* path) } static int rename_entry(struct exfat* ef, struct exfat_node* dir, - struct exfat_node* node, const le16_t* name, cluster_t new_cluster, - off_t new_offset) + struct exfat_node* node, const le16_t* name, off_t new_offset) { const size_t name_length = utf16_length(name); const int name_entries = DIV_ROUND_UP(name_length, EXFAT_ENAME_MAX); @@ -1059,7 +1057,6 @@ int exfat_rename(struct exfat* ef, const char* old_path, const char* new_path) struct exfat_node* node; struct exfat_node* existing; struct exfat_node* dir; - cluster_t cluster = EXFAT_CLUSTER_BAD; off_t offset = -1; le16_t name[EXFAT_NAME_MAX + 1]; int rc; @@ -1140,7 +1137,7 @@ int exfat_rename(struct exfat* ef, const char* old_path, const char* new_path) exfat_put_node(ef, node); return rc; } - rc = rename_entry(ef, dir, node, name, cluster, offset); + rc = rename_entry(ef, dir, node, name, offset); if (rc != 0) { exfat_put_node(ef, dir); -- 2.11.0