plugins/amdgpu: Cleanup env variable handling#3014
Open
tursulin wants to merge 1 commit into
Open
Conversation
It is a bit tidier to make the helpers return the value instead of passing in the pointer, so lets make them take the default and return the overall result, allowing the call sites to consolidate into a single line. While at it we make the helpers static since they are not used outside the file and demote the parsing errors to warning log messages since the plugin does continue operating. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## criu-dev #3014 +/- ##
============================================
- Coverage 57.22% 57.22% -0.01%
============================================
Files 154 154
Lines 40440 40441 +1
Branches 8863 8863
============================================
Hits 23142 23142
- Misses 17034 17035 +1
Partials 264 264 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is not saving a lot of lines, just two, but perhaps the pattern of:
Is somewhat cleaner than:
I also make the helpers static and demote parsing errors to warnings since the execution does continue.
I am locally toying with the idea of adding a new env variable to ignore gpu id hence I spotted this cleanup opportunity.
cc @fdavid-amd