summaryrefslogtreecommitdiff
path: root/fs/ntfs3
diff options
context:
space:
mode:
authorDaniel Pinto <danielpinto52@gmail.com>2022-11-15 11:17:32 +0300
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2023-03-27 15:59:07 +0300
commit0203471df1d5242ab63692ddd9e95f37f0cddadc (patch)
treea6a30974b4513ea15373d10f73fda1b45a63f16c /fs/ntfs3
parent197b6b60ae7bc51dd0814953c562833143b292aa (diff)
downloadlinux-0203471df1d5242ab63692ddd9e95f37f0cddadc.tar.xz
fs/ntfs3: Fix wrong cast in xattr.c
cpu_to_be32 and be32_to_cpu respectively return and receive __be32, change the cast to the correct types. Fixes the following sparse warnings: fs/ntfs3/xattr.c:811:48: sparse: sparse: incorrect type in assignment (different base types) fs/ntfs3/xattr.c:901:34: sparse: sparse: cast to restricted __be32 Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Daniel Pinto <danielpinto52@gmail.com> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3')
-rw-r--r--fs/ntfs3/xattr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c
index ff64302e87e5..f8043838eb92 100644
--- a/fs/ntfs3/xattr.c
+++ b/fs/ntfs3/xattr.c
@@ -780,7 +780,7 @@ static int ntfs_getxattr(const struct xattr_handler *handler, struct dentry *de,
err = sizeof(u32);
*(u32 *)buffer = le32_to_cpu(ni->std_fa);
if (!strcmp(name, SYSTEM_NTFS_ATTRIB_BE))
- *(u32 *)buffer = cpu_to_be32(*(u32 *)buffer);
+ *(__be32 *)buffer = cpu_to_be32(*(u32 *)buffer);
}
goto out;
}
@@ -857,7 +857,7 @@ static noinline int ntfs_setxattr(const struct xattr_handler *handler,
if (size != sizeof(u32))
goto out;
if (!strcmp(name, SYSTEM_NTFS_ATTRIB_BE))
- new_fa = cpu_to_le32(be32_to_cpu(*(u32 *)value));
+ new_fa = cpu_to_le32(be32_to_cpu(*(__be32 *)value));
else
new_fa = cpu_to_le32(*(u32 *)value);