Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #40

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -14,7 +14,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
rev: v1.10.0
hooks:
- id: mypy
additional_dependencies:
Expand All @@ -25,12 +25,12 @@ repos:
args: ["."]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.1
rev: v0.4.5
hooks:
- id: ruff
args: [ --fix ]

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v17.0.6
rev: v18.1.5
hooks:
- id: clang-format
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
Loading