<p>laforge <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/24801">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">linuxlist: add macro to get last element of a list<br><br>It is not be obvious on the first look that ->prev actually points to the last<br>element of a list, lets add a macro for that to make the API easier to use<br><br>Change-Id: Icf455bf6ba9d60bd311af17c9e80febaa42cacc9<br>Related: SYS#4971<br>---<br>M include/osmocom/core/linuxlist.h<br>1 file changed, 6 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/core/linuxlist.h b/include/osmocom/core/linuxlist.h</span><br><span>index f28f88b..725c60c 100644</span><br><span>--- a/include/osmocom/core/linuxlist.h</span><br><span>+++ b/include/osmocom/core/linuxlist.h</span><br><span>@@ -238,6 +238,12 @@</span><br><span> #define llist_last_entry(ptr, type, member) \</span><br><span>       llist_entry((ptr)->prev, type, member)</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/*! Return the last element of the list.</span><br><span style="color: hsl(120, 100%, 40%);">+ *  \param head the llist head of the list.</span><br><span style="color: hsl(120, 100%, 40%);">+ *  \returns last element of the list, head if the list is empty.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+#define llist_last(head) (head)->prev</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /*! Get the first element from a list, or NULL.</span><br><span>  *  \param ptr    the list head to take the element from.</span><br><span>  *  \param type   the type of the struct this is embedded in.</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/24801">change 24801</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/libosmocore/+/24801"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Icf455bf6ba9d60bd311af17c9e80febaa42cacc9 </div>
<div style="display:none"> Gerrit-Change-Number: 24801 </div>
<div style="display:none"> Gerrit-PatchSet: 5 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>