Removed an early return in busenum.c to apply DEF_STATICALLY_ENUMERATED_TOASTERS#1349
Removed an early return in busenum.c to apply DEF_STATICALLY_ENUMERATED_TOASTERS#1349stjeong wants to merge 1 commit intomicrosoft:mainfrom
Conversation
…en an optional property is not present. If not removing else clause, "DEF_STATICALLY_ENUMERATED_TOASTERS" definition not applied as the comment say, "If the registry value doesn't exist, we will use the hardcoded default number."
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in the toaster bus driver where the default number of statically enumerated toasters was not being applied correctly. The early return in the else clause prevented the function from continuing with the hardcoded default value (DEF_STATICALLY_ENUMERATED_TOASTERS = 0) when the registry query failed, contradicting the documented behavior in the comments.
Changes:
- Removed early return statements in
Bus_DoStaticEnumerationfunctions that prevented fallback to default values - Fixed logic to allow enumeration to proceed with
DEF_STATICALLY_ENUMERATED_TOASTERSwhen registry values are missing
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| general/toaster/toastDrv/kmdf/bus/static/busenum.c | Removed early return in else clause to allow fallback to default toaster count |
| general/toaster/toastDrv/kmdf/bus/dynamic/busenum.c | Removed early return in else clause to allow fallback to default toaster count |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@microsoft-github-policy-service agree |
@microsoft-github-policy-service agree |
If not removing "else clause", "DEF_STATICALLY_ENUMERATED_TOASTERS" definition not applied as the comment says, "If the registry value doesn't exist, we will use the hardcoded default number."