ch32h417: make usbss_phy_cfg return void (unused read-back) PVS-Studio (V530) flagged the discarded return value of usbss_phy_cfg at every call site. The PHY back-door read-back is only a strobe; the value is never used (matching the WCH EVT demo), so return void. PVS found no other issues in either CH32H417 dcd. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QWhrtHjbSVMKcY68vxBwBm
diff --git a/src/portable/wch/dcd_ch32h417_usb30.c b/src/portable/wch/dcd_ch32h417_usb30.c index e79e1e4..dcdc067 100644 --- a/src/portable/wch/dcd_ch32h417_usb30.c +++ b/src/portable/wch/dcd_ch32h417_usb30.c
@@ -117,10 +117,10 @@ } } -static uint32_t usbss_phy_cfg(uint8_t addr, uint16_t data) { +static void usbss_phy_cfg(uint8_t addr, uint16_t data) { USBSS_PHY_CFG_CR = (1u << 23) | ((uint32_t)addr << 16) | data; USBSS_PHY_CFG_DAT = 0x01; - return USBSS_PHY_CFG_DAT; + (void)USBSS_PHY_CFG_DAT; // read-back strobe; the returned value is not used } static void usbss_cfg_mod(void) {