Skip to content

drivers/usbmisc/fusb302: Fix two unbalanced parentheses. - #20795

Merged
anchao merged 2 commits into
apache:masterfrom
casaroli:fusb302-parens
Oct 19, 2026
Merged

anchao merged 2 commits into
apache:masterfrom
casaroli:fusb302-parens

Conversation

@casaroli

@casaroli casaroli commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

drivers/usbmisc/fusb302.c does not compile with CONFIG_I2C_RESET: the I2C_RESET() call in fusb302_irqworker() has no closing parenthesis. SET_WAIT_MODE() has one opening parenthesis too many, and its only user one closing parenthesis too many to match it.

The first commit fixes both. The second commit fixes the older nxstyle errors of the file (layout only; one pair of braces around a single break;, which nxstyle requires). The unbalanced parentheses had stopped nxstyle from checking the rest of the function, so the file needs both commits to pass the CI check.

Impact

fusb302.c compiles with CONFIG_I2C_RESET. The code that the default configuration compiles does not change.

Testing

stm32f4discovery:nsh with CONFIG_USBMISC, CONFIG_STM32_I2C1, CONFIG_FUSB302 and CONFIG_I2C_RESET:

master this PR
build fails: fusb302.c:1336: error: expected ';' before ')' token and 11 more errors builds

For the layout commit: a token compare (comments and whitespace ignored) gives the same tokens except the added braces, and objdump -d of the object built before and after with -D__LINE__=0 is identical. tools/checkpatch.sh -c -u -m -g passes.

The I2C_RESET() call in fusb302_irqworker() has no closing parenthesis,
so the file does not compile with CONFIG_I2C_RESET.  SET_WAIT_MODE()
has one opening parenthesis too many, and its only user has one closing
parenthesis too many to match it.  Fix both.  The code that the default
configuration compiles does not change.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <[email protected]>
Fix the older nxstyle errors in fusb302.c: indentation, alignment of
braces and comments, and the blank line after declarations.  This is a
layout change only.  The C tokens do not change, except one pair of
braces around a single break statement, which nxstyle requires.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <[email protected]>
@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

MemBrowse Memory Report · Explore what changed →

arduino-mega2560

  • flash: .data +16 B (+0.0%, 65,016 B / 262,144 B, total: 25% used)
  • sram: .data +16 B (+0.6%, 2,734 B / 8,192 B, total: 33% used)

esp32-devkitc

  • ROM: .dram0.data +16 B, .flash.rodata +12 B (+0.0%, 126,860 B / 4,194,272 B, total: 3% used)
  • dram0_0_seg: .dram0.data +16 B (+0.2%, 10,028 B / 180,736 B, total: 6% used)
  • drom0_0_seg: .flash.rodata +12 B (+0.1%, 13,660 B / 4,194,272 B, total: 0% used)

hifive1-revb

  • flash: .data +8 B, .text +12 B (+0.0%, 84,612 B / 4,194,304 B, total: 2% used)
  • sram: .bss -16 B, .data +8 B (-0.2%, 3,956 B / 16,384 B, total: 24% used)

mirtoo

  • kseg0_progmem: .data +4 B, .text +12 B (+0.0%, 67,204 B / 131,072 B, total: 51% used)
  • kseg1_datamem: .data +4 B (+0.2%, 2,588 B / 32,256 B, total: 8% used)

qemu-armv8a

  • Code: .rodata +16 B (+0.0%, 350,680 B)
  • Data: .data.g_version +2 B (+0.0%, 77,689 B)

qemu-intel64

  • Data: .rodata +32 B (+0.0%, 124,953 B)

rx65n-rsk2mb

  • RAM: .data +4 B (+0.1%, 6,590 B / 262,144 B, total: 3% used)
  • ROM: .rodata +16 B (+0.0%, 88,348 B / 2,097,152 B, total: 4% used)

s698pm-dkit

  • Code: .text +16 B (+0.0%, 377,184 B)

stm32-nucleo-f103rb

  • flash: .text +16 B (+0.0%, 34,488 B / 131,072 B, total: 26% used)

Catch memory regressions in CI with MemBrowse. Free for open source.

@casaroli
casaroli marked this pull request as ready for review October 19, 2026 01:47
@casaroli casaroli closed this Oct 19, 2026
@casaroli casaroli reopened this Oct 19, 2026
@github-actions

Copy link
Copy Markdown

🔗 Cross-repo PR dependencies

The read-only Build run reported the following dependent PR(s) and fetched head SHA(s):

CI run: https://github.com/apache/nuttx/actions/runs/39188446830

@anchao
anchao merged commit 40230a1 into apache:master Oct 19, 2026
101 of 106 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: USB Size: L The size of the change in this PR is large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants