diff mbox

dccp: use roundup instead of opencoding

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

Commit Message

Ilpo Järvinen Dec. 5, 2008, 9:53 p.m. UTC
On Fri, 5 Dec 2008, Ben Hutchings wrote:

> 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.

Ah, sorry, I thought I'd made plenty of builds but sadly dccp wasn't 
included in any of them... Thanks for the alert. Added the missing , 4 
below.

Comments

David Miller Dec. 6, 2008, 6:40 a.m. UTC | #1
From: "Ilpo Järvinen" <ilpo.jarvinen@helsinki.fi>
Date: Fri, 5 Dec 2008 23:53:41 +0200 (EET)

> [PATCH] dccp: use roundup instead of opencoding
> 
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>

Applied to net-next-2.6, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
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, 4);
 
 	/* And store cached results */
 	icsk->icsk_pmtu_cookie = pmtu;