Skip to content

Commit

Permalink
Fix unused value
Browse files Browse the repository at this point in the history
The return values of some functions are ignored. Add DEBUG log while continue
the code flow without quit early.
Include: UsbdSetAddress UsbdGetStringDesc UsbdGetConfigDesc UsbdGetConfig UsbdSetConfig
UsbdGetStatus VirtioRpmbInitialize

Tracked-On: OAM-124684
Signed-off-by: Guo, Jade <[email protected]>
  • Loading branch information
jiaxuan-guo committed Sep 20, 2024
1 parent 26facc4 commit 7095cee
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
22 changes: 18 additions & 4 deletions drivers/dw3/dw3.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,10 +532,6 @@ UsbdSetConfig (
}
}

if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "UsbdSetConfig() - Invalid requested configuration value: %i\n", CfgValue));
}

return Status;
}

Expand Down Expand Up @@ -580,6 +576,9 @@ UsbdSetupHdlr (
CtrlRequest->Length,
&(mCtrlIoReq.IoInfo.Length)
);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "UsbdGetConfigDesc() - EFI_DEVICE_ERROR"));
}
break;

case USB_DESC_TYPE_STRING:
Expand All @@ -591,6 +590,9 @@ UsbdSetupHdlr (
CtrlRequest->Length,
&(mCtrlIoReq.IoInfo.Length)
);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "UsbdGetStringDesc() - EFI_DEVICE_ERROR"));
}
break;

#ifdef SUPPORT_SUPER_SPEED
Expand Down Expand Up @@ -621,6 +623,9 @@ UsbdSetupHdlr (
DEBUG ((DEBUG_INFO, "USB_REQ_GET_CONFIG\n"));
if (CtrlRequest->RequestType == USB_RT_TX_DIR_D_TO_H) {
Status = UsbdGetConfig (mCtrlIoReq.IoInfo.Buffer, CtrlRequest->Length, &(mCtrlIoReq.IoInfo.Length));
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "UsbdGetConfig() - EFI_DEVICE_ERROR"));
}
} else {
DEBUG ((DEBUG_INFO, "UsbdSetupHdlr: Invalid direction for USB_REQ_GET_CONFIG request\n"));
}
Expand All @@ -630,6 +635,9 @@ UsbdSetupHdlr (
DEBUG ((DEBUG_INFO, "USB_REQ_SET_CONFIG\n"));
if (CtrlRequest->RequestType == USB_RT_TX_DIR_H_TO_D) {
Status = UsbdSetConfig ((UINT8)CtrlRequest->Value);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "UsbdSetConfig() - Invalid requested configuration value: %i\n", CfgValue));
}
} else {
DEBUG ((DEBUG_INFO, "UsbdSetupHdlr: Invalid direction for USB_REQ_SET_CONFIG request\n"));
}
Expand All @@ -639,6 +647,9 @@ UsbdSetupHdlr (
DEBUG ((DEBUG_INFO, "USB_REQ_SET_ADDRESS\n"));
if (CtrlRequest->RequestType == USB_RT_TX_DIR_H_TO_D) {
Status = UsbdSetAddress ((UINT8)CtrlRequest->Value);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "UsbdSetAddress: EFI_DEVICE_ERROR\n"));
}
} else {
DEBUG ((DEBUG_INFO, "UsbdSetupHdlr: Invalid direction for USB_REQ_SET_ADDRESS request\n"));
}
Expand All @@ -648,6 +659,9 @@ UsbdSetupHdlr (
DEBUG ((DEBUG_INFO, "USB_REQ_GET_STATUS\n"));
if (CtrlRequest->RequestType & USB_RT_TX_DIR_D_TO_H) {
Status = UsbdGetStatus (mCtrlIoReq.IoInfo.Buffer, CtrlRequest->RequestType, CtrlRequest->Length, &(mCtrlIoReq.IoInfo.Length));
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "UsbdGetStatus: EFI_DEVICE_ERROR\n"));
}
} else {
DEBUG ((DEBUG_INFO, "UsbdSetupHdlr: Invalid direction for USB_REQ_GET_STATUS request\n"));
}
Expand Down
4 changes: 4 additions & 0 deletions drivers/virtual_media/virtual_media.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ static EFI_STATUS _init(storage_t *s)

if (pci_dev[VirtualRpmb])
ret = VirtioRpmbInitialize((UINTN)pci_dev[VirtualRpmb]);
if (EFI_ERROR(ret)) {
ewerr ("VirtioRpmbInitialize Error %x\n",(UINT32)ret);
//return ret;
}

ret = VirtioGetMediaInfo(DEVICE_INDEX_DEFAULT, &BlockInfo);
if (EFI_ERROR(ret)) {
Expand Down

0 comments on commit 7095cee

Please sign in to comment.