-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Factor out functions for auto-discovery parsing #108
Merged
Merged
Conversation
This file contains 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
pcolberg
force-pushed
the
auto-discovery
branch
from
April 22, 2022 02:28
840fe51
to
1896503
Compare
pcolberg
commented
Apr 22, 2022
pcolberg
commented
Apr 22, 2022
pcolberg
force-pushed
the
auto-discovery
branch
from
April 22, 2022 02:33
1896503
to
887666c
Compare
pcolberg
force-pushed
the
auto-discovery
branch
from
April 22, 2022 20:07
887666c
to
04966c1
Compare
pcolberg
changed the title
Factor out function for auto-discovery parsing of kernel arguments
Factor out functions for auto-discovery parsing
Apr 22, 2022
pcolberg
force-pushed
the
auto-discovery
branch
4 times, most recently
from
April 23, 2022 00:37
cd4bec6
to
c96f2d7
Compare
Signed-off-by: Peter Colberg <peter.colberg@intel.com>
Signed-off-by: Peter Colberg <peter.colberg@intel.com>
Signed-off-by: Peter Colberg <peter.colberg@intel.com>
Signed-off-by: Peter Colberg <peter.colberg@intel.com>
Signed-off-by: Peter Colberg <peter.colberg@intel.com>
pcolberg
force-pushed
the
auto-discovery
branch
from
April 25, 2022 15:56
c96f2d7
to
f24df6c
Compare
This amends intel#109 Signed-off-by: Peter Colberg <peter.colberg@intel.com>
sherry-yuan
approved these changes
Apr 26, 2022
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.
Thanks Peter, the restructuring looks good to me.
(merge after tests passes tho)
zibaiwan
approved these changes
Apr 26, 2022
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.
Looks good to me! Thanks Peter!
# for free
to join this conversation on GitHub.
Already have an account?
# 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 factors out parsing of auto-discovery string sections into separate functions to improve the readability and maintenance of
acl_load_device_def_from_str()
. Care was taken not to modify the functional behaviour, by carrying out the refactoring twice and ensuring that the results are identical.A choice had to be made between factoring out parsing of individual section entries, e.g., a single kernel argument, versus factoring out entire loops, e.g., all kernel arguments. The latter was chosen since the data structures vary (
vector
versusunordered_map
), and, importantly, the number of fields vary between variable and fixed counts. For variable count, the number of fields is read for each entry; whereas for fixed count, the number of fields is read once for all entries. By factoring out the entire loop, the field count parsing is contained within the function in both cases.