Simplify code flow in fabrics.c#3447
Open
Mr-Bossman wants to merge 2 commits into
Open
Conversation
Simplify create_common_context by calling setup_common_context. Add to set_fabrics_options to setup_common_context as both callers call it after setup_common_context. Signed-off-by: Jesse Taube <jtaubepe@redhat.com>
hook_parser_next_line used gotos to implement a do-while loop. Replace the gotos with a do-while loop to improve readability. Signed-off-by: Jesse Taube <jtaubepe@redhat.com>
igaw
reviewed
Jun 16, 2026
Collaborator
There was a problem hiding this comment.
let's use then the opportunity to do return setup_comm_context(...) here.
igaw
reviewed
Jun 16, 2026
| @@ -391,7 +387,7 @@ static int setup_common_context(struct libnvmf_context *fctx, | |||
| if (err) | |||
| return err; | |||
|
|
|||
| return 0; | |||
| return set_fabrics_options(fctx, fa); | |||
| } | |||
|
|
|||
| static int create_common_context(struct libnvme_global_ctx *ctx, | |||
Collaborator
There was a problem hiding this comment.
I suppose it would make sense to drop the common in the function names. I introduced it because I thought there will be a need to differentiate between the 'base' info and the rest. But looks like it's not really the case.
Collaborator
|
Looks good, just my nitpicks and a rebase is necessary. |
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.
hook_parser_next_line used gotos to implement a do-while loop.
Replace the gotos with a do-while loop to improve readability.
Simplify create_common_context by calling setup_common_context.
Add to set_fabrics_options to setup_common_context as both callers call it after setup_common_context.
Signed-off-by: Jesse Taube jtaubepe@redhat.com