Open
Open
Enhancement
Description
Coding guideline fixes migration from auditable branch back to main (forward port)
The actual https://docs.zephyrproject.org/latest/contribute/coding_guidelines/index.html defines a subset of MISRA-C 2012 rules.
A wide range of violations of the the projects coding guideline rules where fixed in the auditable branch (https://github.com/zephyrproject-rtos/zephyr/tree/v2.7-auditable-branch) by BUGSENG (https://github.com/zephyrproject-rtos/zephyr/commits/v2.7-auditable-branch/?author=Abramo-Bagnara) and need to be brought back to the main branch so the whole project will benefit.
Migration status
The following list shows and tracks the commits which should be brought to the main branch
- coding guidelines: comply with MISRA C:2012 Rule 12.2 07c3d45
includes: explicit cast of destination bitwidth of left shift #71856 - coding guidelines: comply with MISRA C:2012 Rule 17.7 f77c7bb
arch: coding guidelines: add explicit cast to void #72066
include: zephyr: coding guidelines: add explicit cast to void #72160
lib: os: coding guidelines: add explicit cast to void #72166
kernel: coding guidelines: add explicit cast to void #72165 -
coding guidelines: comply with MISRA C:2012 Rule 8.3 7b6cdcbClosed to duplicate PR and heavy changes in the gen_syscalls.py scripts which need to be analyzed if these functional changes has impact.
scripts: ensure declarations of objects use same names and type qualifiers #71919 -
coding guidelines: comply with MISRA C:2012 Rule 8.3 878d433Closed to duplicate PR and heavy changes in the gen_syscalls.py scripts which need to be analyzed if these functional changes has impact.
scripts: ensure declarations of objects use same names and type qualifiers #71919 - coding guidelines: comply with MISRA C:2012 Rule 11.2 9043b65
Userspace: avoid to convert pointers to incomplete type using the pointer to first item #71981
kernel: avoid to convert pointers to incomplete type using the pointer to first item #71984 - coding guidelines: comply with MISRA C:2012 Rule 15.6 071def1
arch x86: added missing braces #72074 - coding guidelines: comply with MISRA C:2012 Rule 20.9 922cde0
drivers: avoid to use undefined macros in #if expressions #72073
arch x86: avoid to use undefined macros in #if expressions #72076
includes: avoid to use undefined macros in #if expressions #72084
kernel: avoid to use undefined macros in #if expressions #72088
tests: avoid to use undefined macros in #if expressions #72089 - coding guidelines: comply with MISRA C:2012 Rule 21.15 7229c12
kernel: made copied datatype explicit #72093
Formatting Output: made copied datatype explicit #72094 - coding guidelines: comply with MISRA C:2012 Rule 2.2 88608b2
arch: avoided dead stores #72095
kernel: avoided dead stores #72099 - coding guidelines: comply with MISRA C:2012 Rule 8.3 bdc5f2c
arch: x86: corrected parameter names #74923 - coding guidelines: comply with MISRA C:2012 Rule 12.1. 29155bd
drivers: added requested parentheses verifying the lack of ambiguities #72126
includes: added requested parentheses verifying the lack of ambiguities #72133
kernel: added parentheses verifying the lack of ambiguities #72149
lib: added parentheses verifying the lack of ambiguities #72213
arch: avoided dead stores #72095
subsys: added parentheses verifying the lack of ambiguities #72219 - coding guidelines: comply with MISRA C:2012 Rule 2.7 5b627ad
drivers: added requested parentheses verifying the lack of ambiguities #72126
debug: stack: coding guidelines: cast unused arguments to void #72233
arch: x86: coding guidelines: cast unused arguments to void #72228
kernel: coding guidelines: cast unused arguments to void #72236 -
coding guidelines: comply with MISRA C:2012 Rule 11.9 839fa85Closed due to functional changes ( in the context of physical addresses ) and concerns of the maintainer which are described in the PR -> Justification needed.
kernel: avoided unwanted null pointer if CONFIG_KERNEL_VM_BASE is 0 #72220 - coding guidelines: comply with MISRA C:2012 Rule 13.4 64336f4
includes: avoid using result of an assignment operator #72223
kernel: avoid using result of an assignment operator #72226
os: avoid using result of an assignment operator #72227 - coding guidelines: comply with MISRA C:2012 Rule 11.6 64816d5
arch: x86: Avoid cast between pointer to void and an arithmetic type. #72231 - coding guidelines: comply with MISRA C:2012 Rule 15.2 ac487cf
Formatting Output: Avoid backwards goto jump #72234 - coding guidelines: comply with MISRA C:2012 Rule 20.7 0861990
drivers: linker: added missing parenthesis #72346
drivers: added missing parenthesis #72886
include: arch: x86: added missing parenthesis #72938
include: kernel: added missing parenthesis #72941
include: logging: added missing parenthesis #73644
include: sys: added missing parenthesis #73668
include: toolchain: added missing parenthesis #73773
kernel: added missing parenthesis #73774
lib: added missing parenthesis #73775
arch: x86: added missing parenthesis #72877 - coding guidelines: comply with MISRA C:2012 Rule 8.8 aba70ce
- coding guidelines: comply with MISRA C:2012 Rule 13.3 671153b
arch: x86: avoided increments/decrements with side effects #72372
lib: avoided increments/decrements with side effects #72806
kernel: avoided increments/decrements with side effects #72739
lib: avoided increments/decrements with side effects #72806 - coding guidelines: partially comply with MISRA C:2012 Rule 11.8 f953e92
tests: Made pointer parameters explicitely const where non-const pointer parameters are not needed #72417
kernel: removed redundant casts #72413 - coding guidelines: partially comply with MISRA C:2012 Rule 7.4 829f63f
Formatting Output: avoided assignment of string literals to non-const char * #72660 - coding guidelines: partially comply with MISRA C:2012 essential types… d03fa8d
arch: coding guidelines: use bool param when data nature is boolean #72675
arch: avoid mixing types #73077 - coding guidelines: partially comply with MISRA C:2012 Rule 20.7 3c1d1a1
arch: coding guidelines: use bool param when data nature is boolean #72675
drivers: added missing parenthesis #72886
arch: x86: added missing parenthesis #72877
include: arch: x86: added missing parenthesis #72938
include: sys: added missing parenthesis #73668
include: toolchain: added missing parenthesis #73773
kernel: added missing parenthesis #73774
lib: added missing parenthesis #73775
include: kernel: added missing parenthesis #72941
include: logging: added missing parenthesis #73644 - coding guidelines: partially comply with MISRA C:2012 Rule 10.2 63afaf7
lib: libc: make char subtractions compliant with coding guidelines #73778 - coding guidelines: partially comply with MISRA C:2012 Rule 10.5 7eadb9c
kernel: avoid Boolean-to-integer type casts #73782
lib: utils: avoid Boolean-to-integer type casts #73784 - coding guidelines: partially comply with MISRA C:2012 Rule 14.4 5d02614
lib: change controlling expressions in if/while to Boolean #73929
net: change controlling expressions in while to Boolean #73933
shell: change controlling expressions in while to Boolean #73934
testsuite: change controlling expressions in while to Boolean #73935
tracing: change controlling expressions in while to Boolean #73936
Bluetooth: Controller: Change condition in while to Boolean #73937 - coding guidelines: comply with MISRA C:2012 Rule 9.3 b652fae
- coding guidelines: comply with MISRA C:2012 Rule 4.1 c87097c
- coding guidelines: comply with MISRA C:2012 Rule 8.2 f3c9c0a
- coding guidelines: comply with MISRA C:2012 Rule 21.13 835451e
- coding guidelines: comply with MISRA C:2012 Rule 7.2 f6ce289
Suggestions
- Remove MISRA violation fixes from tests and test code to prevent confusion.
- Remove MISRA violation fixes from sample code
- Divide big commits into smaller logical ones
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
In Progress