[PATCH v1] Squashfs: convert to use ERR_CAST()

Shen Lichuan posted 1 patch 1 year, 3 months ago
fs/squashfs/xattr_id.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH v1] Squashfs: convert to use ERR_CAST()
Posted by Shen Lichuan 1 year, 3 months ago
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@vivo.com>
---
 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