Commit graph

7 commits

Author SHA1 Message Date
frei tycho d5ff0cc820 include: sys: added missing parenthesis
- added missing parenthesis around macro argument expansion

Signed-off-by: frei tycho <tfrei@baumer.com>
2024-06-14 18:50:33 -04:00
Hess Nathan 1fb5cd6462 coding guidelines: comply with MISRA Rule 12.1.
-added parentheses verifying lack of ambiguities

Signed-off-by: Hess Nathan <nhess@baumer.com>
2024-05-12 13:37:54 -04:00
Gaetan Perrot 8336d8b1e1 kernel: api: sys_slist find zephyrproject-rtos#65973
add a function to find a node in a slist.

signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2024-03-12 13:46:29 -04:00
J M dbb786dae1 sys: lists: Add list functions to compute list length
This commit adds functions to slist, sflist, and dlist to return the
length of provided lists, which will allow future commits to refactor
code that implements this manually.

The new functions all take a reference to any node in the list and compute
the length of the entire list. If the list is empty, they return 0.

Signed-off-by: J M <montytyper@msn.com>
2023-09-13 16:19:33 +02:00
Gerard Marull-Paretas fb9b3bcd93 include: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all includes within
include directory to the new prefix <zephyr/...>. Note that the
conversion has been scripted, refer to zephyrproject-rtos#45388 for more
details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 20:03:00 +02:00
Piotr Pryga 4a18d615a4 slist: Fix sys_slist_append_list with head and tail NULL break a list
If the sys_slist_t instance is not empty, its head and tail points to
some sys_snode_t instances. If sys_slist_append_list is executed with
tail being NULL the list object is corrupted. Tail of the sys_slist_t
instance is set to NULL. If one executes sys_slist_append on that node,
then nodes pointed by head are lost.

The commit fixes the issue and adds unit tests to verify correct
behavior.

Added change verifies if head and tail of appended list are not NULL.
In other case the list object is invalid and should not be appended
to a valid list instance.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-04-15 11:50:29 -07:00
Yuval Peress 53ef68d459 include: Prefix includes to use a scope
Move include paths and add new target_include_directories to support
backwards compatibility:
* /include -> /include/zephyr
  example: <irq.h> -> <zephyr/irq.h>

Issue #41543

Signed-off-by: Yuval Peress <peress@google.com>
2022-04-08 19:03:32 +02:00
Renamed from include/sys/list_gen.h (Browse further)