From 8c80908f5ba0fca52802200a3b3d0447d982cbb1 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Tue, 21 Oct 2025 17:11:34 +0200 Subject: [PATCH 1/3] [ot] .github: workflows: Fix format test in CI Signed-off-by: Amaury Pouly --- .github/workflows/build_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index 407a03294d482..694d4783d36eb 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -81,7 +81,7 @@ jobs: uses: actions/checkout@v4 - name: Check C code format run: | - scripts/opentitan/ot-format.sh --ci -i + scripts/opentitan/ot-format.sh --ci --Werror --dry-run lint-python: runs-on: ubuntu-latest From 022f2f1d23207bbb15581bf372157fce7a02338a Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Tue, 21 Oct 2025 17:16:38 +0200 Subject: [PATCH 2/3] [ot] hw/opentitan: ot_usbdev: fix formatting Signed-off-by: Amaury Pouly --- hw/opentitan/ot_usbdev.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/hw/opentitan/ot_usbdev.c b/hw/opentitan/ot_usbdev.c index c8088c1730f60..9061b9671047a 100644 --- a/hw/opentitan/ot_usbdev.c +++ b/hw/opentitan/ot_usbdev.c @@ -224,7 +224,7 @@ REG32(COUNT_ERRORS, 0xa8u) #define REGS_COUNT (R_LAST_REG + 1u) #define USBDEV_REGS_SIZE (REGS_COUNT * sizeof(uint32_t)) -#define USBDEV_INTR_NUM 18 +#define USBDEV_INTR_NUM 18u #define USBDEV_INTR_RW1C_MASK \ (USBDEV_INTR_DISCONNECTED_MASK | USBDEV_INTR_HOST_LOST_MASK | \ @@ -591,7 +591,10 @@ static void ot_usbdev_update_vbus(OtUsbdevState *s) if (vbus_sense) { /* See BFM (bus_connect) */ - /* If we end up in a non-disconnected state here, something is very wrong */ + /* + * If we end up in a non-disconnected state here, something is very + * wrong + */ g_assert(ot_usbdev_get_link_state(s) == OT_USBDEV_LINK_STATE_DISCONNECTED); s->regs[R_USBDEV_INTR_STATE] |= USBDEV_INTR_POWERED_MASK; @@ -984,7 +987,8 @@ static void ot_usbdev_server_write_packet(OtUsbdevState *s, .size = size, .id = id, }; - int res = qemu_chr_fe_write(&s->usb_chr, (const uint8_t *)&hdr, sizeof(hdr)); + int res = + qemu_chr_fe_write(&s->usb_chr, (const uint8_t *)&hdr, sizeof(hdr)); if (res < sizeof(hdr)) { qemu_log_mask(LOG_UNIMP, "%s: %s server: unhandled partial write\n", __func__, s->ot_id); @@ -1079,7 +1083,8 @@ static void ot_usbdev_server_process_hello(OtUsbdevState *s) resp_hello.major_version = OT_USBDEV_SERVER_MAJOR_VER; resp_hello.minor_version = OT_USBDEV_SERVER_MINOR_VER; ot_usbdev_server_write_packet(s, OT_USBDEV_SERVER_CMD_HELLO, - server->recv_pkt.id, (const void *)&resp_hello, + server->recv_pkt.id, + (const void *)&resp_hello, sizeof(resp_hello)); } From d93d1704852d9b7e3a53684378a8850aa362cce8 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Wed, 22 Oct 2025 12:29:23 +0200 Subject: [PATCH 3/3] [ot] .gitlab-ci.d: opentitan: Improve format test in CI Signed-off-by: Amaury Pouly --- .gitlab-ci.d/opentitan/build.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.gitlab-ci.d/opentitan/build.yml b/.gitlab-ci.d/opentitan/build.yml index 2010867d1643c..a116e489edffa 100644 --- a/.gitlab-ci.d/opentitan/build.yml +++ b/.gitlab-ci.d/opentitan/build.yml @@ -61,10 +61,7 @@ format: - qemu_ot stage: build script: - - scripts/opentitan/ot-format.sh --ci -i - - git status -s - - test -z "$(git status -s)" || git diff - - test -z "$(git status -s)" + - scripts/opentitan/ot-format.sh --ci --Werror --dry-run tidy: tags: