-
Notifications
You must be signed in to change notification settings - Fork 321
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
[stable-v2.2] backport Fix code quality issues in sof tools #8216 #8271
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The values assigned when declaring variables were overwritten in the code. Redundant initialization was removed. Signed-off-by: Adrian Warecki <[email protected]> (cherry picked from commit 877079a)
Added checking of the value returned by fseek function and added memory release when an error is detected. Signed-off-by: Adrian Warecki <[email protected]> (cherry picked from commit 7141836)
If fseek reports an error, the error code set in errno is returned. Improved handling an error during reading from a file. Now it distinguishes between an error reported by the fread and insufficient data in a file. Signed-off-by: Adrian Warecki <[email protected]> (cherry picked from commit e5f337b)
String terminator was added to the buffer with a list of section names in the elf file. Added check to the section name index to make sure it doesn't go beyond the buffer size. Signed-off-by: Adrian Warecki <[email protected]> (cherry picked from commit 5c016bc)
The clock_gettime function only returns information that an error occurred. The error code should be taken from the errno variable. Signed-off-by: Adrian Warecki <[email protected]> (cherry picked from commit f882c30)
Added checking of value returned by file operation functions. In case of an error, message is printed and error code is returned. Signed-off-by: Adrian Warecki <[email protected]> (cherry picked from commit 9f36a5d)
The timestamp printing process has been simplified by eliminating the dynamic creation of the formatting string. All necessary parameters are now passed directly to the printing function. Signed-off-by: Adrian Warecki <[email protected]> (cherry picked from commit 4c905f5)
…inated Added a null string terminator to be sure that strings read from a file are terminated correctly. Signed-off-by: Adrian Warecki <[email protected]> (cherry picked from commit 30a2855)
The precision check condition has been simplified, the unsigned value cannot be negative. Added definitions containing an error message instead of using a constant variable. Signed-off-by: Adrian Warecki <[email protected]> (cherry picked from commit 56a1352)
Used string manipulation functions that check the size of the available buffer. Signed-off-by: Adrian Warecki <[email protected]> (cherry picked from commit 651af68)
Improved release of resources when an error is detected. Signed-off-by: Adrian Warecki <[email protected]> (cherry picked from commit 966ad48)
Closed
marc-hb
requested review from
bkokoszx,
akloniex,
lgirdwood,
plbossart,
mmaka1,
lbetlej and
dbaluta
as code owners
September 27, 2023 21:52
Unrelated hard drive warning in https://sof-ci.01.org/sofpr/PR8271/build13531/devicetest/index.html?model=JSL_RVP_NOCODEC&testcase=verify-kernel-boot-log, everything passed. Logs look good. QB is still not compatible with stable-v2.2 checkpatch complains about some CamelCase - same as in the original #8216 Everything else green. |
lgirdwood
approved these changes
Sep 29, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Clean backport of #8216, zero git conflict.