netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] checksum: remove duplicated line of code in csum_fold
@ 2013-02-12 17:10 pablo
  2013-02-12 17:12 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: pablo @ 2013-02-12 17:10 UTC (permalink / raw)
  To: netdev; +Cc: davem, Arnd Bergmann

From: Pablo Neira Ayuso <pablo@netfilter.org>

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 include/asm-generic/checksum.h |    1 -
 1 file changed, 1 deletion(-)

diff --git a/include/asm-generic/checksum.h b/include/asm-generic/checksum.h
index c084767..f68b2ea 100644
--- a/include/asm-generic/checksum.h
+++ b/include/asm-generic/checksum.h
@@ -51,7 +51,6 @@ static inline __sum16 csum_fold(__wsum csum)
 {
 	u32 sum = (__force u32)csum;
 	sum = (sum & 0xffff) + (sum >> 16);
-	sum = (sum & 0xffff) + (sum >> 16);
 	return (__force __sum16)~sum;
 }
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] checksum: remove duplicated line of code in csum_fold
  2013-02-12 17:10 [PATCH] checksum: remove duplicated line of code in csum_fold pablo
@ 2013-02-12 17:12 ` David Miller
  2013-02-12 17:41   ` Pablo Neira Ayuso
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2013-02-12 17:12 UTC (permalink / raw)
  To: pablo; +Cc: netdev, arnd

From: pablo@netfilter.org
Date: Tue, 12 Feb 2013 18:10:03 +0100

> From: Pablo Neira Ayuso <pablo@netfilter.org>
> 
> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

I am very sure that those two lines are there intentionally.
The first addition one can overflow, therefore we need to
fold again (which cannot overflow).

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] checksum: remove duplicated line of code in csum_fold
  2013-02-12 17:12 ` David Miller
@ 2013-02-12 17:41   ` Pablo Neira Ayuso
  0 siblings, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2013-02-12 17:41 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, arnd

On Tue, Feb 12, 2013 at 12:12:35PM -0500, David Miller wrote:
> From: pablo@netfilter.org
> Date: Tue, 12 Feb 2013 18:10:03 +0100
> 
> > From: Pablo Neira Ayuso <pablo@netfilter.org>
> > 
> > Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
> 
> I am very sure that those two lines are there intentionally.
> The first addition one can overflow, therefore we need to
> fold again (which cannot overflow).

I was missing that, make sense indeed, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-02-12 17:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-12 17:10 [PATCH] checksum: remove duplicated line of code in csum_fold pablo
2013-02-12 17:12 ` David Miller
2013-02-12 17:41   ` Pablo Neira Ayuso

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