mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 17:08:10 +00:00
staging: exfat: use integer constants
Replace manually generated values with predefined constants. Signed-off-by: Valentin Vidic <vvidic@valentin-vidic.from.hr> Link: https://lore.kernel.org/r/20190908152616.25459-3-vvidic@valentin-vidic.from.hr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
0e739ba8e2
commit
4e35a0d87c
2 changed files with 13 additions and 13 deletions
|
@ -204,7 +204,7 @@ s32 fat_alloc_cluster(struct super_block *sb, s32 num_alloc,
|
|||
|
||||
if ((--num_alloc) == 0) {
|
||||
p_fs->clu_srch_ptr = new_clu;
|
||||
if (p_fs->used_clusters != (u32)~0)
|
||||
if (p_fs->used_clusters != UINT_MAX)
|
||||
p_fs->used_clusters += num_clusters;
|
||||
|
||||
return num_clusters;
|
||||
|
@ -215,7 +215,7 @@ s32 fat_alloc_cluster(struct super_block *sb, s32 num_alloc,
|
|||
}
|
||||
|
||||
p_fs->clu_srch_ptr = new_clu;
|
||||
if (p_fs->used_clusters != (u32)~0)
|
||||
if (p_fs->used_clusters != UINT_MAX)
|
||||
p_fs->used_clusters += num_clusters;
|
||||
|
||||
return num_clusters;
|
||||
|
@ -273,7 +273,7 @@ s32 exfat_alloc_cluster(struct super_block *sb, s32 num_alloc,
|
|||
|
||||
if ((--num_alloc) == 0) {
|
||||
p_fs->clu_srch_ptr = hint_clu;
|
||||
if (p_fs->used_clusters != (u32)~0)
|
||||
if (p_fs->used_clusters != UINT_MAX)
|
||||
p_fs->used_clusters += num_clusters;
|
||||
|
||||
p_chain->size += num_clusters;
|
||||
|
@ -293,7 +293,7 @@ s32 exfat_alloc_cluster(struct super_block *sb, s32 num_alloc,
|
|||
}
|
||||
|
||||
p_fs->clu_srch_ptr = hint_clu;
|
||||
if (p_fs->used_clusters != (u32)~0)
|
||||
if (p_fs->used_clusters != UINT_MAX)
|
||||
p_fs->used_clusters += num_clusters;
|
||||
|
||||
p_chain->size += num_clusters;
|
||||
|
@ -337,7 +337,7 @@ void fat_free_cluster(struct super_block *sb, struct chain_t *p_chain,
|
|||
|
||||
} while (clu != CLUSTER_32(~0));
|
||||
|
||||
if (p_fs->used_clusters != (u32)~0)
|
||||
if (p_fs->used_clusters != UINT_MAX)
|
||||
p_fs->used_clusters -= num_clusters;
|
||||
}
|
||||
|
||||
|
@ -396,7 +396,7 @@ void exfat_free_cluster(struct super_block *sb, struct chain_t *p_chain,
|
|||
} while ((clu != CLUSTER_32(0)) && (clu != CLUSTER_32(~0)));
|
||||
}
|
||||
|
||||
if (p_fs->used_clusters != (u32)~0)
|
||||
if (p_fs->used_clusters != UINT_MAX)
|
||||
p_fs->used_clusters -= num_clusters;
|
||||
}
|
||||
|
||||
|
@ -3064,7 +3064,7 @@ s32 fat16_mount(struct super_block *sb, struct pbr_sector_t *p_pbr)
|
|||
|
||||
p_fs->vol_flag = VOL_CLEAN;
|
||||
p_fs->clu_srch_ptr = 2;
|
||||
p_fs->used_clusters = (u32)~0;
|
||||
p_fs->used_clusters = UINT_MAX;
|
||||
|
||||
p_fs->fs_func = &fat_fs_func;
|
||||
|
||||
|
@ -3117,7 +3117,7 @@ s32 fat32_mount(struct super_block *sb, struct pbr_sector_t *p_pbr)
|
|||
|
||||
p_fs->vol_flag = VOL_CLEAN;
|
||||
p_fs->clu_srch_ptr = 2;
|
||||
p_fs->used_clusters = (u32)~0;
|
||||
p_fs->used_clusters = UINT_MAX;
|
||||
|
||||
p_fs->fs_func = &fat_fs_func;
|
||||
|
||||
|
@ -3192,7 +3192,7 @@ s32 exfat_mount(struct super_block *sb, struct pbr_sector_t *p_pbr)
|
|||
|
||||
p_fs->vol_flag = (u32)GET16(p_bpb->vol_flags);
|
||||
p_fs->clu_srch_ptr = 2;
|
||||
p_fs->used_clusters = (u32)~0;
|
||||
p_fs->used_clusters = UINT_MAX;
|
||||
|
||||
p_fs->fs_func = &exfat_fs_func;
|
||||
|
||||
|
|
|
@ -502,7 +502,7 @@ static int ffsGetVolInfo(struct super_block *sb, struct vol_info_t *info)
|
|||
/* acquire the lock for file system critical section */
|
||||
down(&p_fs->v_sem);
|
||||
|
||||
if (p_fs->used_clusters == (u32)~0)
|
||||
if (p_fs->used_clusters == UINT_MAX)
|
||||
p_fs->used_clusters = p_fs->fs_func->count_used_clusters(sb);
|
||||
|
||||
info->FatType = p_fs->vol_type;
|
||||
|
@ -3503,7 +3503,7 @@ static int exfat_statfs(struct dentry *dentry, struct kstatfs *buf)
|
|||
struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info);
|
||||
struct vol_info_t info;
|
||||
|
||||
if (p_fs->used_clusters == (u32)~0) {
|
||||
if (p_fs->used_clusters == UINT_MAX) {
|
||||
if (ffsGetVolInfo(sb, &info) == FFS_MEDIAERR)
|
||||
return -EIO;
|
||||
|
||||
|
@ -3678,7 +3678,7 @@ static int parse_options(char *options, int silent, int *debug,
|
|||
opts->fs_uid = current_uid();
|
||||
opts->fs_gid = current_gid();
|
||||
opts->fs_fmask = opts->fs_dmask = current->fs->umask;
|
||||
opts->allow_utime = (unsigned short)-1;
|
||||
opts->allow_utime = U16_MAX;
|
||||
opts->codepage = exfat_default_codepage;
|
||||
opts->iocharset = exfat_default_iocharset;
|
||||
opts->casesensitive = 0;
|
||||
|
@ -3770,7 +3770,7 @@ static int parse_options(char *options, int silent, int *debug,
|
|||
}
|
||||
|
||||
out:
|
||||
if (opts->allow_utime == (unsigned short)-1)
|
||||
if (opts->allow_utime == U16_MAX)
|
||||
opts->allow_utime = ~opts->fs_dmask & 0022;
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue