-
Notifications
You must be signed in to change notification settings - Fork 349
Remove redundant check for return value #10006
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -218,10 +218,7 @@ void cpu_disable_core(int id) | |
| } | ||
| #if defined(CONFIG_PM) | ||
| /* TODO: before requesting core shut down check if it's not actively used */ | ||
| if (!pm_state_force(id, &(struct pm_state_info){PM_STATE_SOFT_OFF, 0, 0})) { | ||
| tr_err(&zephyr_tr, "failed to set PM_STATE_SOFT_OFF on core %d", id); | ||
| return; | ||
| } | ||
| pm_state_force(id, &(struct pm_state_info){PM_STATE_SOFT_OFF, 0, 0}); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, but the function returns a "success status" supposedly. Should we add an assert in case the implementation changes? And in production builds it will be removed anyway
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think its wise keeping the check - its safe for future API changes, and its non time critical code.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok ill close this PR. Anyway, I want to remove the call for pm_state_force() during disable and use sys_poweroff() instead. |
||
|
|
||
| /* Primary core will be turn off by the host after it enter SOFT_OFF state */ | ||
| if (cpu_is_primary(id)) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I remember correctly, at the time it was written, it was possible to receive false. But currently, that possibility no longer exists; the function returns true even if the specified state cannot be set.