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)
commit2fbdf45d7d26361a0c3ec8833fd96edf0f5812da
tree656bac038c34f0ba955ddb466d39d32cc0a9acde
parentc908565eecf2d310edddaecea6166015abe9df08
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