]> 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 09:53:51 +0000 (11:53 +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/namei.c
fs/ntfs3/ntfs.h

index 45f95c1cb25849f95f7286017d6c1e954c622bc5..e0cdc91d88a8549d3c994081393733b712fda166 100644 (file)
@@ -661,7 +661,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 7760aedc06728ce76de7e364f4e211c84751bc74..a9549e73081fb91bfc379beddbb72a9bcbec5b88 100644 (file)
@@ -91,7 +91,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 9cc396b117bfd9b02531ad6c6de89ded53bba7f3..0f38d558169a1fb727d3e2a3fe31720941a24309 100644 (file)
@@ -436,9 +436,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);