From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: netdev@vger.kernel.org
Cc: linux-sctp@vger.kernel.org, Vlad Yasevich <vyasevich@gmail.com>,
Neil Horman <nhorman@tuxdriver.com>
Subject: [PATCH RESEND net-next 5/5] sctp: sctp_chunk_length_valid should return bool
Date: Wed, 28 Dec 2016 09:26:35 -0200 [thread overview]
Message-ID: <11191de6d1bbf1548f1dc7aa1d1eb0ff469e6998.1482924092.git.marcelo.leitner@gmail.com> (raw)
In-Reply-To: <cover.1482924092.git.marcelo.leitner@gmail.com>
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
---
net/sctp/sm_statefuns.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 9a223d5b2314ff166be0446462c33219b7eec1b9..3382ef254e7b41ae4723f2e72e5aca30d46a4a8e 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -160,23 +160,22 @@ static sctp_disposition_t __sctp_sf_do_9_1_abort(struct net *net,
/* Small helper function that checks if the chunk length
* is of the appropriate length. The 'required_length' argument
* is set to be the size of a specific chunk we are testing.
- * Return Values: 1 = Valid length
- * 0 = Invalid length
+ * Return Values: true = Valid length
+ * false = Invalid length
*
*/
-static inline int
-sctp_chunk_length_valid(struct sctp_chunk *chunk,
- __u16 required_length)
+static inline bool
+sctp_chunk_length_valid(struct sctp_chunk *chunk, __u16 required_length)
{
__u16 chunk_length = ntohs(chunk->chunk_hdr->length);
/* Previously already marked? */
if (unlikely(chunk->pdiscard))
- return 0;
+ return false;
if (unlikely(chunk_length < required_length))
- return 0;
+ return false;
- return 1;
+ return true;
}
/**********************************************************
--
2.9.3
next prev parent reply other threads:[~2016-12-28 11:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-28 11:26 [PATCH RESEND net-next 0/5] SCTP cleanups Marcelo Ricardo Leitner
2016-12-28 11:26 ` [PATCH RESEND net-next 1/5] sctp: reduce indent level at sctp_sf_tabort_8_4_8 Marcelo Ricardo Leitner
2016-12-28 11:26 ` [PATCH RESEND net-next 2/5] sctp: reduce indent level in sctp_sf_shut_8_4_5 Marcelo Ricardo Leitner
2016-12-28 11:26 ` [PATCH RESEND net-next 3/5] sctp: simplify addr copy Marcelo Ricardo Leitner
2016-12-28 11:26 ` [PATCH RESEND net-next 4/5] sctp: remove return value from sctp_packet_init/config Marcelo Ricardo Leitner
2016-12-28 11:26 ` Marcelo Ricardo Leitner [this message]
2016-12-28 19:08 ` [PATCH RESEND net-next 0/5] SCTP cleanups David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11191de6d1bbf1548f1dc7aa1d1eb0ff469e6998.1482924092.git.marcelo.leitner@gmail.com \
--to=marcelo.leitner@gmail.com \
--cc=linux-sctp@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=vyasevich@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).