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

[stable-v2.2] backport Fix code quality issues in sof tools #8216 #8271

Merged
merged 11 commits into from
Sep 29, 2023

Conversation

marc-hb
Copy link
Collaborator

@marc-hb marc-hb commented Sep 27, 2023

Clean backport of #8216, zero git conflict.

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)
@marc-hb marc-hb mentioned this pull request Sep 27, 2023
@marc-hb marc-hb marked this pull request as ready for review September 27, 2023 21:52
@marc-hb
Copy link
Collaborator Author

marc-hb commented Sep 27, 2023

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 lgirdwood merged commit abac95f into thesofproject:stable-v2.2 Sep 29, 2023
18 of 19 checks passed
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