]> git.baikalelectronics.ru Git - kernel.git/commit
net: ipa: rework last transaction determination
authorAlex Elder <elder@linaro.org>
Fri, 2 Sep 2022 21:02:13 +0000 (16:02 -0500)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Sep 2022 11:47:01 +0000 (12:47 +0100)
commite1059c33cb10e2ca801d463aef9af9bbd5d5c1eb
treef575eb1f75ac9e96e986ab188a729bc6d3df793e
parenteadb89e3d90f6cdddc05ddb9c5ab44742705a075
net: ipa: rework last transaction determination

When quiescing a channel, we find the "last" transaction, which is
the latest one to have been allocated.  (New transaction allocation
will have been prevented by the time this is called.)

Currently we do this by looking for the first non-empty transaction
list in each state, then return the last entry from that last.
Instead, determine the last entry in each list (if any) and return
that entry if found.

Temporarily (locally) introduce list_last_entry_or_null() as a
helper for this, mirroring list_first_entry_or_null().  This macro
definition will be removed by an upcoming patch.

Remove the temporary warnings added by the previous commit.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipa/gsi.c
drivers/net/ipa/gsi_private.h
drivers/net/ipa/gsi_trans.c