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

Misra Compliance Updates #449

Merged
merged 37 commits into from
Aug 24, 2022
Merged

Misra Compliance Updates #449

merged 37 commits into from
Aug 24, 2022

Conversation

Skptak
Copy link
Member

@Skptak Skptak commented Jul 26, 2022

Changes to the codebase to remove MISRA violations

Description

In summary, this is a mix of casting changes as well as variable swaps to remove MISRA violations. Violations that were not feasible to be removed have had inline suppression, with justification, added to them. There are still a few violations that need to be fixed, but this is the vast majority of them.

Checklist:

  • [ x ] I have tested my changes. No regression in existing tests.
  • [ x ] My code is formatted using Uncrustify.
  • [ x ] I have read and applied the rules stated in CONTRIBUTING.md.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Soren Ptak and others added 21 commits July 25, 2022 23:02
Introduced the removal of assert for when doing coverity_analysis
builds. Made some cast changes to remove warnings. Fixed some type
casting issues. Then updated MISRA.md and misra.config files.
Going to try out casting the 0xFFU to a uint8_t before the and,
otherwise I'll do a mask variable.
non-100% line check. Then another change to getFileContextFromJob() to
attempt to please MISRA and our PR checks.
… on complexity, so this is potentially the most MISRA compliant we can get the function
Modified some variables consts to help with MISRA violations.
Updated MISRA.md file to use the new format.
Updated inline suppression to use new format.
Removed a problematic ENUM and now using #define'd values.
so removing that const and adding in an inline supression.
source/ota.c Outdated
@@ -1014,6 +1017,9 @@ static OtaErr_t processJobHandler( const OtaEventData_t * pEventData )
}

/* Application callback for event processed. */
/* MISRA Ref 11.8.1 [Function pointer and use of const pointer] */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment ([Function pointer and use of const pointer]) correct? I am not sure where is the function pointer.

source/ota.c Outdated
@@ -1285,6 +1294,9 @@ static OtaErr_t processDataHandler( const OtaEventData_t * pEventData )
}

/* Application callback for event processed. */
/* MISRA Ref 11.8.1 [Function pointer and use of const pointer] */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly here.

*/
LogInfo( ( "Image version is valid: Begin testing file: File ID=%d",
otaAgent.serverFileID ) );
#if ( otaconfigAllowDowngrade == 1U )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not need the condition || ( errVersionCheck == OtaErrNone ) ) here?

@Skptak Skptak requested a review from ravibhagavandas August 24, 2022 18:15
@Skptak Skptak merged commit 1cd22fb into aws:main Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants