Remove unnecessary if related to TLV padding

parent 25075344
...@@ -652,9 +652,7 @@ int unpack_tlv_list(unpack_tlv_t unpack_fns[], uint16_t size, uint8_t **ppReadPa ...@@ -652,9 +652,7 @@ int unpack_tlv_list(unpack_tlv_t unpack_fns[], uint16_t size, uint8_t **ppReadPa
} }
// Remove padding that ensures multiple of 4 bytes (SCF 225 Section 2.3.2.1) // Remove padding that ensures multiple of 4 bytes (SCF 225 Section 2.3.2.1)
int padding = get_tlv_padding(tl->length); int padding = get_tlv_padding(tl->length);
if (padding != 0) { (*ppReadPackedMsg) += padding;
(*ppReadPackedMsg) += padding;
}
} }
} }
...@@ -739,9 +737,7 @@ int unpack_p7_tlv_list(unpack_p7_tlv_t unpack_fns[], uint16_t size, uint8_t **pp ...@@ -739,9 +737,7 @@ int unpack_p7_tlv_list(unpack_p7_tlv_t unpack_fns[], uint16_t size, uint8_t **pp
} }
// Remove padding that ensures multiple of 4 bytes (SCF 225 Section 2.3.2.1) // Remove padding that ensures multiple of 4 bytes (SCF 225 Section 2.3.2.1)
int padding = get_tlv_padding(tl->length); int padding = get_tlv_padding(tl->length);
if (padding != 0) { (*ppReadPackedMsg) += padding;
(*ppReadPackedMsg) += padding;
}
} }
} }
...@@ -822,10 +818,8 @@ uint8_t pack_tlv(uint16_t tag, void *tlv, uint8_t **ppWritePackedMsg, uint8_t *e ...@@ -822,10 +818,8 @@ uint8_t pack_tlv(uint16_t tag, void *tlv, uint8_t **ppWritePackedMsg, uint8_t *e
// Add padding that ensures multiple of 4 bytes (SCF 225 Section 2.3.2.1) // Add padding that ensures multiple of 4 bytes (SCF 225 Section 2.3.2.1)
int padding = get_tlv_padding(tl->length); int padding = get_tlv_padding(tl->length);
NFAPI_TRACE(NFAPI_TRACE_DEBUG, "TLV 0x%x with padding of %d bytes\n", tl->tag, padding); NFAPI_TRACE(NFAPI_TRACE_DEBUG, "TLV 0x%x with padding of %d bytes\n", tl->tag, padding);
if (padding != 0) { memset(*ppWritePackedMsg,0,padding);
memset(*ppWritePackedMsg,0,padding); (*ppWritePackedMsg) += padding;
(*ppWritePackedMsg) += padding;
}
} else { } else {
if(tl->tag != 0) { if(tl->tag != 0) {
NFAPI_TRACE(NFAPI_TRACE_WARN, "Warning pack_tlv tag 0x%x does not match expected 0x%x\n", tl->tag, tag); NFAPI_TRACE(NFAPI_TRACE_WARN, "Warning pack_tlv tag 0x%x does not match expected 0x%x\n", tl->tag, tag);
......
...@@ -2089,9 +2089,7 @@ static uint8_t unpack_nr_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, ...@@ -2089,9 +2089,7 @@ static uint8_t unpack_nr_config_request(uint8_t **ppReadPackedMsg, uint8_t *end,
// Advance past the unknown TLV // Advance past the unknown TLV
(*ppReadPackedMsg) += generic_tl.length ; (*ppReadPackedMsg) += generic_tl.length ;
int padding = get_tlv_padding(generic_tl.length); int padding = get_tlv_padding(generic_tl.length);
if (padding != 0) { (*ppReadPackedMsg) += padding;
(*ppReadPackedMsg) += padding;
}
} else { } else {
// go to the end // go to the end
return 0; return 0;
...@@ -2108,9 +2106,7 @@ static uint8_t unpack_nr_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, ...@@ -2108,9 +2106,7 @@ static uint8_t unpack_nr_config_request(uint8_t **ppReadPackedMsg, uint8_t *end,
// Advance past the unknown TLV // Advance past the unknown TLV
(*ppReadPackedMsg) += generic_tl.length ; (*ppReadPackedMsg) += generic_tl.length ;
int padding = get_tlv_padding(generic_tl.length); int padding = get_tlv_padding(generic_tl.length);
if (padding != 0) { (*ppReadPackedMsg) += padding;
(*ppReadPackedMsg) += padding;
}
} else { } else {
// go to the end // go to the end
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment