Skip to content

list: introduce list_next/prev_entry

Oleg Nesterov lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4list: introduce list_next_entry() and list_prev_entry()drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c include/linux/list.h kernel/events/core.c+16 -60 replies
2/4list: change list_for_each_entry*() to use list_*_entry()include/linux/list.h+22 -220 replies
3/4list: introduce list_last_entry(), use list_{first,last}_entry()include/linux/list.h+15 -40 replies
4/4debugfs: use list_next_entry() in debugfs_remove_recursive()fs/debugfs/inode.c+1 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] list: introduce list_next/prev_entry

Hello.

Not sure who maintains list.h, hopefully this is -mm material.

It is really annoying that we do not have list_next/prev_entry, they can have a lot of users, including list.h itself.

And in fact list_next_entry() is already defined in events/core.c and bnx2x_sp.c, this proves that it is really handy. That is why 1/4 comes as a separate patch because it touches the code outside of list.h.

3/4 is minor, but I think makes sense anyway.

4/4 is just the random example of usage outside of list.h, list_entry(child->d_u.d_child.next, struct dentry, d_u.d_child) is hardly readable.

None of this patches changes the compiled code.

Oleg.

 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c |    3 -
 fs/debugfs/inode.c                             |    3 +-
 include/linux/list.h                           |   79 ++++++++++++++++--------
 kernel/events/core.c                           |    3 -
 4 files changed, 54 insertions(+), 34 deletions(-)