]> git.itanic.dy.fi Git - linux-stable/commitdiff
fs/ntfs3: Refactoring of various minor issues
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Fri, 30 Dec 2022 10:58:25 +0000 (14:58 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 11:59:08 +0000 (13:59 +0200)
commit 6827d50b2c430c329af442b64c9176d174f56521 upstream.

Removed unused macro.
Changed null pointer checking.
Fixed inconsistent indenting.

Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Cc: Rudi Heitbaum <rudi@heitbaum.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ntfs3/bitmap.c
fs/ntfs3/frecord.c
fs/ntfs3/fsntfs.c
fs/ntfs3/namei.c
fs/ntfs3/ntfs.h

index 723fb64e653160a5ce42194429fd7d71c4acbe1b..393c726ef17a9aff967076e12fbe70e678843c93 100644 (file)
@@ -658,7 +658,8 @@ int wnd_init(struct wnd_bitmap *wnd, struct super_block *sb, size_t nbits)
        if (!wnd->bits_last)
                wnd->bits_last = wbits;
 
-       wnd->free_bits = kcalloc(wnd->nwnd, sizeof(u16), GFP_NOFS | __GFP_NOWARN);
+       wnd->free_bits =
+               kcalloc(wnd->nwnd, sizeof(u16), GFP_NOFS | __GFP_NOWARN);
        if (!wnd->free_bits)
                return -ENOMEM;
 
index f1df52dfab74ba5dac22c775439d938d7c144fd3..7d0473da12c33104dcfaf12564533c7fdfcb6142 100644 (file)
@@ -1645,7 +1645,7 @@ struct ATTR_FILE_NAME *ni_fname_name(struct ntfs_inode *ni,
 {
        struct ATTRIB *attr = NULL;
        struct ATTR_FILE_NAME *fname;
-       struct le_str *fns;
+       struct le_str *fns;
 
        if (le)
                *le = NULL;
index 567563771bf8997ec3e64eb3793798cfba24dff5..24c9aeb5a49e0ca8f5d8af3c4c8506a16e9870bc 100644 (file)
@@ -2594,8 +2594,10 @@ static inline bool is_reserved_name(struct ntfs_sb_info *sbi,
        if (len == 4 || (len > 4 && le16_to_cpu(name[4]) == '.')) {
                port_digit = le16_to_cpu(name[3]);
                if (port_digit >= '1' && port_digit <= '9')
-                       if (!ntfs_cmp_names(name, 3, COM_NAME, 3, upcase, false) ||
-                           !ntfs_cmp_names(name, 3, LPT_NAME, 3, upcase, false))
+                       if (!ntfs_cmp_names(name, 3, COM_NAME, 3, upcase,
+                                           false) ||
+                           !ntfs_cmp_names(name, 3, LPT_NAME, 3, upcase,
+                                           false))
                                return true;
        }
 
index 3db34d5c03dc7f0e6f0206eaff62d6242b0f28a7..53ddea219e377effaa92e641844c09f6845dc665 100644 (file)
@@ -93,7 +93,7 @@ static struct dentry *ntfs_lookup(struct inode *dir, struct dentry *dentry,
         * If the MFT record of ntfs inode is not a base record, inode->i_op can be NULL.
         * This causes null pointer dereference in d_splice_alias().
         */
-       if (!IS_ERR(inode) && inode->i_op == NULL) {
+       if (!IS_ERR_OR_NULL(inode) && !inode->i_op) {
                iput(inode);
                inode = ERR_PTR(-EINVAL);
        }
index 86ea1826d0998065f22e3f4104e41bba13f758d5..90151e56c122254f69682bd20f2f60015971786a 100644 (file)
@@ -435,9 +435,6 @@ static inline u64 attr_svcn(const struct ATTRIB *attr)
        return attr->non_res ? le64_to_cpu(attr->nres.svcn) : 0;
 }
 
-/* The size of resident attribute by its resident size. */
-#define BYTES_PER_RESIDENT(b) (0x18 + (b))
-
 static_assert(sizeof(struct ATTRIB) == 0x48);
 static_assert(sizeof(((struct ATTRIB *)NULL)->res) == 0x08);
 static_assert(sizeof(((struct ATTRIB *)NULL)->nres) == 0x38);