From f5d8a2a77ad7dca40c78a1500cf9dc27e93856b9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 23:12:51 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- include/pb/utils_def.h | 8 ++++---- src/arch/armv7a/include/arch/arch.h | 2 +- src/arch/armv8a/include/arch/mmu.h | 2 +- src/drivers/fs/lfs.c | 4 ++-- src/lib/bpak.c | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/pb/utils_def.h b/include/pb/utils_def.h index 7218ed34..bf7d10f7 100644 --- a/include/pb/utils_def.h +++ b/include/pb/utils_def.h @@ -18,7 +18,7 @@ /* Compute the number of elements in the given array */ #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) -#define IS_POWER_OF_TWO(x) (((x) & ((x)-1)) == 0) +#define IS_POWER_OF_TWO(x) (((x) & ((x) - 1)) == 0) #define SIZE_FROM_LOG2_WORDS(n) (4 << (n)) @@ -56,7 +56,7 @@ * This variant of div_round_up can be used in macro definition but should not * be used in C code as the `div` parameter is evaluated twice. */ -#define DIV_ROUND_UP_2EVAL(n, d) (((n) + (d)-1) / (d)) +#define DIV_ROUND_UP_2EVAL(n, d) (((n) + (d) - 1) / (d)) #define div_round_up(val, div) \ __extension__({ \ @@ -88,9 +88,9 @@ * * round_down() is similar but rounds the value down instead. */ -#define round_boundary(value, boundary) ((__typeof__(value))((boundary)-1)) +#define round_boundary(value, boundary) ((__typeof__(value))((boundary) - 1)) -#define round_up(value, boundary) ((((value)-1) | round_boundary(value, boundary)) + 1) +#define round_up(value, boundary) ((((value) - 1) | round_boundary(value, boundary)) + 1) #define round_down(value, boundary) ((value) & ~round_boundary(value, boundary)) diff --git a/src/arch/armv7a/include/arch/arch.h b/src/arch/armv7a/include/arch/arch.h index bad3ba24..b2b9598b 100644 --- a/src/arch/armv7a/include/arch/arch.h +++ b/src/arch/armv7a/include/arch/arch.h @@ -447,7 +447,7 @@ /* MAIR macros */ #define MAIR0_ATTR_SET(attr, index) ((attr) << ((index) << U(3))) -#define MAIR1_ATTR_SET(attr, index) ((attr) << (((index)-U(3)) << U(3))) +#define MAIR1_ATTR_SET(attr, index) ((attr) << (((index) - U(3)) << U(3))) /* System register defines The format is: coproc, opt1, CRn, CRm, opt2 */ #define IFSR p15, 0, c5, c0, 1 diff --git a/src/arch/armv8a/include/arch/mmu.h b/src/arch/armv8a/include/arch/mmu.h index 5aa54e8b..e54dd188 100644 --- a/src/arch/armv8a/include/arch/mmu.h +++ b/src/arch/armv8a/include/arch/mmu.h @@ -66,7 +66,7 @@ ((((page_size_shift == 12) & 1) << 1) | ((page_size_shift == 14) & 1) | \ ((page_size_shift == 16) & 1) | (((page_size_shift == 16) & 1) << 1)) -#define MMU_LX_X(page_shift, level) ((4 - (level)) * ((page_shift)-3) + 3) +#define MMU_LX_X(page_shift, level) ((4 - (level)) * ((page_shift) - 3) + 3) #if MMU_USER_SIZE_SHIFT > MMU_LX_X(MMU_USER_PAGE_SIZE_SHIFT, 0) #define MMU_USER_TOP_SHIFT MMU_LX_X(MMU_USER_PAGE_SIZE_SHIFT, 0) diff --git a/src/drivers/fs/lfs.c b/src/drivers/fs/lfs.c index 1ac7d0ee..0f2fdc4a 100644 --- a/src/drivers/fs/lfs.c +++ b/src/drivers/fs/lfs.c @@ -9,8 +9,8 @@ #include #include -#define LFS_BLOCK_NULL ((lfs_block_t)-1) -#define LFS_BLOCK_INLINE ((lfs_block_t)-2) +#define LFS_BLOCK_NULL ((lfs_block_t) - 1) +#define LFS_BLOCK_INLINE ((lfs_block_t) - 2) /// Caching block device operations /// static inline void lfs_cache_drop(lfs_t *lfs, lfs_cache_t *rcache) diff --git a/src/lib/bpak.c b/src/lib/bpak.c index 0dc46fb1..3e6c2bd5 100644 --- a/src/lib/bpak.c +++ b/src/lib/bpak.c @@ -11,7 +11,7 @@ #include /* BPAK_META_ALIGN is a power-of-2 */ -#define BPAK_META_ALIGN_SIZE(_x) (((_x) + ((BPAK_META_ALIGN)-1)) & ~((BPAK_META_ALIGN)-1)) +#define BPAK_META_ALIGN_SIZE(_x) (((_x) + ((BPAK_META_ALIGN) - 1)) & ~((BPAK_META_ALIGN) - 1)) static int bpak_get_meta_int(struct bpak_header *hdr, bpak_id_t id,