btrfs: sysfs: Drop unnecessary double logical negation in acl_show()
PATCH 1/1 btrfs: sysfs: Drop unnecessary double logical negation in acl_show()
The IS_ENABLED() macro already guarantees the result will be a suitable boolean return value ("1" for enabled, and "0" for disabled).
Thus, it seems that the "!!" used right before is unnecessary, since it is a double negation.
Dropping it should not result in any functional changes.
--- fs/btrfs/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/sysfs.c +1 -1
@@ -421,7 +421,7 @@ BTRFS_ATTR(static_feature, supported_sectorsizes,static ssize_t acl_show (struct kobject *kobj,struct kobj_attribute *a,char *buf) { -return sysfs_emit (buf,"%d\n" , !!IS_ENABLED (CONFIG_BTRFS_FS_POSIX_ACL )); +return sysfs_emit (buf,"%d\n" ,IS_ENABLED (CONFIG_BTRFS_FS_POSIX_ACL )); }BTRFS_ATTR (static_feature, acl, acl_show);
Signature · 1 line
2.43.0
Quoted 9 lines · Neal Gompa
The
IS_ENABLED()macro already guarantees the result will be a suitable boolean return value ("1" for enabled, and "0" for disabled).Thus, it seems that the "!!" used right before is unnecessary, since it is a double negation.
Dropping it should not result in any functional changes.
Signed-off-by Neal Gompa <[email protected]>
Quoted 5 lines · Neal Gompa
The
IS_ENABLED()macro already guarantees the result will be a suitable boolean return value ("1" for enabled, and "0" for disabled).Thus, it seems that the "!!" used right before is unnecessary, since it is a double negation.
Double negation is used to force 0/1 boolean values if it's from an unknown source or value range but IS_ENABLED says it's returning 0/1 so yeah it's not needed.
Quoted 3 lines
Dropping it should not result in any functional changes.
Signed-off-by Neal Gompa <[email protected]>