Skip to content
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

Fix #353, correct PSP module IDs and lookups #354

Merged
merged 1 commit into from
Aug 3, 2022

Conversation

jphickey
Copy link
Contributor

Checklist (Please check before submitting)

Describe the contribution
Correct the CFE_PSP_Module_FindByName and CFE_PSP_Module_GetAPIEntry lookups to use the correct length of the config data 'PspModuleList'.

The internal variable that had been used reflected the total across two lists and thus was not a correct limit.

Rather than having these functions search both lists, this instead keeps it to only exposing the user-specified modules in PspModuleList, it does not expose the built-in/base modules. This makes the change simpler, as typically the built in modules would not be accessed through these functions at all.

Fixes #353

Testing performed
Boot CFE and confirm modules being initialized as expected. Confirm that module lookup is working and returning correct module ID.

Expected behavior changes

  • Will not segfault if attempting to find a module that does not exist
  • Will return the same ID that the module was initialized with (this was different and should not have been)

System(s) tested on
Ubuntu 22.04

Additional context
This PR does not currently add a coverage test for this code, although that should be considered as a follow on.

Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.

Correct the CFE_PSP_Module_FindByName and CFE_PSP_Module_GetAPIEntry
lookups to use the correct length of the config data 'PspModuleList'.

The internal variable that had been used reflected the total across
two lists and thus was not a correct limit.

Rather than having these functions search both lists, this instead
keeps it to only exposing the user-specified modules in PspModuleList,
it does not expose the built-in/base modules.  This makes the change
simpler, as typically the built in modules would not be accessed
through these functions at all.
@jphickey jphickey requested a review from a user July 28, 2022 16:22
Copy link

@ghost ghost left a 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!

@jphickey
Copy link
Contributor Author

This also fixes #319 (same bug, different description)

@skliper skliper added the CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) label Jul 29, 2022
@skliper skliper added this to the Draco milestone Jul 29, 2022
@dzbaker dzbaker added CCB:Approved Indicates Approval by CCB and removed CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) labels Aug 3, 2022
@dzbaker dzbaker merged commit 6264752 into nasa:main Aug 3, 2022
dzbaker added a commit to nasa/cFS that referenced this pull request Aug 5, 2022
*Combines:*

psp v1.6.0-rc4+dev47

**Includes:**

- nasa/PSP#354, correct PSP module IDs and lookups

Co-authored by: Joseph Hickey  <[email protected]>
@dzbaker dzbaker mentioned this pull request Aug 5, 2022
2 tasks
dzbaker added a commit to nasa/cFS that referenced this pull request Aug 5, 2022
*Combines:*

psp v1.6.0-rc4+dev47

**Includes:**

- nasa/PSP#354, correct PSP module IDs and lookups

Co-authored by: Joseph Hickey  <[email protected]>
@jphickey jphickey deleted the fix-353-module-id branch October 18, 2022 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCB:Approved Indicates Approval by CCB
Projects
None yet
3 participants