Skip to content

fix more alerts#3348

Merged
hathach merged 2 commits intomasterfrom
fix-more-warnings
Nov 19, 2025
Merged

fix more alerts#3348
hathach merged 2 commits intomasterfrom
fix-more-warnings

Conversation

@hathach
Copy link
Owner

@hathach hathach commented Nov 19, 2025

No description provided.

Copilot AI review requested due to automatic review settings November 19, 2025 12:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses static analysis alerts from PVS-Studio across the DWC2 USB host controller driver, focusing on improving code clarity and addressing MISRA-C compliance warnings.

Key changes:

  • Added explicit unsigned literal suffixes (0x01u, 0x02u) to prevent type promotion issues
  • Converted implicit boolean checks to explicit comparisons for 1-bit bitfields
  • Refactored if-else chains into switch statements for transfer type handling
  • Introduced named constants (GUSBCFG_PHYSEL_, GUSBCFG_PHYHS_) for PHY configuration

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/portable/synopsys/dwc2/hcd_dwc2.c Adds unsigned suffixes to literals, explicit comparisons for bitfields, refactors endpoint interval setup to switch statement, adds else branches with comments
src/portable/synopsys/dwc2/dwc2_type.h Defines named enums for PHY selection and type to replace magic numbers
src/portable/synopsys/dwc2/dwc2_stm32.h Changes while loop condition (introduces potential bug)
src/portable/synopsys/dwc2/dwc2_common.h Converts implicit bitwise checks to explicit Yoda conditions
AGENTS.md Expands developer documentation with detailed build/test instructions (contains path error)
.PVS-Studio/.pvsconfig Adds suppression for hcint variable in interrupt handlers

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@sonarqubecloud
Copy link

@hathach hathach merged commit d1a261e into master Nov 19, 2025
167 checks passed
@hathach hathach deleted the fix-more-warnings branch November 19, 2025 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant