[PATCH v1] Squashfs: convert to use ERR_CAST()
From: Shen Lichuan
Date: Thu Aug 29 2024 - 03:46:18 EST
Use ERR_CAST() as it is designed for casting an error pointer to
another type.
This macro uses the __force and __must_check modifiers, which are used
to tell the compiler to check for errors where this macro is used.
Signed-off-by: Shen Lichuan <shenlichuan@xxxxxxxx>
---
fs/squashfs/xattr_id.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/squashfs/xattr_id.c b/fs/squashfs/xattr_id.c
index c8469c656e0d..eacfdcdf56a8 100644
--- a/fs/squashfs/xattr_id.c
+++ b/fs/squashfs/xattr_id.c
@@ -67,7 +67,7 @@ __le64 *squashfs_read_xattr_id_table(struct super_block *sb, u64 table_start,
id_table = squashfs_read_table(sb, table_start, sizeof(*id_table));
if (IS_ERR(id_table))
- return (__le64 *) id_table;
+ return ERR_CAST(id_table);
*xattr_table_start = le64_to_cpu(id_table->xattr_table_start);
*xattr_ids = le32_to_cpu(id_table->xattr_ids);
--
2.17.1