ieee80211-radio: fix this condition has identical branches [-Werror=duplicated-branches] found by gcc7

Change-Id: I7f5f25b0afd30612d9e20e52585c7cad70bc1f59
Reviewed-on: https://code.wireshark.org/review/20468
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
This commit is contained in:
Alexis La Goutte 2017-03-09 19:10:39 +01:00 committed by Peter Wu
parent 43a08c90a5
commit da786c28e7
1 changed files with 8 additions and 19 deletions

View File

@ -791,7 +791,6 @@ dissect_wlan_radio_phdr (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
guint Nsts, bits, Mstbc, bits_per_symbol, symbols;
guint stbc_streams;
guint ness;
gboolean fec;
/*
* If we don't have necessary fields, or if we have them but
@ -858,28 +857,18 @@ dissect_wlan_radio_phdr (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
}
preamble += 4 * (Nhtdltf[Nsts-1] + Nhteltf[ness]);
if (info_n->has_fec) {
fec = info_n->fec;
} else {
fec = 0;
if (!info_n->has_fec) {
assumed_bcc_fec = TRUE;
}
/* data field calculation */
if (fec == 0) {
/* see ieee80211n-2009 20.3.11 (20-32) - for BCC FEC */
bits = 8 * frame_length + 16 + ieee80211_ht_Nes[info_n->mcs_index] * 6;
Mstbc = stbc_streams ? 2 : 1;
bits_per_symbol = ieee80211_ht_Dbps[info_n->mcs_index] * (bandwidth_40 ? 2 : 1);
symbols = bits / (bits_per_symbol * Mstbc);
} else {
/* TODO: handle LDPC FEC, it changes the rounding
* Currently this is the same logic as BCC */
bits = 8 * frame_length + 16 + ieee80211_ht_Nes[info_n->mcs_index] * 6;
Mstbc = stbc_streams ? 2 : 1;
bits_per_symbol = ieee80211_ht_Dbps[info_n->mcs_index] * (bandwidth_40 ? 2 : 1);
symbols = bits / (bits_per_symbol * Mstbc);
}
/* see ieee80211n-2009 20.3.11 (20-32) - for BCC FEC */
/* TODO: handle LDPC FEC (info_n->fec == 1), it changes the rounding
* Currently this is the same logic as BCC */
bits = 8 * frame_length + 16 + ieee80211_ht_Nes[info_n->mcs_index] * 6;
Mstbc = stbc_streams ? 2 : 1;
bits_per_symbol = ieee80211_ht_Dbps[info_n->mcs_index] * (bandwidth_40 ? 2 : 1);
symbols = bits / (bits_per_symbol * Mstbc);
/* round up to whole symbols */
if((bits % (bits_per_symbol * Mstbc)) > 0)