diff --git a/src/lib/dnssd/Discovery_ImplPlatform.cpp b/src/lib/dnssd/Discovery_ImplPlatform.cpp index 6f98ac71b34a38..e83a88915f2ea4 100644 --- a/src/lib/dnssd/Discovery_ImplPlatform.cpp +++ b/src/lib/dnssd/Discovery_ImplPlatform.cpp @@ -452,8 +452,7 @@ void DiscoveryImplPlatform::HandleDnssdInit(void * context, CHIP_ERROR initError publisher->mState = State::kInitialized; // Post an event that will start advertising - DeviceLayer::ChipDeviceEvent event; - event.Type = DeviceLayer::DeviceEventType::kDnssdInitialized; + DeviceLayer::ChipDeviceEvent event{ .Type = DeviceLayer::DeviceEventType::kDnssdInitialized }; CHIP_ERROR error = DeviceLayer::PlatformMgr().PostEvent(&event); if (error != CHIP_NO_ERROR) @@ -477,9 +476,8 @@ void DiscoveryImplPlatform::HandleDnssdError(void * context, CHIP_ERROR error) // Restore dnssd state before restart, also needs to call ChipDnssdShutdown() publisher->Shutdown(); - DeviceLayer::ChipDeviceEvent event; - event.Type = DeviceLayer::DeviceEventType::kDnssdRestartNeeded; - error = DeviceLayer::PlatformMgr().PostEvent(&event); + DeviceLayer::ChipDeviceEvent event{ .Type = DeviceLayer::DeviceEventType::kDnssdRestartNeeded }; + error = DeviceLayer::PlatformMgr().PostEvent(&event); if (error != CHIP_NO_ERROR) { diff --git a/src/protocols/secure_channel/PairingSession.cpp b/src/protocols/secure_channel/PairingSession.cpp index 6176d097c5118a..49f80713d8ed8c 100644 --- a/src/protocols/secure_channel/PairingSession.cpp +++ b/src/protocols/secure_channel/PairingSession.cpp @@ -81,8 +81,7 @@ void PairingSession::Finish() if (err == CHIP_NO_ERROR) { VerifyOrDie(mSecureSessionHolder); - DeviceLayer::ChipDeviceEvent event; - event.Type = DeviceLayer::DeviceEventType::kSecureSessionEstablished; + DeviceLayer::ChipDeviceEvent event{ .Type = DeviceLayer::DeviceEventType::kSecureSessionEstablished }; event.SecureSessionEstablished.TransportType = to_underlying(address.GetTransportType()); event.SecureSessionEstablished.SecureSessionType = to_underlying(mSecureSessionHolder->AsSecureSession()->GetSecureSessionType());