mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-01 00:49:43 +00:00
99374ff189
This patch removes a number of struct and macro declaration that were found through `git-grep` to be unused. Most of those are related to compressor options and super block flags. For reading a SquashFS image, we do not need the compressor options or the flags. Those only encode settings used for packing the image, mksquashfs uses them when appending data to an existing image. The kernel implementation does not touch those, and we don't need them either. Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
28 lines
846 B
C
28 lines
846 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Copyright (C) 2020 Bootlin
|
|
*
|
|
* Author: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
|
|
*/
|
|
|
|
#ifndef SQFS_UTILS_H
|
|
#define SQFS_UTILS_H
|
|
|
|
#include <linux/bitops.h>
|
|
#include <linux/kernel.h>
|
|
#include <stdbool.h>
|
|
|
|
#define SQFS_FRAGMENT_INDEX_OFFSET(A) ((A) % SQFS_MAX_ENTRIES)
|
|
#define SQFS_FRAGMENT_INDEX(A) ((A) / SQFS_MAX_ENTRIES)
|
|
#define SQFS_BLOCK_SIZE(A) ((A) & GENMASK(23, 0))
|
|
/* Useful for both fragment and data blocks */
|
|
#define SQFS_COMPRESSED_BLOCK(A) (!((A) & BIT(24)))
|
|
#define SQFS_IS_FRAGMENTED(A) ((A) != 0xFFFFFFFF)
|
|
/*
|
|
* These two macros work as getters for a metada block header, retrieving the
|
|
* data size and if it is compressed/uncompressed
|
|
*/
|
|
#define SQFS_COMPRESSED_METADATA(A) (!((A) & BIT(15)))
|
|
#define SQFS_METADATA_SIZE(A) ((A) & GENMASK(14, 0))
|
|
|
|
#endif /* SQFS_UTILS_H */
|