]> git.baikalelectronics.ru Git - kernel.git/commit
list: Add list_next_entry_circular() and list_prev_entry_circular()
authorRicardo Martinez <ricardo.martinez@linux.intel.com>
Fri, 6 May 2022 18:12:57 +0000 (11:12 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 9 May 2022 09:51:58 +0000 (10:51 +0100)
commit847ea4680333eda18e5f41e51e8a169b1c143ddc
tree656bac038c34f0ba955ddb466d39d32cc0a9acde
parent2218141be3d1ffbc712cf4b3606c0580dbb9c119
list: Add list_next_entry_circular() and list_prev_entry_circular()

Add macros to get the next or previous entries and wraparound if
needed. For example, calling list_next_entry_circular() on the last
element should return the first element in the list.

Signed-off-by: Ricardo Martinez <ricardo.martinez@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/list.h