diff mbox

dccp: use roundup instead of opencoding

Message ID Pine.LNX.4.64.0812052342180.3726@wrl-59.cs.helsinki.fi
State Superseded, archived
Delegated to: David Miller
Headers show

Commit Message

Ilpo Järvinen Dec. 5, 2008, 9:43 p.m. UTC
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
 net/dccp/output.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Ben Hutchings Dec. 5, 2008, 9:47 p.m. UTC | #1
On Fri, 2008-12-05 at 23:43 +0200, Ilpo Järvinen wrote:
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
> ---
>  net/dccp/output.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/net/dccp/output.c b/net/dccp/output.c
> index fea30cd..1b75ece 100644
> --- a/net/dccp/output.c
> +++ b/net/dccp/output.c
> @@ -175,7 +175,7 @@ unsigned int dccp_sync_mss(struct sock *sk, u32 pmtu)
>  	 * make it a multiple of 4
>  	 */
>  
> -	cur_mps -= ((5 + 6 + 10 + 6 + 6 + 6 + 3) / 4) * 4;
> +	cur_mps -= roundup(5 + 6 + 10 + 6 + 6 + 6);

Maybe you should check that with your compiler.

Ben.

>  	/* And store cached results */
>  	icsk->icsk_pmtu_cookie = pmtu;
> -- 
> 1.5.2.2
diff mbox

Patch

diff --git a/net/dccp/output.c b/net/dccp/output.c
index fea30cd..1b75ece 100644
--- a/net/dccp/output.c
+++ b/net/dccp/output.c
@@ -175,7 +175,7 @@  unsigned int dccp_sync_mss(struct sock *sk, u32 pmtu)
 	 * make it a multiple of 4
 	 */
 
-	cur_mps -= ((5 + 6 + 10 + 6 + 6 + 6 + 3) / 4) * 4;
+	cur_mps -= roundup(5 + 6 + 10 + 6 + 6 + 6);
 
 	/* And store cached results */
 	icsk->icsk_pmtu_cookie = pmtu;