Skip to content

Fix the nxstyle errors in 60 files that implement poll. - #20794

Merged
michallenc merged 6 commits into
apache:masterfrom
casaroli:nxstyle-poll
Oct 19, 2026
Merged

michallenc merged 6 commits into
apache:masterfrom
casaroli:nxstyle-poll

Conversation

@casaroli

@casaroli casaroli commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

These 60 files have older nxstyle errors (about 1000). The CI check job runs nxstyle on every touched file whole, so any change to them fails that job. A later PR changes the poll method in each of them; this PR fixes the layout first, so that the later diff stays small.

One commit per area. The change is layout only: indentation of switch bodies and statements, the blank line after declarations, comment alignment, and line breaks. The C tokens do not change, except braces that nxstyle requires around a single statement: ten in drivers/wireless/cc1101.c and one in net/rpmsg/rpmsg_sockif.c. Each statement is a plain assignment or return, not a macro.

drivers/usbmisc/fusb302.c is in a separate PR, #20795, because it also needs a real fix (unbalanced parentheses).

Files, by commit:

  • arch, boards (10): arch/arm/src/common/stm32/stm32_bbsram_m3m4_v1.c, arch/arm/src/rtl8720c/ameba_hci.c, arch/arm/src/sama5/sam_tsd.c, arch/arm/src/stm32f7/stm32_bbsram.c, arch/arm/src/stm32h7/stm32_bbsram.c, arch/renesas/src/rx65n/rx65n_sbram.c, boards/arm/cxd56xx/drivers/sensors/cxd5610_gnss.c, boards/arm/sam34/sam4l-xplained/src/sam_slcd.c, boards/arm/stm32l1/stm32ldiscovery/src/stm32_lcd.c, boards/mips/pic32mx/sure-pic32mx/src/pic32mx_lcd1602.c.
  • drivers/input (10): ads7843e.c, ajoystick.c, cypress_mbr3108.c, djoystick.c, max11802.c, mxt.c, spq10kbd.c, stmpe811_tsc.c, touchscreen_upper.c, tsc2007.c.
  • drivers/usb (7): drivers/usbdev/usbdev_fs.c, drivers/usbdev/uvc.c, drivers/usbhost/usbhost_cdcmbim.c, usbhost_hidmouse.c, usbhost_xboxcontroller.c, drivers/usbmisc/fusb301.c, fusb303.c.
  • drivers/lcd, modem, wireless (7): drivers/lcd/pcf8574_lcd_backpack.c, drivers/lcd/tda19988.c, drivers/modem/alt1250/alt1250.c, drivers/modem/u-blox.c, drivers/wireless/cc1101.c, drivers/wireless/lpwan/sx127x/sx127x.c, drivers/wireless/nrf24l01.c.
  • fs/vfs, net (8): fs/vfs/fs_epoll.c, fs/vfs/fs_inotify.c, net/can/can_sockif.c, net/icmp/icmp_sockif.c, net/icmpv6/icmpv6_sockif.c, net/local/local_sockif.c, net/netlink/netlink_sockif.c, net/rpmsg/rpmsg_sockif.c.
  • drivers (18): drivers/analog/adc.c, drivers/analog/comp.c, drivers/i2c/i2c_slave_driver.c, drivers/misc/dev_ascii.c, drivers/misc/goldfish_pipe.c, drivers/misc/rpmsgdev.c, drivers/net/tun.c, drivers/note/noteram_driver.c, drivers/pipes/pipe_common.c, drivers/power/battery/battery_charger.c, drivers/power/battery/battery_monitor.c, drivers/serial/pty.c, drivers/spi/spi_slave_driver.c, drivers/syslog/ramlog.c, drivers/timers/timer.c, drivers/usrsock/usrsock_rpmsg_server.c, drivers/video/fb.c, drivers/video/v4l2_cap.c.

Review points:

  • net/local/local_sockif.c: an assignment continues on lines inside #ifdef CONFIG_NET_LOCAL_STREAM / #else. nxstyle skips preprocessor lines and reads = -1; as a new statement, so both continuation lines are at column 2. Any other layout needs a token change.
  • drivers/usbdev/uvc.c: one comment moves from under a case label to above it.
  • ajoystick.c, djoystick.c, pcf8574_lcd_backpack.c, noteram_driver.c: some comments and one argument list are re-wrapped (same words, same arguments).

Impact

None. No code change.

Testing

  • nxstyle reports nothing for the 60 files; tools/checkpatch.sh -c -u -m -g passes.
  • A token compare (comments and whitespace ignored) gives the same tokens for 58 files, and only the added braces for cc1101.c and rpmsg_sockif.c. The preprocessor lines are the same after whitespace normalization.
  • Object compare, built before and after with -D__LINE__=0: objdump -d is identical for 46 objects, including the two files with braces. 43 come from a wide qemu-armv8a configuration; stm32_lcd.c (stm32ldiscovery:chrono), sam_tsd.c (sama5d3x-ek:nxwm) and pcf8574_lcd_backpack.c (adafruit-feather-rp2040:lcd1602) from Arm builds.
  • Not object-compared, so the token compare is the proof: no defconfig builds the three bbsram drivers, ameba_hci.c, cxd5610_gnss.c, sam_slcd.c, pic32mx_lcd1602.c, spq10kbd.c, usbdev_fs.c, usbhost_cdcmbim.c, usbhost_xboxcontroller.c or fusb303.c; rx65n_sbram.c needs an RX toolchain; tda19988.c does not compile on master in that configuration.

Fix the older nxstyle errors in these files: indentation, alignment of
braces and comments, and the blank line after declarations. This is a
layout change only. The C tokens do not change. tools/nxstyle.c reports
no error for them now.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <[email protected]>
Fix the older nxstyle errors in these files: indentation, alignment of
braces and comments, and the blank line after declarations. This is a
layout change only. The C tokens do not change. tools/nxstyle.c reports
no error for them now.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <[email protected]>
@github-actions github-actions Bot added Arch: arm Issues related to ARM (32-bit) architecture Arch: renesas Issues related to the Renesas chips Area: Drivers Drivers issues Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces. Board: arm Board: mips labels Oct 18, 2026
Fix the older nxstyle errors in these files: indentation, alignment of
braces and comments, and the blank line after declarations. This is a
layout change only. The C tokens do not change. tools/nxstyle.c
reports no error for them now.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <[email protected]>
Fix the older nxstyle errors in these files: 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 ten pairs of
braces around single statements in cc1101.c. tools/nxstyle.c reports no
error for them now.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <[email protected]>
Fix the older nxstyle errors in these files: 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 return statement in rpmsg_sockif.c.
tools/nxstyle.c reports no error for them now.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <[email protected]>
Fix the older nxstyle errors in these files: indentation, alignment of
braces and comments, and the blank line after declarations. This is a
layout change only. The C tokens do not change. tools/nxstyle.c reports
no error for them now.

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 changed the title Fix the nxstyle errors in 61 files that implement poll. Fix the nxstyle errors in 60 files that implement poll. Oct 18, 2026
@casaroli
casaroli marked this pull request as draft October 19, 2026 01:38
@casaroli
casaroli marked this pull request as ready for review October 19, 2026 01:45
@casaroli casaroli closed this Oct 19, 2026
@casaroli casaroli reopened this Oct 19, 2026
@michallenc
michallenc merged commit 9589e55 into apache:master Oct 19, 2026
100 of 106 checks passed
@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/39188434456

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm Issues related to ARM (32-bit) architecture Arch: renesas Issues related to the Renesas chips Area: Drivers Drivers issues Board: arm Board: mips Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants