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 MISRA_C_2012 rule 17.7 violation #848

Merged
merged 7 commits into from
Dec 6, 2023

Conversation

kar-rahul-aws
Copy link
Member

@kar-rahul-aws kar-rahul-aws commented Oct 21, 2023

Fix MISRA C 2012 rule 17.7 violation

Description

Misra Rule 17.7

The value returned by a function having non-void return type shall be used.

MISRA violation
The return type for the function xPortStartScheduler() is not void, as a result, it should be assigned to a non-void value
The function prototype:

BaseType_t xPortStartScheduler()
{
 // code.
}

Fix

  • Call the API with a void return type , since the return value is not getting used.

Test Steps

Run the Coverity tool and checked the errors are not reported.
Run the STM32H743ZI demo project without errors.

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

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

@kar-rahul-aws kar-rahul-aws marked this pull request as draft October 21, 2023 16:00
@codecov
Copy link

codecov bot commented Oct 23, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (edce1e9) 93.77% compared to head (fb2004b) 93.77%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #848   +/-   ##
=======================================
  Coverage   93.77%   93.77%           
=======================================
  Files           6        6           
  Lines        3179     3179           
  Branches      885      885           
=======================================
  Hits         2981     2981           
  Misses         91       91           
  Partials      107      107           
Flag Coverage Δ
unittests 93.77% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kar-rahul-aws kar-rahul-aws marked this pull request as ready for review October 23, 2023 09:50
@kar-rahul-aws kar-rahul-aws requested a review from a team as a code owner November 1, 2023 16:06
Copy link

sonarqubecloud bot commented Dec 6, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@aggarg aggarg merged commit 71d86f9 into FreeRTOS:main Dec 6, 2023
17 checks passed
@aggarg aggarg deleted the fix_misra_17_7 branch December 6, 2023 11:03
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.

4 participants