public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH] fix comment in net.c
@ 2005-11-09 23:42 Ron Alder
  2005-11-09 23:49 ` Wolfgang Denk
  2005-11-10  7:56 ` Pantelis Antoniou
  0 siblings, 2 replies; 5+ messages in thread
From: Ron Alder @ 2005-11-09 23:42 UTC (permalink / raw)
  To: u-boot

This patch fixes a comment in net/net.c

CHANGELOG:
* Fix comment in net/net.c
  Patch by Ron Alder, 09 Nov 2005

-------------- next part --------------
A non-text attachment was scrubbed...
Name: netcomment.patch
Type: text/x-patch
Size: 362 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20051109/3f289339/attachment.bin 

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

* [U-Boot-Users] [PATCH] fix comment in net.c
  2005-11-09 23:42 [U-Boot-Users] [PATCH] fix comment in net.c Ron Alder
@ 2005-11-09 23:49 ` Wolfgang Denk
  2005-11-10  7:56 ` Pantelis Antoniou
  1 sibling, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2005-11-09 23:49 UTC (permalink / raw)
  To: u-boot

In message <4372896E.9080204@freescale.com> you wrote:
>
> This patch fixes a comment in net/net.c
> 
> CHANGELOG:
> * Fix comment in net/net.c
>   Patch by Ron Alder, 09 Nov 2005

Which problem are you trying to fix?

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Often it is fatal to live too long.                          - Racine

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

* [U-Boot-Users] [PATCH] fix comment in net.c
  2005-11-09 23:42 [U-Boot-Users] [PATCH] fix comment in net.c Ron Alder
  2005-11-09 23:49 ` Wolfgang Denk
@ 2005-11-10  7:56 ` Pantelis Antoniou
  2005-11-10 17:28   ` Tolunay Orkun
  1 sibling, 1 reply; 5+ messages in thread
From: Pantelis Antoniou @ 2005-11-10  7:56 UTC (permalink / raw)
  To: u-boot

Ron Alder wrote:
> This patch fixes a comment in net/net.c
> 
> CHANGELOG:
> * Fix comment in net/net.c
>  Patch by Ron Alder, 09 Nov 2005
> 
> 
> ------------------------------------------------------------------------
> 
> diff --git a/net/net.c b/net/net.c
> --- a/net/net.c
> +++ b/net/net.c
> @@ -829,7 +829,6 @@ static ushort CDP_compute_csum(const uch
>  		}
>  		if (len) {
>  			leftover = (signed short)(*(const signed char *)buff);
> -			/* * XXX CISCO SUCKS big time! (and blows too) */
>  			result = (result & 0xffff0000) | ((result + leftover) & 0x0000ffff);
>  		}
>  		while (result >> 16)

WTF is this? Politically correct day?

Since I wrote the comment in question let me elaborate.

CDP uses the ip checksum algorithm with a twist; for the last
byte it *sign* extends and sums. Obviously this is is completely
braindead, and warants the comment and much more :)

Regards

Pantelis

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

* [U-Boot-Users] [PATCH] fix comment in net.c
  2005-11-10  7:56 ` Pantelis Antoniou
@ 2005-11-10 17:28   ` Tolunay Orkun
  2005-11-10 19:59     ` Wolfgang Denk
  0 siblings, 1 reply; 5+ messages in thread
From: Tolunay Orkun @ 2005-11-10 17:28 UTC (permalink / raw)
  To: u-boot

Pantelis Antoniou wrote:
> Ron Alder wrote:
> 
>> This patch fixes a comment in net/net.c
>>
>> CHANGELOG:
>> * Fix comment in net/net.c
>>  Patch by Ron Alder, 09 Nov 2005
>>
>>
>> ------------------------------------------------------------------------
>>
>> diff --git a/net/net.c b/net/net.c
>> --- a/net/net.c
>> +++ b/net/net.c
>> @@ -829,7 +829,6 @@ static ushort CDP_compute_csum(const uch
>>          }
>>          if (len) {
>>              leftover = (signed short)(*(const signed char *)buff);
>> -            /* * XXX CISCO SUCKS big time! (and blows too) */
>>              result = (result & 0xffff0000) | ((result + leftover) & 
>> 0x0000ffff);
>>          }
>>          while (result >> 16)
> 
> 
> WTF is this? Politically correct day?
> 
> Since I wrote the comment in question let me elaborate.
> 
> CDP uses the ip checksum algorithm with a twist; for the last
> byte it *sign* extends and sums. Obviously this is is completely
> braindead, and warants the comment and much more :)
> 

Perhaps adding this explanation to the code would be much better to 
explain the existence of the code that follows the comment. Don't get me 
wrong, you can still keep the politically incorrect comment although I 
personally think "SUCKS" and "blows" are probably not very professional 
terms as well. I understand Ron's motivation for the patch in corporate 
environment sense.

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

* [U-Boot-Users] [PATCH] fix comment in net.c
  2005-11-10 17:28   ` Tolunay Orkun
@ 2005-11-10 19:59     ` Wolfgang Denk
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2005-11-10 19:59 UTC (permalink / raw)
  To: u-boot

In message <4373832D.6090306@orkun.us> you wrote:
>
> Perhaps adding this explanation to the code would be much better to 
> explain the existence of the code that follows the comment. Don't get me 
> wrong, you can still keep the politically incorrect comment although I 

To end this discussion: that's what I did. I  added  the  explanation
which  makes  the  code  easier  to understand, and left the original
comment in place.

Thanks.

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
In accord with UNIX philosophy, Perl gives you enough  rope  to  hang
yourself.              - L. Wall & R. L. Schwartz, _Programming Perl_

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

end of thread, other threads:[~2005-11-10 19:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-09 23:42 [U-Boot-Users] [PATCH] fix comment in net.c Ron Alder
2005-11-09 23:49 ` Wolfgang Denk
2005-11-10  7:56 ` Pantelis Antoniou
2005-11-10 17:28   ` Tolunay Orkun
2005-11-10 19:59     ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox