sctp: refactor sctp_datamsg_from_user
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Thu, 29 Dec 2016 17:53:28 +0000 (15:53 -0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 29 Dec 2016 19:44:03 +0000 (14:44 -0500)
commitbfd2e4b8734d34632f00391994b89c558dcb7d4e
treea2a06ddee8ec85184793b0a9ba1b80513e4ac420
parent5e4585315b0eb3876f16e85217e9380f37f0dd2c
sctp: refactor sctp_datamsg_from_user

This patch refactors sctp_datamsg_from_user() in an attempt to make it
better to read and avoid code duplication for handling the last
fragment.

It also avoids doing division and remaining operations. Even though, it
should still operate similarly as before this patch.

Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/chunk.c