aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ntfs3/super.c
diff options
context:
space:
mode:
authorKari Argillander <kari.argillander@gmail.com>2021-08-16 13:37:32 +0300
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2021-08-27 17:05:09 +0300
commit528c9b3d1edf291685151afecd741d176f527ddf (patch)
tree0dcca37b2231345acf30a66ceede275891fe7817 /fs/ntfs3/super.c
parentfs/ntfs3: Fix various spelling mistakes (diff)
downloadlinux-dev-528c9b3d1edf291685151afecd741d176f527ddf.tar.xz
linux-dev-528c9b3d1edf291685151afecd741d176f527ddf.zip
fs/ntfs3: Use linux/log2 is_power_of_2 function
We do not need our own implementation for this function in this driver. It is much better to use generic one. Signed-off-by: Kari Argillander <kari.argillander@gmail.com> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to '')
-rw-r--r--fs/ntfs3/super.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c
index 84d4f389f685..903975b7e832 100644
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -29,6 +29,7 @@
#include <linux/exportfs.h>
#include <linux/fs.h>
#include <linux/iversion.h>
+#include <linux/log2.h>
#include <linux/module.h>
#include <linux/nls.h>
#include <linux/parser.h>
@@ -735,13 +736,13 @@ static int ntfs_init_from_boot(struct super_block *sb, u32 sector_size,
boot_sector_size = (u32)boot->bytes_per_sector[1] << 8;
if (boot->bytes_per_sector[0] || boot_sector_size < SECTOR_SIZE ||
- !is_power_of2(boot_sector_size)) {
+ !is_power_of_2(boot_sector_size)) {
goto out;
}
/* cluster size: 512, 1K, 2K, 4K, ... 2M */
sct_per_clst = true_sectors_per_clst(boot);
- if (!is_power_of2(sct_per_clst))
+ if (!is_power_of_2(sct_per_clst))
goto out;
mlcn = le64_to_cpu(boot->mft_clst);
@@ -757,14 +758,14 @@ static int ntfs_init_from_boot(struct super_block *sb, u32 sector_size,
/* Check MFT record size */
if ((boot->record_size < 0 &&
SECTOR_SIZE > (2U << (-boot->record_size))) ||
- (boot->record_size >= 0 && !is_power_of2(boot->record_size))) {
+ (boot->record_size >= 0 && !is_power_of_2(boot->record_size))) {
goto out;
}
/* Check index record size */
if ((boot->index_size < 0 &&
SECTOR_SIZE > (2U << (-boot->index_size))) ||
- (boot->index_size >= 0 && !is_power_of2(boot->index_size))) {
+ (boot->index_size >= 0 && !is_power_of_2(boot->index_size))) {
goto out;
}