diff options
| author | hathach <[email protected]> | 2026-07-12 05:33:00 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2026-07-12 05:33:00 +0700 |
| commit | d0abd1bcb97923320391807834337d78ee2127a2 (patch) | |
| tree | edbfe8fb4d528cade48ab0a6c1c6f937c8768203 | |
| parent | d4303da15eb28f81c19a239808d2ad0853d01dfe (diff) | |
ch32h417: make usbss_phy_cfg return void (unused read-back)worktree-ch569-hydrausb3
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) <[email protected]>
Claude-Session: https://claude.ai/code/session_01QWhrtHjbSVMKcY68vxBwBm
| -rw-r--r-- | src/portable/wch/dcd_ch32h417_usb30.c | 4 |
1 files 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) { |
