From 8d6b20ad2d75f172f48df5525f609c2a9e7ab736 Mon Sep 17 00:00:00 2001 From: Martin Kaiser Date: Tue, 8 Apr 2014 10:14:35 +0200 Subject: move the assignments for is_request, endpoint behind the if statements Change-Id: Id3938253bbc63cc27823afa326b1997182e3943d Reviewed-on: https://code.wireshark.org/review/1015 Reviewed-by: Martin Kaiser --- epan/dissectors/packet-usb.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'epan') diff --git a/epan/dissectors/packet-usb.c b/epan/dissectors/packet-usb.c index 8fbf3f4b6b..13f1678916 100644 --- a/epan/dissectors/packet-usb.c +++ b/epan/dissectors/packet-usb.c @@ -2725,10 +2725,8 @@ dissect_usb_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent, dissect_linux_usb_pseudo_header(tvb, pinfo, tree, &bus_id, &device_address); urb_type = tvb_get_guint8(tvb, 8); - is_request = (urb_type == URB_SUBMIT) ? TRUE : FALSE; type = tvb_get_guint8(tvb, 9); endpoint_with_dir = tvb_get_guint8(tvb, 10); - endpoint = endpoint_with_dir & (~URB_TRANSFER_IN); setup_flag = tvb_get_guint8(tvb, 14); offset += 40; /* skip first part of the pseudo-header */ } else if (header_info & USB_HEADER_IS_USBPCAP) { @@ -2749,10 +2747,8 @@ dissect_usb_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent, } else { urb_type = URB_SUBMIT; } - is_request = (urb_type == URB_SUBMIT) ? TRUE : FALSE; type = tvb_get_guint8(tvb, 22); endpoint_with_dir = tvb_get_guint8(tvb, 21); - endpoint = endpoint_with_dir & (~URB_TRANSFER_IN); win32_data_len = tvb_get_letohl(tvb, 23); usbpcap_control_stage = tvb_get_guint8(tvb, 27); @@ -2772,6 +2768,9 @@ dissect_usb_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent, return; } + endpoint = endpoint_with_dir & (~URB_TRANSFER_IN); + is_request = (urb_type == URB_SUBMIT) ? TRUE : FALSE; + /* Set up addresses and ports. */ if (is_request) { src_addr.device = 0xffffffff; -- cgit v1.2.3