diff options
author | Guy Harris <gharris@sonic.net> | 2020-06-20 13:55:23 -0700 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2020-06-20 22:13:56 +0000 |
commit | 5b885240b7b39972450dac85f3d0fb52255246e3 (patch) | |
tree | ac5f4552bdb228b18cab3c119ef3b40a2563fd4a /epan/dissectors/packet-mac-nr.c | |
parent | 1f8c4ec2701721eb2f850b757358399a5242e1ac (diff) |
MAC-NR: get rid of an unnecessary level of indirection.
Don't take the address of an hf_ field and then, in the called routine,
dereference the pointer; just pass the hf_ field value. In the cases
where we're passing a member of an array of pointers, dereference the
pointer at the call site.
Change-Id: I022ce46c196621088e093f9a43d57b4653c957f7
Reviewed-on: https://code.wireshark.org/review/37526
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
Diffstat (limited to 'epan/dissectors/packet-mac-nr.c')
-rw-r--r-- | epan/dissectors/packet-mac-nr.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/epan/dissectors/packet-mac-nr.c b/epan/dissectors/packet-mac-nr.c index fde3365ac4..84e4f3384a 100644 --- a/epan/dissectors/packet-mac-nr.c +++ b/epan/dissectors/packet-mac-nr.c @@ -1373,7 +1373,7 @@ static true_false_string subheader_f_vals = { /* Returns new subtree that was added for this item */ static proto_item* dissect_me_phr_ph(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, - const int *ph_item, const int *pcmax_f_c_item, + int ph_item, int pcmax_f_c_item, guint32 *PH, guint32 *offset) { /* Subtree for this entry */ @@ -1393,14 +1393,14 @@ static proto_item* dissect_me_phr_ph(tvbuff_t *tvb, packet_info *pinfo _U_, prot - a generated field added with the inferred type OR - just do proto_item_append_text() indicating what the type was */ - proto_tree_add_item_ret_uint(entry_tree, *ph_item, tvb, *offset, 1, ENC_BIG_ENDIAN, PH); + proto_tree_add_item_ret_uint(entry_tree, ph_item, tvb, *offset, 1, ENC_BIG_ENDIAN, PH); (*offset)++; if (!V) { /* Reserved (2 bits) */ proto_tree_add_item(entry_tree, hf_mac_nr_control_me_phr_reserved_2, tvb, *offset, 1, ENC_BIG_ENDIAN); /* pcmax_f_c (6 bits) */ - proto_tree_add_item(entry_tree, *pcmax_f_c_item, tvb, *offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(entry_tree, pcmax_f_c_item, tvb, *offset, 1, ENC_BIG_ENDIAN); (*offset)++; } @@ -1878,12 +1878,12 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree proto_item *entry_ti; if (p_mac_nr_info->phr_type2_othercell) { /* The PH and PCMAX,f,c fields can be either for a LTE or NR cell */ - entry_ti = dissect_me_phr_ph(tvb, pinfo, subheader_ti, &hf_mac_nr_control_me_phr_ph_type2_spcell, - &hf_mac_nr_control_me_phr_pcmax_f_c_type2_spcell, &PH, &offset); + entry_ti = dissect_me_phr_ph(tvb, pinfo, subheader_ti, hf_mac_nr_control_me_phr_ph_type2_spcell, + hf_mac_nr_control_me_phr_pcmax_f_c_type2_spcell, &PH, &offset); proto_item_append_text(entry_ti, " (Type2, SpCell PH=%u)", PH); } - entry_ti = dissect_me_phr_ph(tvb, pinfo, subheader_ti, &hf_mac_nr_control_me_phr_ph_type1_pcell, - &hf_mac_nr_control_me_phr_pcmax_f_c_type1_pcell, &PH, &offset); + entry_ti = dissect_me_phr_ph(tvb, pinfo, subheader_ti, hf_mac_nr_control_me_phr_ph_type1_pcell, + hf_mac_nr_control_me_phr_pcmax_f_c_type1_pcell, &PH, &offset); proto_item_append_text(entry_ti, " (Type1, PCell PH=%u)", PH); @@ -1891,16 +1891,16 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree /* The PH and PCMAX,f,c fields can be either for a LTE or NR cell */ for (int n=1; n <= 7; n++) { if (scell_bitmap1 & (1 << n)) { - entry_ti = dissect_me_phr_ph(tvb, pinfo, subheader_ti, ph_fields1[n-1], - &hf_mac_nr_control_me_phr_pcmax_f_c_typeX, &PH, &offset); + entry_ti = dissect_me_phr_ph(tvb, pinfo, subheader_ti, *ph_fields1[n-1], + hf_mac_nr_control_me_phr_pcmax_f_c_typeX, &PH, &offset); proto_item_append_text(entry_ti, " (SCellIndex %d PH=%u)", n, PH); } } if (lcid == MULTIPLE_ENTRY_PHR_4_LCID) { for (int n=0; n <= 23; n++) { if (scell_bitmap2_3_4 & (1 << n)) { - entry_ti = dissect_me_phr_ph(tvb, pinfo, subheader_ti, ph_fields2_3_4[n], - &hf_mac_nr_control_me_phr_pcmax_f_c_typeX, &PH, &offset); + entry_ti = dissect_me_phr_ph(tvb, pinfo, subheader_ti, *ph_fields2_3_4[n], + hf_mac_nr_control_me_phr_pcmax_f_c_typeX, &PH, &offset); proto_item_append_text(entry_ti, " (SCellIndex %d PH=%u)", n+8, PH); } } |