[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200819141630.1338693-3-leon@kernel.org>
Date: Wed, 19 Aug 2020 17:16:29 +0300
From: Leon Romanovsky <leon@...nel.org>
To: Chris Mason <clm@...com>, David Sterba <dsterba@...e.com>,
Josef Bacik <josef@...icpanda.com>
Cc: Leon Romanovsky <leonro@...dia.com>, linux-btrfs@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 2/3] fs/btrfs: Fix -Wignored-qualifiers warnings
From: Leon Romanovsky <leonro@...dia.com>
Change function declarations to avoid the following GCC warnings
while compiling with W=1 level.
In file included from fs/btrfs/volumes.c:28:
fs/btrfs/sysfs.h:16:1: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
16 | const char * const btrfs_feature_set_name(enum btrfs_feature_set set);
| ^~~~~
In file included from fs/btrfs/ioctl.c:29:
fs/btrfs/ctree.h:2265:8: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
2265 | size_t __const btrfs_get_num_csums(void);
| ^~~~~~~
Fixes: f7cea56c0fff ("btrfs: sysfs: export supported checksums")
Signed-off-by: Leon Romanovsky <leonro@...dia.com>
---
fs/btrfs/ctree.c | 2 +-
fs/btrfs/ctree.h | 2 +-
fs/btrfs/sysfs.c | 2 +-
fs/btrfs/sysfs.h | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 70e49d8d4f6c..9d71d44137a5 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -68,7 +68,7 @@ const char *btrfs_super_csum_driver(u16 csum_type)
btrfs_csums[csum_type].name;
}
-size_t __const btrfs_get_num_csums(void)
+__attribute_const__ size_t btrfs_get_num_csums(void)
{
return ARRAY_SIZE(btrfs_csums);
}
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 9c7e466f27a9..e4fd6ad48799 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -2262,7 +2262,7 @@ BTRFS_SETGET_STACK_FUNCS(super_uuid_tree_generation, struct btrfs_super_block,
int btrfs_super_csum_size(const struct btrfs_super_block *s);
const char *btrfs_super_csum_name(u16 csum_type);
const char *btrfs_super_csum_driver(u16 csum_type);
-size_t __const btrfs_get_num_csums(void);
+__attribute_const__ size_t btrfs_get_num_csums(void);
/*
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index d3652bcc2a86..c22b7f47f6f8 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -973,7 +973,7 @@ static const char * const btrfs_feature_set_names[FEAT_MAX] = {
[FEAT_INCOMPAT] = "incompat",
};
-const char * const btrfs_feature_set_name(enum btrfs_feature_set set)
+const char *btrfs_feature_set_name(enum btrfs_feature_set set)
{
return btrfs_feature_set_names[set];
}
diff --git a/fs/btrfs/sysfs.h b/fs/btrfs/sysfs.h
index cf839c46a131..e6eac2811f92 100644
--- a/fs/btrfs/sysfs.h
+++ b/fs/btrfs/sysfs.h
@@ -13,7 +13,7 @@ enum btrfs_feature_set {
};
char *btrfs_printable_features(enum btrfs_feature_set set, u64 flags);
-const char * const btrfs_feature_set_name(enum btrfs_feature_set set);
+const char *btrfs_feature_set_name(enum btrfs_feature_set set);
int btrfs_sysfs_add_devices_dir(struct btrfs_fs_devices *fs_devices,
struct btrfs_device *one_device);
int btrfs_sysfs_remove_devices_dir(struct btrfs_fs_devices *fs_devices,
--
2.26.2
Powered by blists - more mailing lists