* [PATCH net-next] sctp: use list_is_singular in sctp_list_single_entry
@ 2020-06-28 9:32 ` Geliang Tang
0 siblings, 0 replies; 4+ messages in thread
From: Geliang Tang @ 2020-06-28 9:32 UTC (permalink / raw)
To: Vlad Yasevich, Neil Horman, Marcelo Ricardo Leitner,
David S. Miller, Jakub Kicinski
Cc: Geliang Tang, linux-sctp, netdev, linux-kernel
Use list_is_singular() instead of open-coding.
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
include/net/sctp/sctp.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index f8bcb75bb044..e3bd198b00ae 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -412,7 +412,7 @@ static inline void sctp_skb_set_owner_r(struct sk_buff *skb, struct sock *sk)
/* Tests if the list has one and only one entry. */
static inline int sctp_list_single_entry(struct list_head *head)
{
- return (head->next != head) && (head->next == head->prev);
+ return list_is_singular(head);
}
static inline bool sctp_chunk_pending(const struct sctp_chunk *chunk)
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net-next] sctp: use list_is_singular in sctp_list_single_entry
@ 2020-06-28 9:32 ` Geliang Tang
0 siblings, 0 replies; 4+ messages in thread
From: Geliang Tang @ 2020-06-28 9:32 UTC (permalink / raw)
To: Vlad Yasevich, Neil Horman, Marcelo Ricardo Leitner,
David S. Miller, Jakub Kicinski
Cc: Geliang Tang, linux-sctp, netdev, linux-kernel
Use list_is_singular() instead of open-coding.
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
include/net/sctp/sctp.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index f8bcb75bb044..e3bd198b00ae 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -412,7 +412,7 @@ static inline void sctp_skb_set_owner_r(struct sk_buff *skb, struct sock *sk)
/* Tests if the list has one and only one entry. */
static inline int sctp_list_single_entry(struct list_head *head)
{
- return (head->next != head) && (head->next = head->prev);
+ return list_is_singular(head);
}
static inline bool sctp_chunk_pending(const struct sctp_chunk *chunk)
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] sctp: use list_is_singular in sctp_list_single_entry
2020-06-28 9:32 ` Geliang Tang
@ 2020-06-29 4:46 ` David Miller
-1 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-06-29 4:46 UTC (permalink / raw)
To: geliangtang
Cc: vyasevich, nhorman, marcelo.leitner, kuba, linux-sctp, netdev,
linux-kernel
From: Geliang Tang <geliangtang@gmail.com>
Date: Sun, 28 Jun 2020 17:32:25 +0800
> Use list_is_singular() instead of open-coding.
>
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] sctp: use list_is_singular in sctp_list_single_entry
@ 2020-06-29 4:46 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-06-29 4:46 UTC (permalink / raw)
To: geliangtang
Cc: vyasevich, nhorman, marcelo.leitner, kuba, linux-sctp, netdev,
linux-kernel
From: Geliang Tang <geliangtang@gmail.com>
Date: Sun, 28 Jun 2020 17:32:25 +0800
> Use list_is_singular() instead of open-coding.
>
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-06-29 20:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-28 9:32 [PATCH net-next] sctp: use list_is_singular in sctp_list_single_entry Geliang Tang
2020-06-28 9:32 ` Geliang Tang
2020-06-29 4:46 ` David Miller
2020-06-29 4:46 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.