Commit 6853f94a authored by Roi Martin's avatar Roi Martin Committed by Greg Kroah-Hartman

staging: exfat: remove unnecessary parentheses

Fix checkpatch.pl warning:

	CHECK: Unnecessary parentheses around ...
Signed-off-by: default avatarRoi Martin <jroi.martin@gmail.com>
Link: https://lore.kernel.org/r/20191030010328.10203-2-jroi.martin@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent be1f84cf
...@@ -550,7 +550,7 @@ s32 load_alloc_bitmap(struct super_block *sb) ...@@ -550,7 +550,7 @@ s32 load_alloc_bitmap(struct super_block *sb)
for (j = 0; j < p_fs->map_sectors; j++) { for (j = 0; j < p_fs->map_sectors; j++) {
p_fs->vol_amap[j] = NULL; p_fs->vol_amap[j] = NULL;
ret = sector_read(sb, sector + j, &(p_fs->vol_amap[j]), 1); ret = sector_read(sb, sector + j, &p_fs->vol_amap[j], 1);
if (ret != FFS_SUCCESS) { if (ret != FFS_SUCCESS) {
/* release all buffers and free vol_amap */ /* release all buffers and free vol_amap */
i = 0; i = 0;
...@@ -910,10 +910,10 @@ u32 fat_get_entry_type(struct dentry_t *p_entry) ...@@ -910,10 +910,10 @@ u32 fat_get_entry_type(struct dentry_t *p_entry)
{ {
struct dos_dentry_t *ep = (struct dos_dentry_t *)p_entry; struct dos_dentry_t *ep = (struct dos_dentry_t *)p_entry;
if (*(ep->name) == 0x0) if (*ep->name == 0x0)
return TYPE_UNUSED; return TYPE_UNUSED;
else if (*(ep->name) == 0xE5) else if (*ep->name == 0xE5)
return TYPE_DELETED; return TYPE_DELETED;
else if (ep->attr == ATTR_EXTEND) else if (ep->attr == ATTR_EXTEND)
...@@ -978,10 +978,10 @@ void fat_set_entry_type(struct dentry_t *p_entry, u32 type) ...@@ -978,10 +978,10 @@ void fat_set_entry_type(struct dentry_t *p_entry, u32 type)
struct dos_dentry_t *ep = (struct dos_dentry_t *)p_entry; struct dos_dentry_t *ep = (struct dos_dentry_t *)p_entry;
if (type == TYPE_UNUSED) if (type == TYPE_UNUSED)
*(ep->name) = 0x0; *ep->name = 0x0;
else if (type == TYPE_DELETED) else if (type == TYPE_DELETED)
*(ep->name) = 0xE5; *ep->name = 0xE5;
else if (type == TYPE_EXTEND) else if (type == TYPE_EXTEND)
ep->attr = ATTR_EXTEND; ep->attr = ATTR_EXTEND;
...@@ -1562,7 +1562,7 @@ void update_dir_checksum_with_entry_set(struct super_block *sb, ...@@ -1562,7 +1562,7 @@ void update_dir_checksum_with_entry_set(struct super_block *sb,
u16 chksum = 0; u16 chksum = 0;
s32 chksum_type = CS_DIR_ENTRY, i; s32 chksum_type = CS_DIR_ENTRY, i;
ep = (struct dentry_t *)&(es->__buf); ep = (struct dentry_t *)&es->__buf;
for (i = 0; i < es->num_entries; i++) { for (i = 0; i < es->num_entries; i++) {
pr_debug("%s ep %p\n", __func__, ep); pr_debug("%s ep %p\n", __func__, ep);
chksum = calc_checksum_2byte((void *)ep, DENTRY_SIZE, chksum, chksum = calc_checksum_2byte((void *)ep, DENTRY_SIZE, chksum,
...@@ -1571,7 +1571,7 @@ void update_dir_checksum_with_entry_set(struct super_block *sb, ...@@ -1571,7 +1571,7 @@ void update_dir_checksum_with_entry_set(struct super_block *sb,
chksum_type = CS_DEFAULT; chksum_type = CS_DEFAULT;
} }
ep = (struct dentry_t *)&(es->__buf); ep = (struct dentry_t *)&es->__buf;
SET16_A(((struct file_dentry_t *)ep)->checksum, chksum); SET16_A(((struct file_dentry_t *)ep)->checksum, chksum);
write_whole_entry_set(sb, es); write_whole_entry_set(sb, es);
} }
...@@ -1832,7 +1832,7 @@ struct entry_set_cache_t *get_entry_set_in_dir(struct super_block *sb, ...@@ -1832,7 +1832,7 @@ struct entry_set_cache_t *get_entry_set_in_dir(struct super_block *sb,
} }
if (file_ep) if (file_ep)
*file_ep = (struct dentry_t *)&(es->__buf); *file_ep = (struct dentry_t *)&es->__buf;
pr_debug("%s exiting es %p sec %llu offset %d flags %d, num_entries %u buf ptr %p\n", pr_debug("%s exiting es %p sec %llu offset %d flags %d, num_entries %u buf ptr %p\n",
__func__, es, (unsigned long long)es->sector, es->offset, __func__, es, (unsigned long long)es->sector, es->offset,
...@@ -1859,7 +1859,7 @@ static s32 __write_partial_entries_in_entry_set(struct super_block *sb, ...@@ -1859,7 +1859,7 @@ static s32 __write_partial_entries_in_entry_set(struct super_block *sb,
struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info); struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info);
struct bd_info_t *p_bd = &(EXFAT_SB(sb)->bd_info); struct bd_info_t *p_bd = &(EXFAT_SB(sb)->bd_info);
u32 clu; u32 clu;
u8 *buf, *esbuf = (u8 *)&(es->__buf); u8 *buf, *esbuf = (u8 *)&es->__buf;
pr_debug("%s entered es %p sec %llu off %d count %d\n", pr_debug("%s entered es %p sec %llu off %d count %d\n",
__func__, es, (unsigned long long)sec, off, count); __func__, es, (unsigned long long)sec, off, count);
...@@ -1929,7 +1929,7 @@ s32 write_partial_entries_in_entry_set(struct super_block *sb, ...@@ -1929,7 +1929,7 @@ s32 write_partial_entries_in_entry_set(struct super_block *sb,
struct chain_t dir; struct chain_t dir;
/* vaidity check */ /* vaidity check */
if (ep + count > ((struct dentry_t *)&(es->__buf)) + es->num_entries) if (ep + count > ((struct dentry_t *)&es->__buf) + es->num_entries)
return FFS_ERROR; return FFS_ERROR;
dir.dir = GET_CLUSTER_FROM_SECTOR(es->sector); dir.dir = GET_CLUSTER_FROM_SECTOR(es->sector);
...@@ -1938,7 +1938,7 @@ s32 write_partial_entries_in_entry_set(struct super_block *sb, ...@@ -1938,7 +1938,7 @@ s32 write_partial_entries_in_entry_set(struct super_block *sb,
byte_offset = (es->sector - START_SECTOR(dir.dir)) << byte_offset = (es->sector - START_SECTOR(dir.dir)) <<
p_bd->sector_size_bits; p_bd->sector_size_bits;
byte_offset += ((void **)ep - &(es->__buf)) + es->offset; byte_offset += ((void **)ep - &es->__buf) + es->offset;
ret = _walk_fat_chain(sb, &dir, byte_offset, &clu); ret = _walk_fat_chain(sb, &dir, byte_offset, &clu);
if (ret != FFS_SUCCESS) if (ret != FFS_SUCCESS)
...@@ -2122,7 +2122,7 @@ s32 find_empty_entry(struct inode *inode, struct chain_t *p_dir, s32 num_entries ...@@ -2122,7 +2122,7 @@ s32 find_empty_entry(struct inode *inode, struct chain_t *p_dir, s32 num_entries
p_fs->fs_func->set_entry_flag(ep, p_dir->flags); p_fs->fs_func->set_entry_flag(ep, p_dir->flags);
buf_modify(sb, sector); buf_modify(sb, sector);
update_dir_checksum(sb, &(fid->dir), update_dir_checksum(sb, &fid->dir,
fid->entry); fid->entry);
} }
} }
......
...@@ -1003,13 +1003,13 @@ static int ffsWriteFile(struct inode *inode, struct file_id_t *fid, ...@@ -1003,13 +1003,13 @@ static int ffsWriteFile(struct inode *inode, struct file_id_t *fid,
/* (3) update the direcoty entry */ /* (3) update the direcoty entry */
if (p_fs->vol_type == EXFAT) { if (p_fs->vol_type == EXFAT) {
es = get_entry_set_in_dir(sb, &(fid->dir), fid->entry, es = get_entry_set_in_dir(sb, &fid->dir, fid->entry,
ES_ALL_ENTRIES, &ep); ES_ALL_ENTRIES, &ep);
if (!es) if (!es)
goto err_out; goto err_out;
ep2 = ep + 1; ep2 = ep + 1;
} else { } else {
ep = get_entry_in_dir(sb, &(fid->dir), fid->entry, &sector); ep = get_entry_in_dir(sb, &fid->dir, fid->entry, &sector);
if (!ep) if (!ep)
goto err_out; goto err_out;
ep2 = ep; ep2 = ep;
...@@ -1142,7 +1142,7 @@ static int ffsTruncateFile(struct inode *inode, u64 old_size, u64 new_size) ...@@ -1142,7 +1142,7 @@ static int ffsTruncateFile(struct inode *inode, u64 old_size, u64 new_size)
} }
ep2 = ep + 1; ep2 = ep + 1;
} else { } else {
ep = get_entry_in_dir(sb, &(fid->dir), fid->entry, &sector); ep = get_entry_in_dir(sb, &fid->dir, fid->entry, &sector);
if (!ep) { if (!ep) {
ret = FFS_MEDIAERR; ret = FFS_MEDIAERR;
goto out; goto out;
...@@ -1277,7 +1277,7 @@ static int ffsMoveFile(struct inode *old_parent_inode, struct file_id_t *fid, ...@@ -1277,7 +1277,7 @@ static int ffsMoveFile(struct inode *old_parent_inode, struct file_id_t *fid,
update_parent_info(new_fid, new_parent_inode); update_parent_info(new_fid, new_parent_inode);
p_dir = &(new_fid->dir); p_dir = &new_fid->dir;
new_entry = new_fid->entry; new_entry = new_fid->entry;
ep = get_entry_in_dir(sb, p_dir, new_entry, NULL); ep = get_entry_in_dir(sb, p_dir, new_entry, NULL);
if (!ep) if (!ep)
...@@ -1438,14 +1438,14 @@ static int ffsSetAttr(struct inode *inode, u32 attr) ...@@ -1438,14 +1438,14 @@ static int ffsSetAttr(struct inode *inode, u32 attr)
/* get the directory entry of given file */ /* get the directory entry of given file */
if (p_fs->vol_type == EXFAT) { if (p_fs->vol_type == EXFAT) {
es = get_entry_set_in_dir(sb, &(fid->dir), fid->entry, es = get_entry_set_in_dir(sb, &fid->dir, fid->entry,
ES_ALL_ENTRIES, &ep); ES_ALL_ENTRIES, &ep);
if (!es) { if (!es) {
ret = FFS_MEDIAERR; ret = FFS_MEDIAERR;
goto out; goto out;
} }
} else { } else {
ep = get_entry_in_dir(sb, &(fid->dir), fid->entry, &sector); ep = get_entry_in_dir(sb, &fid->dir, fid->entry, &sector);
if (!ep) { if (!ep) {
ret = FFS_MEDIAERR; ret = FFS_MEDIAERR;
goto out; goto out;
...@@ -1554,7 +1554,7 @@ static int ffsReadStat(struct inode *inode, struct dir_entry_t *info) ...@@ -1554,7 +1554,7 @@ static int ffsReadStat(struct inode *inode, struct dir_entry_t *info)
/* get the directory entry of given file or directory */ /* get the directory entry of given file or directory */
if (p_fs->vol_type == EXFAT) { if (p_fs->vol_type == EXFAT) {
es = get_entry_set_in_dir(sb, &(fid->dir), fid->entry, es = get_entry_set_in_dir(sb, &fid->dir, fid->entry,
ES_2_ENTRIES, &ep); ES_2_ENTRIES, &ep);
if (!es) { if (!es) {
ret = FFS_MEDIAERR; ret = FFS_MEDIAERR;
...@@ -1562,7 +1562,7 @@ static int ffsReadStat(struct inode *inode, struct dir_entry_t *info) ...@@ -1562,7 +1562,7 @@ static int ffsReadStat(struct inode *inode, struct dir_entry_t *info)
} }
ep2 = ep + 1; ep2 = ep + 1;
} else { } else {
ep = get_entry_in_dir(sb, &(fid->dir), fid->entry, &sector); ep = get_entry_in_dir(sb, &fid->dir, fid->entry, &sector);
if (!ep) { if (!ep) {
ret = FFS_MEDIAERR; ret = FFS_MEDIAERR;
goto out; goto out;
...@@ -1594,11 +1594,11 @@ static int ffsReadStat(struct inode *inode, struct dir_entry_t *info) ...@@ -1594,11 +1594,11 @@ static int ffsReadStat(struct inode *inode, struct dir_entry_t *info)
memset((char *)&info->AccessTimestamp, 0, sizeof(struct date_time_t)); memset((char *)&info->AccessTimestamp, 0, sizeof(struct date_time_t));
*(uni_name.name) = 0x0; *uni_name.name = 0x0;
/* XXX this is very bad for exfat cuz name is already included in es. /* XXX this is very bad for exfat cuz name is already included in es.
* API should be revised * API should be revised
*/ */
p_fs->fs_func->get_uni_name_from_ext_entry(sb, &(fid->dir), fid->entry, p_fs->fs_func->get_uni_name_from_ext_entry(sb, &fid->dir, fid->entry,
uni_name.name); uni_name.name);
if (*uni_name.name == 0x0 && p_fs->vol_type != EXFAT) if (*uni_name.name == 0x0 && p_fs->vol_type != EXFAT)
get_uni_name_from_dos_entry(sb, (struct dos_dentry_t *)ep, get_uni_name_from_dos_entry(sb, (struct dos_dentry_t *)ep,
...@@ -1678,7 +1678,7 @@ static int ffsWriteStat(struct inode *inode, struct dir_entry_t *info) ...@@ -1678,7 +1678,7 @@ static int ffsWriteStat(struct inode *inode, struct dir_entry_t *info)
/* get the directory entry of given file or directory */ /* get the directory entry of given file or directory */
if (p_fs->vol_type == EXFAT) { if (p_fs->vol_type == EXFAT) {
es = get_entry_set_in_dir(sb, &(fid->dir), fid->entry, es = get_entry_set_in_dir(sb, &fid->dir, fid->entry,
ES_ALL_ENTRIES, &ep); ES_ALL_ENTRIES, &ep);
if (!es) { if (!es) {
ret = FFS_MEDIAERR; ret = FFS_MEDIAERR;
...@@ -1687,7 +1687,7 @@ static int ffsWriteStat(struct inode *inode, struct dir_entry_t *info) ...@@ -1687,7 +1687,7 @@ static int ffsWriteStat(struct inode *inode, struct dir_entry_t *info)
ep2 = ep + 1; ep2 = ep + 1;
} else { } else {
/* for other than exfat */ /* for other than exfat */
ep = get_entry_in_dir(sb, &(fid->dir), fid->entry, &sector); ep = get_entry_in_dir(sb, &fid->dir, fid->entry, &sector);
if (!ep) { if (!ep) {
ret = FFS_MEDIAERR; ret = FFS_MEDIAERR;
goto out; goto out;
...@@ -1845,7 +1845,7 @@ static int ffsMapCluster(struct inode *inode, s32 clu_offset, u32 *clu) ...@@ -1845,7 +1845,7 @@ static int ffsMapCluster(struct inode *inode, s32 clu_offset, u32 *clu)
/* (3) update directory entry */ /* (3) update directory entry */
if (modified) { if (modified) {
if (p_fs->vol_type != EXFAT) { if (p_fs->vol_type != EXFAT) {
ep = get_entry_in_dir(sb, &(fid->dir), ep = get_entry_in_dir(sb, &fid->dir,
fid->entry, &sector); fid->entry, &sector);
if (!ep) { if (!ep) {
ret = FFS_MEDIAERR; ret = FFS_MEDIAERR;
...@@ -2058,7 +2058,7 @@ static int ffsReadDir(struct inode *inode, struct dir_entry_t *dir_entry) ...@@ -2058,7 +2058,7 @@ static int ffsReadDir(struct inode *inode, struct dir_entry_t *dir_entry)
memset((char *)&dir_entry->AccessTimestamp, 0, memset((char *)&dir_entry->AccessTimestamp, 0,
sizeof(struct date_time_t)); sizeof(struct date_time_t));
*(uni_name.name) = 0x0; *uni_name.name = 0x0;
fs_func->get_uni_name_from_ext_entry(sb, &dir, dentry, fs_func->get_uni_name_from_ext_entry(sb, &dir, dentry,
uni_name.name); uni_name.name);
if (*uni_name.name == 0x0 && p_fs->vol_type != EXFAT) if (*uni_name.name == 0x0 && p_fs->vol_type != EXFAT)
...@@ -2116,7 +2116,7 @@ static int ffsReadDir(struct inode *inode, struct dir_entry_t *dir_entry) ...@@ -2116,7 +2116,7 @@ static int ffsReadDir(struct inode *inode, struct dir_entry_t *dir_entry)
} }
} }
*(dir_entry->Name) = '\0'; *dir_entry->Name = '\0';
fid->rwoffset = (s64)(++dentry); fid->rwoffset = (s64)(++dentry);
...@@ -2202,7 +2202,7 @@ static int exfat_readdir(struct file *filp, struct dir_context *ctx) ...@@ -2202,7 +2202,7 @@ static int exfat_readdir(struct file *filp, struct dir_context *ctx)
struct inode *inode = file_inode(filp); struct inode *inode = file_inode(filp);
struct super_block *sb = inode->i_sb; struct super_block *sb = inode->i_sb;
struct exfat_sb_info *sbi = EXFAT_SB(sb); struct exfat_sb_info *sbi = EXFAT_SB(sb);
struct fs_info_t *p_fs = &(sbi->fs_info); struct fs_info_t *p_fs = &sbi->fs_info;
struct bd_info_t *p_bd = &(EXFAT_SB(sb)->bd_info); struct bd_info_t *p_bd = &(EXFAT_SB(sb)->bd_info);
struct dir_entry_t de; struct dir_entry_t de;
unsigned long inum; unsigned long inum;
...@@ -2293,7 +2293,7 @@ static int exfat_ioctl_volume_id(struct inode *dir) ...@@ -2293,7 +2293,7 @@ static int exfat_ioctl_volume_id(struct inode *dir)
{ {
struct super_block *sb = dir->i_sb; struct super_block *sb = dir->i_sb;
struct exfat_sb_info *sbi = EXFAT_SB(sb); struct exfat_sb_info *sbi = EXFAT_SB(sb);
struct fs_info_t *p_fs = &(sbi->fs_info); struct fs_info_t *p_fs = &sbi->fs_info;
return p_fs->vol_id; return p_fs->vol_id;
} }
...@@ -2895,7 +2895,7 @@ static void exfat_truncate(struct inode *inode, loff_t old_size) ...@@ -2895,7 +2895,7 @@ static void exfat_truncate(struct inode *inode, loff_t old_size)
{ {
struct super_block *sb = inode->i_sb; struct super_block *sb = inode->i_sb;
struct exfat_sb_info *sbi = EXFAT_SB(sb); struct exfat_sb_info *sbi = EXFAT_SB(sb);
struct fs_info_t *p_fs = &(sbi->fs_info); struct fs_info_t *p_fs = &sbi->fs_info;
int err; int err;
__lock_super(sb); __lock_super(sb);
...@@ -3073,8 +3073,8 @@ static int exfat_bmap(struct inode *inode, sector_t sector, sector_t *phys, ...@@ -3073,8 +3073,8 @@ static int exfat_bmap(struct inode *inode, sector_t sector, sector_t *phys,
{ {
struct super_block *sb = inode->i_sb; struct super_block *sb = inode->i_sb;
struct exfat_sb_info *sbi = EXFAT_SB(sb); struct exfat_sb_info *sbi = EXFAT_SB(sb);
struct fs_info_t *p_fs = &(sbi->fs_info); struct fs_info_t *p_fs = &sbi->fs_info;
struct bd_info_t *p_bd = &(sbi->bd_info); struct bd_info_t *p_bd = &sbi->bd_info;
const unsigned long blocksize = sb->s_blocksize; const unsigned long blocksize = sb->s_blocksize;
const unsigned char blocksize_bits = sb->s_blocksize_bits; const unsigned char blocksize_bits = sb->s_blocksize_bits;
sector_t last_block; sector_t last_block;
...@@ -3302,7 +3302,7 @@ static struct inode *exfat_iget(struct super_block *sb, loff_t i_pos) ...@@ -3302,7 +3302,7 @@ static struct inode *exfat_iget(struct super_block *sb, loff_t i_pos)
static int exfat_fill_inode(struct inode *inode, struct file_id_t *fid) static int exfat_fill_inode(struct inode *inode, struct file_id_t *fid)
{ {
struct exfat_sb_info *sbi = EXFAT_SB(inode->i_sb); struct exfat_sb_info *sbi = EXFAT_SB(inode->i_sb);
struct fs_info_t *p_fs = &(sbi->fs_info); struct fs_info_t *p_fs = &sbi->fs_info;
struct dir_entry_t info; struct dir_entry_t info;
memcpy(&(EXFAT_I(inode)->fid), fid, sizeof(struct file_id_t)); memcpy(&(EXFAT_I(inode)->fid), fid, sizeof(struct file_id_t));
...@@ -3787,7 +3787,7 @@ static int exfat_read_root(struct inode *inode) ...@@ -3787,7 +3787,7 @@ static int exfat_read_root(struct inode *inode)
{ {
struct super_block *sb = inode->i_sb; struct super_block *sb = inode->i_sb;
struct exfat_sb_info *sbi = EXFAT_SB(sb); struct exfat_sb_info *sbi = EXFAT_SB(sb);
struct fs_info_t *p_fs = &(sbi->fs_info); struct fs_info_t *p_fs = &sbi->fs_info;
struct dir_entry_t info; struct dir_entry_t info;
EXFAT_I(inode)->fid.dir.dir = p_fs->root_dir; EXFAT_I(inode)->fid.dir.dir = p_fs->root_dir;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment