From 519eca23995b130fcc0e7360ec2a5044ca15e51e Mon Sep 17 00:00:00 2001 From: Hemanth Rao Date: Tue, 17 Oct 2023 02:35:47 -0400 Subject: [PATCH] use operator= instead of memcpy --- src/lib/spinel/radio_spinel.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/spinel/radio_spinel.cpp b/src/lib/spinel/radio_spinel.cpp index c7573eeb71cc..920ca3a57825 100644 --- a/src/lib/spinel/radio_spinel.cpp +++ b/src/lib/spinel/radio_spinel.cpp @@ -902,9 +902,9 @@ otError RadioSpinel::SetMacKey(uint8_t aKeyIdMode, #else OT_UNUSED_VARIABLE(aKeySize); - memcpy(prevKey.m8, aPrevKey->mKeyMaterial.mKey.m8, OT_MAC_KEY_SIZE); - memcpy(currKey.m8, aCurrKey->mKeyMaterial.mKey.m8, OT_MAC_KEY_SIZE); - memcpy(nextKey.m8, aNextKey->mKeyMaterial.mKey.m8, OT_MAC_KEY_SIZE); + prevKey = aPrevKey->mKeyMaterial.mKey; + currKey = aCurrKey->mKeyMaterial.mKey; + nextKey = aNextKey->mKeyMaterial.mKey; #endif SuccessOrExit(error = Set(SPINEL_PROP_RCP_MAC_KEY, @@ -917,9 +917,9 @@ otError RadioSpinel::SetMacKey(uint8_t aKeyIdMode, mKeyIdMode = aKeyIdMode; mKeyId = aKeyId; - memcpy(mPrevKey.m8, prevKey.m8, OT_MAC_KEY_SIZE); - memcpy(mCurrKey.m8, currKey.m8, OT_MAC_KEY_SIZE); - memcpy(mNextKey.m8, nextKey.m8, OT_MAC_KEY_SIZE); + mPrevKey = prevKey; + mCurrKey = currKey; + mNextKey = nextKey; mMacKeySet = true; #endif