USB: fix redundant assignments or tests flagged by PVS-Studio
Bug: 16335 Change-Id: I19ea32fb607bf4132c1690f46dca5ed055009b84 Reviewed-on: https://code.wireshark.org/review/37211 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
This commit is contained in:
parent
7794527604
commit
cf340fa0ec
|
@ -479,7 +479,6 @@ dissect_usb_com_descriptor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
k_device_address = usb_conv_info->device_address;
|
||||
k_frame_number = pinfo->num;
|
||||
|
||||
offset = 3;
|
||||
control_item = proto_tree_add_item_ret_uint(subtree, hf_usb_com_descriptor_control_interface, tvb, offset, 1, ENC_LITTLE_ENDIAN, &master);
|
||||
|
||||
if (master != usb_conv_info->interfaceNum) {
|
||||
|
|
|
@ -338,13 +338,11 @@ dissect_usb_dfu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
|
|||
command_tree = proto_item_add_subtree(command_item, ett_command);
|
||||
proto_item_set_generated(command_item);
|
||||
|
||||
if (command_data) {
|
||||
command_item = proto_tree_add_uint(main_tree, hf_setup_interface, tvb, offset, 0, command_data->interface);
|
||||
proto_item_set_generated(command_item);
|
||||
command_item = proto_tree_add_uint(main_tree, hf_setup_interface, tvb, offset, 0, command_data->interface);
|
||||
proto_item_set_generated(command_item);
|
||||
|
||||
command_item = proto_tree_add_uint(main_tree, hf_command_in_frame, tvb, offset, 0, command_data->command_frame_number);
|
||||
proto_item_set_generated(command_item);
|
||||
}
|
||||
command_item = proto_tree_add_uint(main_tree, hf_command_in_frame, tvb, offset, 0, command_data->command_frame_number);
|
||||
proto_item_set_generated(command_item);
|
||||
|
||||
switch (command_response) {
|
||||
case 0x02: /* Upload */
|
||||
|
|
Loading…
Reference in New Issue