Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 15, 2024
1 parent f8c73d5 commit e759e12
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions include/pb/utils_def.h
Expand Up @@ -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))

Expand Down Expand Up @@ -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__({ \
Expand Down Expand Up @@ -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))

Expand Down
2 changes: 1 addition & 1 deletion src/arch/armv7a/include/arch/arch.h
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/arch/armv8a/include/arch/mmu.h
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/drivers/fs/lfs.c
Expand Up @@ -9,8 +9,8 @@
#include <pb/assert.h>
#include <pb/pb.h>

#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)
Expand Down
2 changes: 1 addition & 1 deletion src/lib/bpak.c
Expand Up @@ -11,7 +11,7 @@
#include <string.h>

/* 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,
Expand Down

0 comments on commit e759e12

Please sign in to comment.