ricardgb opened a new issue, #19306: URL: https://github.com/apache/nuttx/issues/19306
> **Disclaimer:** This report was prepared with AI assistance (Claude Code). I reviewed it, verified the code citations against master myself, and validated the behaviour on real hardware where noted before filing. *Line numbers vs `drivers/net/w5500.c` at master `50f91ef502`.* ## 1. `NETDEV_RXERRORS(&priv->dev)` references variables that do not exist l. 1351, in `w5500_receive()`: ```c NETDEV_RXERRORS(&priv->dev); ``` Neither `priv` nor a field named `dev` exists in this function — the variable is `self` and the field is `w_dev`. This compiles today only because `NETDEV_RXERRORS()` expands to nothing without `CONFIG_NETDEV_STATISTICS`; enabling statistics breaks the build. Fix: `NETDEV_RXERRORS(&self->w_dev);` ## 2. `d_private` set to the device array instead of the instance l. 2069, in `w5500_initialize()`: ```c self->w_dev.d_private = g_w5500; /* Used to recover private state from dev */ ``` Should be `self`. Harmless for device 0 (`g_w5500 == &g_w5500[0]`), wrong for any `devno > 0` — every callback that recovers the driver state via `dev->d_private` would operate on device 0's state. Fix: `self->w_dev.d_private = self;` Both fixes are included in the reference branch: `https://github.com/ricardgb/nuttx/tree/w5500-driver-fixes` --- *Disclosure: found during an AI-assisted (Claude Code) audit, verified by me by reading the cited lines against master.* -- 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]
