Răsfoiți Sursa

qcacmn: Add API to get last entry of linked list

Add API to get last entry of linked list.

CRs-Fixed: 3386125
Change-Id: Id956f3976f4c7651ef367e44c1c430f6eea8d2f9
Edayilliam Jayadev 2 ani în urmă
părinte
comite
49b0a152b5
2 a modificat fișierele cu 8 adăugiri și 0 ștergeri
  1. 4 0
      qdf/inc/qdf_list.h
  2. 4 0
      qdf/linux/src/i_qdf_list.h

+ 4 - 0
qdf/inc/qdf_list.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2014-2018, 2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -110,6 +111,9 @@ static inline void qdf_list_create(__qdf_list_t *list, uint32_t max_size)
 #define qdf_list_first_entry_or_null(list_ptr, type, node_field) \
 	__qdf_list_first_entry_or_null(list_ptr, type, node_field)
 
+#define qdf_list_last_entry(list_ptr, type, node_field) \
+	__qdf_list_last_entry(list_ptr, type, node_field)
+
 /**
  * qdf_init_list_head() - initialize list head
  * @list_head: pointer to list head

+ 4 - 0
qdf/linux/src/i_qdf_list.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2014-2016, 2018, 2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -100,6 +101,9 @@ static inline uint32_t __qdf_list_max_size(__qdf_list_t *list)
 #define  __qdf_list_first_entry_or_null(list_ptr, type, node_field) \
 	list_first_entry_or_null(&(list_ptr)->anchor, type, node_field)
 
+#define  __qdf_list_last_entry(list_ptr, type, node_field) \
+	list_last_entry(&(list_ptr)->anchor, type, node_field)
+
 /**
  * __qdf_init_list_head() - initialize list head
  * @list_head: pointer to list head