From 18fc4f52a01bd53f1ac54ca09bdacbbbe25b8c7a Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sat, 31 May 2008 00:13:54 -0400 Subject: [PATCH] Define clear_list macro. Signed-off-by: Anders Kaseorg --- kmodsrc/modcommon.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kmodsrc/modcommon.h b/kmodsrc/modcommon.h index ea386ea..5d71184 100644 --- a/kmodsrc/modcommon.h +++ b/kmodsrc/modcommon.h @@ -100,4 +100,13 @@ struct reloc_addrmap *find_addrmap(long addr); void set_temp_myst_relocs(int status_val); void release_list(struct starts_with_next *p); +#define clear_list(head, type, member) \ + do { \ + struct list_head *_pos, *_n; \ + list_for_each_safe(_pos, _n, head) { \ + list_del(_pos); \ + kfree(list_entry(_pos, type, member)); \ + } \ + } while (0) + #include "modcommon.auto.h" -- 2.11.4.GIT