Skip to content

Commit a838e5d

Browse files
Kemeng Shijankara
authored andcommitted
quota: remove unneeded return value of register_quota_format
The register_quota_format always returns 0, simply remove unneeded return value. Link: https://patch.msgid.link/[email protected] Signed-off-by: Kemeng Shi <[email protected]> Reviewed-by: Joseph Qi <[email protected]> Signed-off-by: Jan Kara <[email protected]>
1 parent d16a5f8 commit a838e5d

File tree

6 files changed

+10
-20
lines changed

6 files changed

+10
-20
lines changed

fs/ocfs2/super.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,15 +1571,13 @@ static int __init ocfs2_init(void)
15711571

15721572
ocfs2_set_locking_protocol();
15731573

1574-
status = register_quota_format(&ocfs2_quota_format);
1575-
if (status < 0)
1576-
goto out3;
1574+
register_quota_format(&ocfs2_quota_format);
1575+
15771576
status = register_filesystem(&ocfs2_fs_type);
15781577
if (!status)
15791578
return 0;
15801579

15811580
unregister_quota_format(&ocfs2_quota_format);
1582-
out3:
15831581
debugfs_remove(ocfs2_debugfs_root);
15841582
ocfs2_free_mem_caches();
15851583
out2:

fs/quota/dquot.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,12 @@ static struct quota_module_name module_names[] = INIT_QUOTA_MODULE_NAMES;
163163
/* SLAB cache for dquot structures */
164164
static struct kmem_cache *dquot_cachep;
165165

166-
int register_quota_format(struct quota_format_type *fmt)
166+
void register_quota_format(struct quota_format_type *fmt)
167167
{
168168
spin_lock(&dq_list_lock);
169169
fmt->qf_next = quota_formats;
170170
quota_formats = fmt;
171171
spin_unlock(&dq_list_lock);
172-
return 0;
173172
}
174173
EXPORT_SYMBOL(register_quota_format);
175174

fs/quota/quota_v1.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ static struct quota_format_type v1_quota_format = {
235235

236236
static int __init init_v1_quota_format(void)
237237
{
238-
return register_quota_format(&v1_quota_format);
238+
register_quota_format(&v1_quota_format);
239+
return 0;
239240
}
240241

241242
static void __exit exit_v1_quota_format(void)

fs/quota/quota_v2.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -440,12 +440,9 @@ static struct quota_format_type v2r1_quota_format = {
440440

441441
static int __init init_v2_quota_format(void)
442442
{
443-
int ret;
444-
445-
ret = register_quota_format(&v2r0_quota_format);
446-
if (ret)
447-
return ret;
448-
return register_quota_format(&v2r1_quota_format);
443+
register_quota_format(&v2r0_quota_format);
444+
register_quota_format(&v2r1_quota_format);
445+
return 0;
449446
}
450447

451448
static void __exit exit_v2_quota_format(void)

include/linux/quota.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ struct quota_info {
526526
const struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */
527527
};
528528

529-
int register_quota_format(struct quota_format_type *fmt);
529+
void register_quota_format(struct quota_format_type *fmt);
530530
void unregister_quota_format(struct quota_format_type *fmt);
531531

532532
struct quota_module_name {

mm/shmem.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4818,11 +4818,7 @@ void __init shmem_init(void)
48184818
shmem_init_inodecache();
48194819

48204820
#ifdef CONFIG_TMPFS_QUOTA
4821-
error = register_quota_format(&shmem_quota_format);
4822-
if (error < 0) {
4823-
pr_err("Could not register quota format\n");
4824-
goto out3;
4825-
}
4821+
register_quota_format(&shmem_quota_format);
48264822
#endif
48274823

48284824
error = register_filesystem(&shmem_fs_type);
@@ -4857,7 +4853,6 @@ void __init shmem_init(void)
48574853
out2:
48584854
#ifdef CONFIG_TMPFS_QUOTA
48594855
unregister_quota_format(&shmem_quota_format);
4860-
out3:
48614856
#endif
48624857
shmem_destroy_inodecache();
48634858
shm_mnt = ERR_PTR(error);

0 commit comments

Comments
 (0)