From d0abd1bcb97923320391807834337d78ee2127a2 Mon Sep 17 00:00:00 2001 From: hathach Date: Sun, 12 Jul 2026 05:33:00 +0700 Subject: [PATCH] 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) Claude-Session: https://claude.ai/code/session_01QWhrtHjbSVMKcY68vxBwBm --- src/portable/wch/dcd_ch32h417_usb30.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/portable/wch/dcd_ch32h417_usb30.c b/src/portable/wch/dcd_ch32h417_usb30.c index e79e1e478..dcdc0678f 100644 --- a/src/portable/wch/dcd_ch32h417_usb30.c +++ b/src/portable/wch/dcd_ch32h417_usb30.c @@ -117,10 +117,10 @@ static void usbss_rcc_init(bool enable) { } } -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) {