casaroli opened a new pull request, #20794:
URL: https://github.com/apache/nuttx/pull/20794

   ## Summary
   
   These 61 files have older nxstyle errors (about 1030). 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, with these exceptions:
   
   - `drivers/usbmisc/fusb302: Fix two unbalanced parentheses.` is a real fix, 
in its own commit. 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 one 
closing parenthesis too many. The unbalanced parentheses also stopped nxstyle 
from checking the rest of the function.
   - Braces that nxstyle requires around a single statement: ten in 
`drivers/wireless/cc1101.c`, one in `drivers/usbmisc/fusb302.c`, one in 
`net/rpmsg/rpmsg_sockif.c`. Each statement is a plain assignment, `return` or 
`break`, not a macro.
   
   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 (8): `drivers/usbdev/usbdev_fs.c`, `drivers/usbdev/uvc.c`, 
`drivers/usbhost/usbhost_cdcmbim.c`, `usbhost_hidmouse.c`, 
`usbhost_xboxcontroller.c`, `drivers/usbmisc/fusb301.c`, `fusb302.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
   
   `fusb302.c` compiles with `CONFIG_I2C_RESET`. No other change.
   
   ## Testing
   
   - nxstyle reports nothing for the 61 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`, `fusb302.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 47 objects, including the three files with braces. 44 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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to