[PATCH 04/11] fs/ntfs3: minor code cleanups

From: Konstantin Komarov

Date: Fri Oct 09 2026 - 13:18:18 EST


Use Add2Ptr() for pointer arithmetic in fill_name_de(), consistent
with the rest of the driver, and reflow two statements to match the
80-column style.

No functional change.

Signed-off-by: Konstantin Komarov <almaz.alexandrovich@xxxxxxxxxxxxxxxxxxxx>
---
fs/ntfs3/inode.c | 3 +--
fs/ntfs3/namei.c | 6 +++---
2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c
index e6c96ef88b01..1f1b2e5897e1 100644
--- a/fs/ntfs3/inode.c
+++ b/fs/ntfs3/inode.c
@@ -285,8 +285,7 @@ static int ntfs_read_mft(struct inode *inode, const struct cpu_str *name,
break;

case ATTR_ROOT:
- if (attr->non_res ||
- asize < sizeof(struct INDEX_ROOT) + roff ||
+ if (attr->non_res || asize < sizeof(struct INDEX_ROOT) + roff ||
rsize < sizeof(struct INDEX_ROOT))
goto out;

diff --git a/fs/ntfs3/namei.c b/fs/ntfs3/namei.c
index ec59bbabd3c5..46923fff0865 100644
--- a/fs/ntfs3/namei.c
+++ b/fs/ntfs3/namei.c
@@ -56,7 +56,7 @@ int fill_name_de(struct ntfs_sb_info *sbi, void *buf, const struct qstr *name,
real_size = data_size + sizeof(struct NTFS_DE);
aligned_size = ALIGN(data_size, 8) + sizeof(struct NTFS_DE);
if (aligned_size > real_size)
- memset((char *)buf + real_size, 0, aligned_size - real_size);
+ memset(Add2Ptr(buf, real_size), 0, aligned_size - real_size);

e->size = cpu_to_le16(aligned_size);
e->key_size = cpu_to_le16(data_size);
@@ -231,8 +231,8 @@ static int ntfs_symlink(struct mnt_idmap *idmap, struct inode *dir,
static struct dentry *ntfs_mkdir(struct mnt_idmap *idmap, struct inode *dir,
struct dentry *dentry, umode_t mode)
{
- return ERR_PTR(ntfs_create_inode(idmap, dir, dentry, NULL,
- mode, 0, NULL, 0, NULL));
+ return ERR_PTR(ntfs_create_inode(idmap, dir, dentry, NULL, mode, 0,
+ NULL, 0, NULL));
}

/*
--
2.43.0