From 1d23f54b88017e2d97f8b485cf2bfaa6cb1fd07c Mon Sep 17 00:00:00 2001 From: Erwin Pan Date: Mon, 15 Jan 2024 22:51:43 +0800 Subject: [PATCH] [Chef] Fix variable may be used without initialization (#31413) * Fix variable may be used without initialization * Restyled by clang-format --------- Co-authored-by: Restyled.io --- examples/chef/common/chef-fan-control-manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/chef/common/chef-fan-control-manager.cpp b/examples/chef/common/chef-fan-control-manager.cpp index 3be024c33d4d5b..56576febd693d4 100644 --- a/examples/chef/common/chef-fan-control-manager.cpp +++ b/examples/chef/common/chef-fan-control-manager.cpp @@ -96,7 +96,7 @@ Status ChefFanControlManager::HandleStep(StepDirectionEnum aDirection, bool aWra status = SpeedSetting::Get(mEndpoint, speedSetting); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, Status::InvalidCommand); - uint8_t newSpeedSetting; + uint8_t newSpeedSetting = speedSetting.ValueOr(0); uint8_t speedValue = speedSetting.ValueOr(speedCurrent); const uint8_t kLowestSpeed = aLowestOff ? 0 : 1;