omit redundant code

This commit is contained in:
Gatsby Van
2024-03-07 11:41:52 +08:00
parent c09bd57408
commit dfecadac56
2 changed files with 5 additions and 16 deletions
@@ -660,10 +660,10 @@ int32_t Linklayer_Init(L2_INST **instPtr, const L2_CONFIG *config)
DBG_ERROR("Allocate memory for L2_InstPtr failed.\n");
return ENOMEM;
}
// Clear random content
memset(*instPtr, 0x00, sizeof(L2_INST));
memcpy(&((*instPtr)->config), config, sizeof(L2_CONFIG));
// Clear log
memset(&((*instPtr)->log), 0x00, sizeof((*instPtr)->log));
// Packet buffer
(*instPtr)->sendPktData = calloc(L2_PACK_LEN_MAX / sizeof(uint64_t), sizeof(uint64_t));