Skip to content

Commit e373004

Browse files
pabigotnashif
authored andcommitted
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 <[email protected]>
1 parent 4817a41 commit e373004

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/net/ip/tcp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ static void tcp_retry_expired(struct k_work *work)
234234
pkt = CONTAINER_OF(sys_slist_peek_head(&tcp->sent_list),
235235
struct net_pkt, sent_list);
236236

237-
if (k_work_pending(net_pkt_work(pkt))) {
237+
if (k_work_is_pending(net_pkt_work(pkt))) {
238238
/* If the packet is still pending in TX queue, then do
239239
* not try to resend it again. This can happen if the
240240
* device is so busy that the TX thread has not yet
@@ -391,7 +391,7 @@ int net_tcp_release(struct net_tcp *tcp)
391391
* it go as it will be released by L2 after it is
392392
* sent.
393393
*/
394-
if (k_work_pending(net_pkt_work(pkt)) ||
394+
if (k_work_is_pending(net_pkt_work(pkt)) ||
395395
net_pkt_sent(pkt)) {
396396
refcount--;
397397
}

0 commit comments

Comments
 (0)