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 Oct 21, 2024
1 parent 45851e8 commit fd64e56
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 35 deletions.
8 changes: 4 additions & 4 deletions include/pb/utils_def.h
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
17 changes: 5 additions & 12 deletions src/plat/imx6ul/plat.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,13 @@
#ifndef PLAT_IMX6UL_PLAT_H_
#define PLAT_IMX6UL_PLAT_H_

#define IMX6UL_FUSE_BANK_WORD(__b, __w, __d) \
{ \
.bank = __b, .word = __w, .description = __d, .status = FUSE_VALID \
}
#define IMX6UL_FUSE_BANK_WORD(__b, __w, __d) \
{ .bank = __b, .word = __w, .description = __d, .status = FUSE_VALID }

#define IMX6UL_FUSE_BANK_WORD_VAL(__b, __w, __d, __v) \
{ \
.bank = __b, .word = __w, .description = __d, .default_value = __v, .status = FUSE_VALID \
}
#define IMX6UL_FUSE_BANK_WORD_VAL(__b, __w, __d, __v) \
{ .bank = __b, .word = __w, .description = __d, .default_value = __v, .status = FUSE_VALID }

#define IMX6UL_FUSE_END \
{ \
.status = FUSE_INVALID \
}
#define IMX6UL_FUSE_END { .status = FUSE_INVALID }

#define IMX6UL_PRIV(__p) ((struct imx6ul_private *)__p)

Expand Down
17 changes: 5 additions & 12 deletions src/plat/imx8m/plat.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,13 @@
#ifndef PLAT_IMX8M_PLAT_H_
#define PLAT_IMX8M_PLAT_H_

#define IMX8M_FUSE_BANK_WORD(__b, __w, __d) \
{ \
.bank = __b, .word = __w, .description = __d, .status = FUSE_VALID \
}
#define IMX8M_FUSE_BANK_WORD(__b, __w, __d) \
{ .bank = __b, .word = __w, .description = __d, .status = FUSE_VALID }

#define IMX8M_FUSE_BANK_WORD_VAL(__b, __w, __d, __v) \
{ \
.bank = __b, .word = __w, .description = __d, .default_value = __v, .status = FUSE_VALID \
}
#define IMX8M_FUSE_BANK_WORD_VAL(__b, __w, __d, __v) \
{ .bank = __b, .word = __w, .description = __d, .default_value = __v, .status = FUSE_VALID }

#define IMX8M_FUSE_END \
{ \
.status = FUSE_INVALID \
}
#define IMX8M_FUSE_END { .status = FUSE_INVALID }

#define IMX8M_PRIV(__p) ((struct imx8m_private *)__p)

Expand Down
4 changes: 2 additions & 2 deletions src/plat/qemu/gcov.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ void gcov_init(void)
{
/* Call gcov initalizers */
extern uint32_t __init_array_start, __init_array_end;
void (**pctor)(void) = (void (**)(void)) & __init_array_start;
void (**pctor_last)(void) = (void (**)(void)) & __init_array_end;
void (**pctor)(void) = (void (**)(void))&__init_array_start;
void (**pctor_last)(void) = (void (**)(void))&__init_array_end;

for (; pctor < pctor_last; pctor++) {
(*pctor)();
Expand Down

0 comments on commit fd64e56

Please sign in to comment.