-
Notifications
You must be signed in to change notification settings - Fork 74
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
Conversation
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.
…AllowDowngrade message, then a seperate one for if it's being done with the versionCheck
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] */ |
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.
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] */ |
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.
Similarly here.
*/ | ||
LogInfo( ( "Image version is valid: Begin testing file: File ID=%d", | ||
otaAgent.serverFileID ) ); | ||
#if ( otaconfigAllowDowngrade == 1U ) |
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.
Do we not need the condition || ( errVersionCheck == OtaErrNone ) )
here?
…etting used and as such are no longer being flagged
… the misra.config file
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:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.