Skip to content

drivers: spi: added break in switch of function push_data #13806

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

Closed

Conversation

maxxlife
Copy link
Contributor

@maxxlife maxxlife commented Feb 26, 2019

I added a new break statement in case 1

Before I thought that maybe it is good idea to make case 1 by default,
but it will be useless, so I decided to add break in case 1 instead of
making it by default:
Now switch part of the function must run like classic switch.

Coverity-CID: 190978
Fixes: #13842

Signed-off-by: Maksim Masalski [email protected]

@maxxlife maxxlife requested a review from tbursztyka as a code owner February 26, 2019 20:02
@codecov-io
Copy link

Codecov Report

Merging #13806 into master will increase coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13806      +/-   ##
==========================================
+ Coverage   52.26%    52.3%   +0.03%     
==========================================
  Files         307      307              
  Lines       45410    45410              
  Branches    10504    10504              
==========================================
+ Hits        23734    23750      +16     
+ Misses      16887    16875      -12     
+ Partials     4789     4785       -4
Impacted Files Coverage Δ
subsys/testsuite/ztest/src/ztest.c 72.72% <0%> (+7.43%) ⬆️
subsys/testsuite/ztest/include/ztest_assert.h 77.77% <0%> (+38.88%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cd65ed8...5a4015e. Read the comment docs.

According to the Coverity issue 190978
I added a new break statement in case 1

Before I thought that maybe it is good idea to make case 1 by default,
but it will be useless, so I decided to add break in case 1 instead of
making it by default:

Now switch part of the function must run like classic switch.

Signed-off-by: Maksim Masalski <[email protected]>
@maxxlife maxxlife reopened this Feb 27, 2019
@pfalcon
Copy link
Collaborator

pfalcon commented Feb 28, 2019

Thanks for the patch.

A correct commit title would be:

drivers: spi: Added break in switch of function push_data

Regarding reference to Coverity, we use following syntax (that should be in contrib manual software I hope):

Coverity-CID: 190978

Similarly, we have:

Fixes: #13842

To refer to the bug ticket (and have it automagically closed when the PR is merged - not a useless feature for a project with ~1000 pending issue tickets).

Just add those before the Signed-off-by line. (You can always grep git log if you forget the exact syntax, that's what I do.)

@maxxlife
Copy link
Contributor Author

Thanks for the patch.

A correct commit title would be:

drivers: spi: Added break in switch of function push_data

Regarding reference to Coverity, we use following syntax (that should be in contrib manual software I hope):

Coverity-CID: 190978

Similarly, we have:

Fixes: #13842

To refer to the bug ticket (and have it automagically closed when the PR is merged - not a useless feature for a project with ~1000 pending issue tickets).

Just add those before the Signed-off-by line. (You can always grep git log if you forget the exact syntax, that's what I do.)

Understand, will read manual more carefully.

@pfalcon
Copy link
Collaborator

pfalcon commented Feb 28, 2019

Understand, will read manual more carefully

You're doing great actually. I don't know what motivates you to contribute to Zephyr, but I'd say how you do it is an ideal model how a newcomer would start. So, please treat those as friendly hints to make it all even more smooth ;-).

@maxxlife maxxlife changed the title drivers: coverity: added break in switch of function push_data drivers: spi: added break in switch of function push_data Feb 28, 2019
@galak
Copy link
Collaborator

galak commented Mar 15, 2019

Thanks for the PR, got a fix in commit 846dfd4. Closing this PR.

@galak galak closed this Mar 15, 2019
@maxxlife maxxlife deleted the coverity-fix-190978 branch May 2, 2019 13:33
@maxxlife maxxlife restored the coverity-fix-190978 branch May 2, 2019 13:37
@maxxlife maxxlife deleted the coverity-fix-190978 branch May 2, 2019 13:47
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