Skip to content

Commit 6827d50

Browse files
fs/ntfs3: Refactoring of various minor issues
Removed unused macro. Changed null pointer checking. Fixed inconsistent indenting. Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
1 parent 30200ef commit 6827d50

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

fs/ntfs3/bitmap.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,8 @@ int wnd_init(struct wnd_bitmap *wnd, struct super_block *sb, size_t nbits)
658658
if (!wnd->bits_last)
659659
wnd->bits_last = wbits;
660660

661-
wnd->free_bits = kcalloc(wnd->nwnd, sizeof(u16), GFP_NOFS | __GFP_NOWARN);
661+
wnd->free_bits =
662+
kcalloc(wnd->nwnd, sizeof(u16), GFP_NOFS | __GFP_NOWARN);
662663
if (!wnd->free_bits)
663664
return -ENOMEM;
664665

fs/ntfs3/frecord.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1645,7 +1645,7 @@ struct ATTR_FILE_NAME *ni_fname_name(struct ntfs_inode *ni,
16451645
{
16461646
struct ATTRIB *attr = NULL;
16471647
struct ATTR_FILE_NAME *fname;
1648-
struct le_str *fns;
1648+
struct le_str *fns;
16491649

16501650
if (le)
16511651
*le = NULL;

fs/ntfs3/fsntfs.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2599,8 +2599,10 @@ static inline bool is_reserved_name(struct ntfs_sb_info *sbi,
25992599
if (len == 4 || (len > 4 && le16_to_cpu(name[4]) == '.')) {
26002600
port_digit = le16_to_cpu(name[3]);
26012601
if (port_digit >= '1' && port_digit <= '9')
2602-
if (!ntfs_cmp_names(name, 3, COM_NAME, 3, upcase, false) ||
2603-
!ntfs_cmp_names(name, 3, LPT_NAME, 3, upcase, false))
2602+
if (!ntfs_cmp_names(name, 3, COM_NAME, 3, upcase,
2603+
false) ||
2604+
!ntfs_cmp_names(name, 3, LPT_NAME, 3, upcase,
2605+
false))
26042606
return true;
26052607
}
26062608

fs/ntfs3/namei.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ static struct dentry *ntfs_lookup(struct inode *dir, struct dentry *dentry,
9393
* If the MFT record of ntfs inode is not a base record, inode->i_op can be NULL.
9494
* This causes null pointer dereference in d_splice_alias().
9595
*/
96-
if (!IS_ERR(inode) && inode->i_op == NULL) {
96+
if (!IS_ERR_OR_NULL(inode) && !inode->i_op) {
9797
iput(inode);
9898
inode = ERR_PTR(-EINVAL);
9999
}

fs/ntfs3/ntfs.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,6 @@ static inline u64 attr_svcn(const struct ATTRIB *attr)
435435
return attr->non_res ? le64_to_cpu(attr->nres.svcn) : 0;
436436
}
437437

438-
/* The size of resident attribute by its resident size. */
439-
#define BYTES_PER_RESIDENT(b) (0x18 + (b))
440-
441438
static_assert(sizeof(struct ATTRIB) == 0x48);
442439
static_assert(sizeof(((struct ATTRIB *)NULL)->res) == 0x08);
443440
static_assert(sizeof(((struct ATTRIB *)NULL)->nres) == 0x38);

0 commit comments

Comments
 (0)