From 49b0a152b5ee56337535345f5acfe1ec96419d2d Mon Sep 17 00:00:00 2001 From: Edayilliam Jayadev Date: Sun, 22 Jan 2023 11:39:59 +0530 Subject: [PATCH] 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 --- qdf/inc/qdf_list.h | 4 ++++ qdf/linux/src/i_qdf_list.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/qdf/inc/qdf_list.h b/qdf/inc/qdf_list.h index 9662820b2e..0a47a97963 100644 --- a/qdf/inc/qdf_list.h +++ b/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 diff --git a/qdf/linux/src/i_qdf_list.h b/qdf/linux/src/i_qdf_list.h index ae24726dcf..b1d85a6646 100644 --- a/qdf/linux/src/i_qdf_list.h +++ b/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