Files
kernel_nothing_sm7325/include/linux
Andy Shevchenko 7d81fcc203 include/linux/list.h: add a macro to test if entry is pointing to the head
commit e130816164e244b692921de49771eeb28205152d upstream.

Add a macro to test if entry is pointing to the head of the list which is
useful in cases like:

  list_for_each_entry(pos, &head, member) {
    if (cond)
      break;
  }
  if (list_entry_is_head(pos, &head, member))
    return -ERRNO;

that allows to avoid additional variable to be added to track if loop has
not been stopped in the middle.

While here, convert list_for_each_entry*() family of macros to use a new one.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lkml.kernel.org/r/20200929134342.51489-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-22 12:26:20 +02:00
..
2019-08-09 09:15:05 +02:00
2019-09-17 10:27:46 -07:00
2020-02-19 19:53:09 +01:00
2019-08-20 22:09:52 +02:00
2019-08-28 21:17:12 -06:00
2021-01-23 15:57:55 +01:00
2021-01-30 13:54:11 +01:00
2020-03-25 08:25:58 +01:00
2019-09-05 11:40:54 +02:00
2019-10-02 06:36:50 -07:00
2019-07-05 21:34:50 +02:00
2021-05-19 10:08:30 +02:00
2019-09-07 04:28:05 -03:00
2019-12-13 08:42:53 +01:00
2021-03-04 10:26:29 +01:00
2021-02-07 15:35:49 +01:00
2019-09-05 12:32:05 +02:00
2019-12-13 08:43:18 +01:00
2021-06-30 08:47:51 -04:00
2020-07-29 10:18:36 +02:00
2019-08-14 15:30:35 +02:00
2021-09-03 10:08:12 +02:00
2019-07-16 19:23:25 -07:00
2020-03-18 07:17:46 +01:00
2019-08-01 21:49:46 +02:00
2019-07-31 19:03:35 +02:00
2020-04-17 10:50:12 +02:00
2020-04-02 15:11:00 +02:00
2021-03-07 12:20:49 +01:00
2019-09-07 21:42:25 +02:00
2019-08-01 20:51:22 +02:00
2019-07-31 19:03:35 +02:00
2020-12-11 13:23:28 +01:00
2021-08-26 08:36:16 -04:00
2020-04-02 15:11:00 +02:00
2021-06-10 13:37:14 +02:00