aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2008-06-30 01:34:12 -0700
committerLuis R. Rodriguez <lrodriguez@atheros.com>2008-06-30 01:34:12 -0700
commitfbc55b8bc132fd8dd88a30fe176c210eb25593e1 (patch)
tree9a29e1186473bf9d1bdf97901e9ea1e118480bb5
parent1f35f3caf8585801860992d8556a46fd1c2ae815 (diff)
downloadcompat-wireless-2.6-old-fbc55b8bc132fd8dd88a30fe176c210eb25593e1.tar.gz
Add list_is_singular() to compat.h for older kernels.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
-rw-r--r--compat/compat.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/compat/compat.h b/compat/compat.h
index 8a23e35..e47e0ec 100644
--- a/compat/compat.h
+++ b/compat/compat.h
@@ -476,6 +476,17 @@ static inline void led_classdev_unregister_suspended(struct led_classdev *lcd)
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
+/* This is from include/linux/list.h */
+
+/**
+ * list_is_singular - tests whether a list has just one entry.
+ * @head: the list to test.
+ */
+static inline int list_is_singular(const struct list_head *head)
+{
+ return !list_empty(head) && (head->next == head->prev);
+}
+
/* This is from include/linux/rfkill.h */
#define RFKILL_STATE_SOFT_BLOCKED RFKILL_STATE_OFF
#define RFKILL_STATE_UNBLOCKED RFKILL_STATE_ON