From: jsg Date: Wed, 31 Jan 2018 04:35:38 +0000 (+0000) Subject: add list_prev_entry() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a65c5f1e3ee5645780cdc24b90c15ceda93847ea;p=openbsd add list_prev_entry() --- diff --git a/sys/dev/pci/drm/drm_linux_list.h b/sys/dev/pci/drm/drm_linux_list.h index 7c5af7f707a..cbb3535d66d 100644 --- a/sys/dev/pci/drm/drm_linux_list.h +++ b/sys/dev/pci/drm/drm_linux_list.h @@ -1,4 +1,4 @@ -/* $OpenBSD: drm_linux_list.h,v 1.7 2017/07/01 16:14:10 kettenis Exp $ */ +/* $OpenBSD: drm_linux_list.h,v 1.8 2018/01/31 04:35:38 jsg Exp $ */ /* drm_linux_list.h -- linux list functions for the BSDs. * Created: Mon Apr 7 14:30:16 1999 by anholt@FreeBSD.org */ @@ -121,6 +121,9 @@ list_del_init(struct list_head *entry) { #define list_next_entry(pos, member) \ list_entry(((pos)->member.next), typeof(*(pos)), member) +#define list_prev_entry(pos, member) \ + list_entry(((pos)->member.prev), typeof(*(pos)), member) + #define list_for_each(entry, head) \ for (entry = (head)->next; entry != head; entry = (entry)->next)