[PATCH v1] linux-gen: small rst ring and stash improvements#2362
Open
JannePeltonen wants to merge 3 commits into
Open
[PATCH v1] linux-gen: small rst ring and stash improvements#2362JannePeltonen wants to merge 3 commits into
JannePeltonen wants to merge 3 commits into
Conversation
The restricted (rst) ring variants contain ring data as a flexible array member of the ring header struct. Standard C does not allow flexible array members that are not the last member of a struct, which generates warnings and requires multiple pragmas to suppress the warnings where rst rings are embedded in other structs. Make rst rings similar to other ring flavors by removing the data array from the rst ring headers and by adding a ring data pointer parameter to the rst ring functions. Modify call sites to provide the parameter and remove the now unneeded pragmas that disable the -Wpedantic warnings. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
C does not allow flexible array members in structs that are contained in other structs. Make the ring data array common between all ring variants and move it to the top level in the stash structure and remove suppression of the -Wpedantic warning. Also remove ring init function pointer from stash struct since it does not need to be kept around after stash creation. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
Calling fastpath ODP API functions with an ODP_STASH_INVALID handle is not supported. Replace the checks for invalid handles with assertions to make the stash put and get functions a little bit smaller and faster. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
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.
Avoid using flexible array members in structs in a way that is not allowed by the C standard and get rid of the pragmas that have been used for suppressing related warnings.
Also remove unneeded ring init function pointer from stash_t and change checks for invalid stash handles to assertions in fast path stash functions.