[PATCH 1/3] fs/btfrs: Fix -Wunused-but-set-variable warnings
From: Leon Romanovsky
Date: Wed Aug 19 2020 - 10:17:05 EST
From: Leon Romanovsky <leonro@xxxxxxxxxx>
The compilation with W=1 generates the following warnings:
fs/btrfs/sysfs.c:1630:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
1630 | int ret;
| ^~~
fs/btrfs/sysfs.c:1629:6: warning: variable 'features' set but not used [-Wunused-but-set-variable]
1629 | u64 features;
| ^~~~~~~~
Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxx>
---
fs/btrfs/sysfs.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index c8df2edafd85..d3652bcc2a86 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -1626,13 +1626,12 @@ void btrfs_sysfs_feature_update(struct btrfs_fs_info *fs_info,
{
struct btrfs_fs_devices *fs_devs;
struct kobject *fsid_kobj;
- u64 features;
- int ret;
+ int __maybe_unused ret;
if (!fs_info)
return;
- features = get_features(fs_info, set);
+ get_features(fs_info, set);
ASSERT(bit & supported_feature_masks[set]);
fs_devs = fs_info->fs_devices;
--
2.26.2