usb: coverity fix [1/1]

PD#SWPL-14009

Problem:
Coverity defect cleanup - usb.

Solution:
Coverity defect cleanup - usb.

Verify:
sm1

Change-Id: Ib194a82e54f819e4ab59eab944b446683c894f15
Signed-off-by: Yue Wang <yue.wang@amlogic.com>
This commit is contained in:
Yue Wang
2019-09-12 13:39:48 +08:00
committed by Jianxin Pan
parent d902780cab
commit bae244e017
3 changed files with 9 additions and 9 deletions

View File

@@ -789,7 +789,7 @@ int dwc_otg_save_global_regs(dwc_otg_core_if_t *core_if)
gr->pcgcctl_local = DWC_READ_REG32(core_if->pcgcctl);
gr->gdfifocfg_local =
DWC_READ_REG32(&core_if->core_global_regs->gdfifocfg);
for (i = 0; i < MAX_EPS_CHANNELS; i++) {
for (i = 0; i < MAX_EPS_CHANNELS - 1; i++) {
gr->dtxfsiz_local[i] =
DWC_READ_REG32(&(core_if->core_global_regs->dtxfsiz[i]));
}
@@ -948,7 +948,7 @@ int dwc_otg_restore_global_regs(dwc_otg_core_if_t *core_if)
gr->hptxfsiz_local);
DWC_WRITE_REG32(&core_if->core_global_regs->gdfifocfg,
gr->gdfifocfg_local);
for (i = 0; i < MAX_EPS_CHANNELS; i++)
for (i = 0; i < MAX_EPS_CHANNELS - 1; i++)
DWC_WRITE_REG32(&core_if->core_global_regs->dtxfsiz[i],
gr->dtxfsiz_local[i]);
@@ -1070,7 +1070,7 @@ int restore_essential_regs(dwc_otg_core_if_t *core_if, int rmode, int is_host)
dwc_udelay(10);
/* Load restore values for [31:14] bits and set EssRegRestored bit */
pcgcctl.d32 = ((gr->pcgcctl_local | 0xffffc000) & 0xffffc000);
pcgcctl.d32 = 0xffffc000;
pcgcctl.b.ess_reg_restored = 1;
if (rmode)
pcgcctl.b.restoremode = 1;

View File

@@ -397,7 +397,8 @@ void w_conn_id_status_change(void *p)
if (++count > 10000)
break;
}
DWC_ASSERT(++count < 10000,
++count;
DWC_ASSERT(count < 10000,
"Connection id status change timed out");
core_if->op_state = B_PERIPHERAL;
DWC_PRINTF("DEVICE mode\n");
@@ -418,7 +419,8 @@ host:
if (++count > 10000)
break;
}
DWC_ASSERT(++count < 10000,
++count;
DWC_ASSERT(count < 10000,
"Connection id status change timed out");
core_if->op_state = A_HOST;
DWC_PRINTF("HOST mode\n");

View File

@@ -1012,10 +1012,8 @@ stop_scan:
*/
if (halt_status == DWC_OTG_HC_XFER_STALL)
qh->data_toggle = DWC_OTG_HC_PID_DATA0;
else {
if (qtd)
dwc_otg_hcd_save_data_toggle(hc, hc_regs, qtd);
}
else
dwc_otg_hcd_save_data_toggle(hc, hc_regs, qtd);
}
if (halt_status == DWC_OTG_HC_XFER_COMPLETE) {