There are two redundant if conditions that can be simplified to directly use pdu->u.cmd_submit. Signed-off-by: Xiaobo Liu <cppcoffee@xxxxxxxxx> --- drivers/usb/usbip/usbip_common.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/usb/usbip/usbip_common.c b/drivers/usb/usbip/usbip_common.c index a2b2da125..74a01a265 100644 --- a/drivers/usb/usbip/usbip_common.c +++ b/drivers/usb/usbip/usbip_common.c @@ -568,17 +568,9 @@ static void correct_endian_ret_unlink(struct usbip_header_ret_unlink *pdu, void usbip_header_correct_endian(struct usbip_header *pdu, int send) { - __u32 cmd = 0; - - if (send) - cmd = pdu->base.command; - correct_endian_basic(&pdu->base, send); - if (!send) - cmd = pdu->base.command; - - switch (cmd) { + switch (pdu->base.command) { case USBIP_CMD_SUBMIT: correct_endian_cmd_submit(&pdu->u.cmd_submit, send); break; -- 2.34.1