Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix static scan issue: dead code and unused value #34

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions drivers/cf9/cf9.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ cf9_reset_system(EFI_RESET_TYPE ResetType,
UINT8 cf9;
UINT32 port = 0xcf9;

if (ResetType == EfiResetShutdown)
return EFI_UNSUPPORTED;

switch (ResetType) {
case EfiResetWarm:
code = 0x06;
Expand Down
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
2 changes: 0 additions & 2 deletions drivers/virtual_media/VirtioRpmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ static RPMB_DATA_FRAME *VrpmbGetFrameAddress(VOID *virtio_buffer, UINT32 index)

for (i = 0; i < index; i++) {
cmd = &cmds[i];
if (!cmd)
return NULL;
offset += cmd->n_rpmb_frame;
}

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