diff options
| author | hathach <[email protected]> | 2021-10-18 00:13:40 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2021-10-18 00:13:40 +0700 |
| commit | 826b34a8ac433e089c8522d949def4d8421ca4a2 (patch) | |
| tree | 40a7ae6e76fe6392f59fabd4883099ea97cadaa9 /src | |
| parent | 099d3b377fd619e664e60c948e6f73d7276dd81d (diff) | |
enable -Wnull-dereference
Diffstat (limited to 'src')
| -rw-r--r-- | src/portable/nuvoton/nuc505/dcd_nuc505.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/portable/nuvoton/nuc505/dcd_nuc505.c b/src/portable/nuvoton/nuc505/dcd_nuc505.c index ea5a8bea5..11d71a285 100644 --- a/src/portable/nuvoton/nuc505/dcd_nuc505.c +++ b/src/portable/nuvoton/nuc505/dcd_nuc505.c @@ -144,7 +144,9 @@ static USBD_EP_T *ep_entry(uint8_t ep_addr, bool add) enum ep_enum ep_index; struct xfer_ctl_t *xfer; - for (ep_index = PERIPH_EPA, xfer = &xfer_table[PERIPH_EPA], ep = USBD->EP; ep_index < PERIPH_MAX_EP; ep_index++, xfer++, ep++) + for (ep_index = PERIPH_EPA, xfer = &xfer_table[PERIPH_EPA], ep = USBD->EP; + ep_index < PERIPH_MAX_EP; + ep_index++, xfer++, ep++) { if (add) { @@ -396,6 +398,7 @@ bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t *buffer, uint16_t to /* mine the data for the information we need */ tusb_dir_t dir = tu_edpt_dir(ep_addr); USBD_EP_T *ep = ep_entry(ep_addr, false); + TU_ASSERT(ep); struct xfer_ctl_t *xfer = &xfer_table[ep - USBD->EP]; /* store away the information we'll needing now and later */ @@ -457,6 +460,7 @@ void dcd_edpt_stall(uint8_t rhport, uint8_t ep_addr) if (tu_edpt_number(ep_addr)) { USBD_EP_T *ep = ep_entry(ep_addr, false); + TU_ASSERT(ep, ); ep->EPRSPCTL = (ep->EPRSPCTL & 0xf7) | USBD_EPRSPCTL_HALT_Msk; } else @@ -472,6 +476,7 @@ void dcd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr) if (tu_edpt_number(ep_addr)) { USBD_EP_T *ep = ep_entry(ep_addr, false); + TU_ASSERT(ep, ); ep->EPRSPCTL = USBD_EPRSPCTL_TOGGLE_Msk; } } |
