net: tcp: switch to new API for k_work_pending

Uses of k_work_pending are to be replaced by k_work_is_pending which
conforms to current proposed naming guidelines.

Both uses in this file are fragile: that a work item is pending does
not mean changes since it was first submitted are guaranteed to be
seen when the work item begins (began) executing.

As long as this module is expected to be replaced by tcp2 it doesn't
seem worth trying to fix the logic, so just switch to the new function
name.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
Peter Bigot 2021-03-04 12:18:00 -06:00 committed by Anas Nashif
commit e373004135

View file

@ -234,7 +234,7 @@ static void tcp_retry_expired(struct k_work *work)
pkt = CONTAINER_OF(sys_slist_peek_head(&tcp->sent_list), pkt = CONTAINER_OF(sys_slist_peek_head(&tcp->sent_list),
struct net_pkt, sent_list); struct net_pkt, sent_list);
if (k_work_pending(net_pkt_work(pkt))) { if (k_work_is_pending(net_pkt_work(pkt))) {
/* If the packet is still pending in TX queue, then do /* If the packet is still pending in TX queue, then do
* not try to resend it again. This can happen if the * not try to resend it again. This can happen if the
* device is so busy that the TX thread has not yet * device is so busy that the TX thread has not yet
@ -391,7 +391,7 @@ int net_tcp_release(struct net_tcp *tcp)
* it go as it will be released by L2 after it is * it go as it will be released by L2 after it is
* sent. * sent.
*/ */
if (k_work_pending(net_pkt_work(pkt)) || if (k_work_is_pending(net_pkt_work(pkt)) ||
net_pkt_sent(pkt)) { net_pkt_sent(pkt)) {
refcount--; refcount--;
} }