]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitce566407e81753400527c81a4d9017a1b6bba197
treea2a06ddee8ec85184793b0a9ba1b80513e4ac420
parent6d6fd90603631dc182c6fe5fe5986dfcf1dad8d3
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