diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-05-13 16:23:16 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-05-13 16:23:16 +0000 |
commit | 503e73fbee0d8318cc8dd60c89d93e35d4e84306 (patch) | |
tree | 2f5fadc825990610faa548c32ab62efbc79c7ca1 | |
parent | 28fd88d1aaa49064e71d13237580854026b48000 (diff) |
add idr_is_empty()
-rw-r--r-- | sys/dev/pci/drm/include/linux/idr.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/include/linux/idr.h b/sys/dev/pci/drm/include/linux/idr.h index cebbad8a3f9..501a89577fa 100644 --- a/sys/dev/pci/drm/include/linux/idr.h +++ b/sys/dev/pci/drm/include/linux/idr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: idr.h,v 1.1 2019/04/14 10:14:53 jsg Exp $ */ +/* $OpenBSD: idr.h,v 1.2 2019/05/13 16:23:15 jsg Exp $ */ /* * Copyright (c) 2016 Mark Kettenis * @@ -45,6 +45,11 @@ void *idr_get_next(struct idr *, int *); #define idr_for_each_entry(idp, entry, id) \ for (id = 0; ((entry) = idr_get_next(idp, &(id))) != NULL; id++) +static inline bool +idr_is_empty(const struct idr *idr) +{ + return SPLAY_EMPTY(&idr->tree); +} struct ida { int counter; |