Skip to content

Commit 6e337cb

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 3a03eda commit 6e337cb

File tree

10 files changed

+25
-39
lines changed

10 files changed

+25
-39
lines changed

include/pb/utils_def.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
/* Compute the number of elements in the given array */
1919
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
2020

21-
#define IS_POWER_OF_TWO(x) (((x) & ((x)-1)) == 0)
21+
#define IS_POWER_OF_TWO(x) (((x) & ((x) - 1)) == 0)
2222

2323
#define SIZE_FROM_LOG2_WORDS(n) (4 << (n))
2424

@@ -56,7 +56,7 @@
5656
* This variant of div_round_up can be used in macro definition but should not
5757
* be used in C code as the `div` parameter is evaluated twice.
5858
*/
59-
#define DIV_ROUND_UP_2EVAL(n, d) (((n) + (d)-1) / (d))
59+
#define DIV_ROUND_UP_2EVAL(n, d) (((n) + (d) - 1) / (d))
6060

6161
#define div_round_up(val, div) \
6262
__extension__({ \
@@ -88,9 +88,9 @@
8888
*
8989
* round_down() is similar but rounds the value down instead.
9090
*/
91-
#define round_boundary(value, boundary) ((__typeof__(value))((boundary)-1))
91+
#define round_boundary(value, boundary) ((__typeof__(value))((boundary) - 1))
9292

93-
#define round_up(value, boundary) ((((value)-1) | round_boundary(value, boundary)) + 1)
93+
#define round_up(value, boundary) ((((value) - 1) | round_boundary(value, boundary)) + 1)
9494

9595
#define round_down(value, boundary) ((value) & ~round_boundary(value, boundary))
9696

src/arch/armv7a/include/arch/arch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@
447447

448448
/* MAIR macros */
449449
#define MAIR0_ATTR_SET(attr, index) ((attr) << ((index) << U(3)))
450-
#define MAIR1_ATTR_SET(attr, index) ((attr) << (((index)-U(3)) << U(3)))
450+
#define MAIR1_ATTR_SET(attr, index) ((attr) << (((index) - U(3)) << U(3)))
451451

452452
/* System register defines The format is: coproc, opt1, CRn, CRm, opt2 */
453453
#define IFSR p15, 0, c5, c0, 1

src/arch/armv8a/include/arch/mmu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
((((page_size_shift == 12) & 1) << 1) | ((page_size_shift == 14) & 1) | \
6767
((page_size_shift == 16) & 1) | (((page_size_shift == 16) & 1) << 1))
6868

69-
#define MMU_LX_X(page_shift, level) ((4 - (level)) * ((page_shift)-3) + 3)
69+
#define MMU_LX_X(page_shift, level) ((4 - (level)) * ((page_shift) - 3) + 3)
7070

7171
#if MMU_USER_SIZE_SHIFT > MMU_LX_X(MMU_USER_PAGE_SIZE_SHIFT, 0)
7272
#define MMU_USER_TOP_SHIFT MMU_LX_X(MMU_USER_PAGE_SIZE_SHIFT, 0)

src/drivers/fs/lfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#include <pb/assert.h>
1010
#include <pb/pb.h>
1111

12-
#define LFS_BLOCK_NULL ((lfs_block_t)-1)
13-
#define LFS_BLOCK_INLINE ((lfs_block_t)-2)
12+
#define LFS_BLOCK_NULL ((lfs_block_t) - 1)
13+
#define LFS_BLOCK_INLINE ((lfs_block_t) - 2)
1414

1515
/// Caching block device operations ///
1616
static inline void lfs_cache_drop(lfs_t *lfs, lfs_cache_t *rcache)

src/lib/bpak.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <string.h>
1212

1313
/* BPAK_META_ALIGN is a power-of-2 */
14-
#define BPAK_META_ALIGN_SIZE(_x) (((_x) + ((BPAK_META_ALIGN)-1)) & ~((BPAK_META_ALIGN)-1))
14+
#define BPAK_META_ALIGN_SIZE(_x) (((_x) + ((BPAK_META_ALIGN) - 1)) & ~((BPAK_META_ALIGN) - 1))
1515

1616
static int bpak_get_meta_int(struct bpak_header *hdr,
1717
bpak_id_t id,

src/plat/imx6ul/plat.h

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,13 @@
1010
#ifndef PLAT_IMX6UL_PLAT_H_
1111
#define PLAT_IMX6UL_PLAT_H_
1212

13-
#define IMX6UL_FUSE_BANK_WORD(__b, __w, __d) \
14-
{ \
15-
.bank = __b, .word = __w, .description = __d, .status = FUSE_VALID \
16-
}
13+
#define IMX6UL_FUSE_BANK_WORD(__b, __w, __d) \
14+
{ .bank = __b, .word = __w, .description = __d, .status = FUSE_VALID }
1715

18-
#define IMX6UL_FUSE_BANK_WORD_VAL(__b, __w, __d, __v) \
19-
{ \
20-
.bank = __b, .word = __w, .description = __d, .default_value = __v, .status = FUSE_VALID \
21-
}
16+
#define IMX6UL_FUSE_BANK_WORD_VAL(__b, __w, __d, __v) \
17+
{ .bank = __b, .word = __w, .description = __d, .default_value = __v, .status = FUSE_VALID }
2218

23-
#define IMX6UL_FUSE_END \
24-
{ \
25-
.status = FUSE_INVALID \
26-
}
19+
#define IMX6UL_FUSE_END { .status = FUSE_INVALID }
2720

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

src/plat/imx8m/plat.h

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,13 @@
1010
#ifndef PLAT_IMX8M_PLAT_H_
1111
#define PLAT_IMX8M_PLAT_H_
1212

13-
#define IMX8M_FUSE_BANK_WORD(__b, __w, __d) \
14-
{ \
15-
.bank = __b, .word = __w, .description = __d, .status = FUSE_VALID \
16-
}
13+
#define IMX8M_FUSE_BANK_WORD(__b, __w, __d) \
14+
{ .bank = __b, .word = __w, .description = __d, .status = FUSE_VALID }
1715

18-
#define IMX8M_FUSE_BANK_WORD_VAL(__b, __w, __d, __v) \
19-
{ \
20-
.bank = __b, .word = __w, .description = __d, .default_value = __v, .status = FUSE_VALID \
21-
}
16+
#define IMX8M_FUSE_BANK_WORD_VAL(__b, __w, __d, __v) \
17+
{ .bank = __b, .word = __w, .description = __d, .default_value = __v, .status = FUSE_VALID }
2218

23-
#define IMX8M_FUSE_END \
24-
{ \
25-
.status = FUSE_INVALID \
26-
}
19+
#define IMX8M_FUSE_END { .status = FUSE_INVALID }
2720

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

src/plat/qemu/gcov.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ void gcov_init(void)
266266
{
267267
/* Call gcov initalizers */
268268
extern uint32_t __init_array_start, __init_array_end;
269-
void (**pctor)(void) = (void (**)(void)) & __init_array_start;
270-
void (**pctor_last)(void) = (void (**)(void)) & __init_array_end;
269+
void (**pctor)(void) = (void (**)(void))&__init_array_start;
270+
void (**pctor_last)(void) = (void (**)(void))&__init_array_end;
271271

272272
for (; pctor < pctor_last; pctor++) {
273273
(*pctor)();

tools/punchboot/punchboot/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@
4848
]
4949

5050
__all__ = [
51-
"Session",
51+
"SLC",
5252
"Partition",
5353
"PartitionFlags",
54-
"SLC",
54+
"Session",
5555
"library_version",
56+
"list_usb_devices",
5657
"pb_id",
5758
"wait_for_device",
58-
"list_usb_devices",
5959
]
6060
__all__ += _pb_exceptions

tools/punchboot/punchboot/partition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
import uuid # noqa: TCH003
5+
import uuid # noqa: TC003
66
from dataclasses import dataclass
77
from enum import Flag
88

0 commit comments

Comments
 (0)