--- zzzz-none-000/linux-4.9.279/fs/squashfs/squashfs_fs.h 2021-08-08 06:38:54.000000000 +0000 +++ puma7-arm-6591-750/linux-4.9.279/fs/squashfs/squashfs_fs.h 2023-02-08 10:58:16.000000000 +0000 @@ -130,9 +130,20 @@ #define SQUASHFS_COMPRESSED_BLOCK(B) (!((B) & SQUASHFS_COMPRESSED_BIT_BLOCK)) +// AVM/TKL: support for native endian +#ifdef CONFIG_SQUASHFS_NATIVE_ENDIAN +#define sqsh16_to_cpu(x) (x) +#define sqsh32_to_cpu(x) (x) +#define sqsh64_to_cpu(x) (x) +#else +#define sqsh16_to_cpu(x) le16_to_cpu(x) +#define sqsh32_to_cpu(x) le32_to_cpu(x) +#define sqsh64_to_cpu(x) le64_to_cpu(x) +#endif + static inline int squashfs_block_size(__le32 raw) { - u32 size = le32_to_cpu(raw); + u32 size = sqsh32_to_cpu(raw); return (size >> 25) ? -EIO : size; }