fix comment in net.c
PATCH 1/1 fix comment in net.c
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
PATCH 1/1 fix comment in net.c
Quoted 6 lines · In message <[email protected]> you wrote:
This patch fixes a comment in
net/net.cCHANGELOG:
* Fix comment innet/net.c
Patch by Ron Alder, 09 Nov 2005
Which problem are you trying to fix?
Best regards,
Wolfgang Denk
Signature · 3 lines
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
PATCH 1/1 fix comment in net.c
In reply to Ron AlderQuoted 13 lines · Ron Alder
This patch fixes a comment in
net/net.cCHANGELOG:
* Fix comment innet/net.c
Patch by Ron Alder, 09 Nov 2005------------------------------------------------------------------------
net/net.c static ushort CDP_compute_csum(const uch · line 834
Quoted 7 lines
net/net.c +0
-1@@ -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
PATCH 1/1 fix comment in net.c
Quoted 27 lines · Pantelis Antoniou
Quoted 20 lines · Ron Alder
This patch fixes a comment in
net/net.cCHANGELOG:
* Fix comment innet/net.c
Patch by Ron Alder, 09 Nov 2005------------------------------------------------------------------------
net/net.c +0
-1@@ -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 ); }Quoted 1 line
while (result >> 16)WTF is this? Politically correct day?
Quoted 6 lines
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.
PATCH 1/1 fix comment in net.c
Quoted 4 lines · In message <[email protected]> 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
Signature · 4 lines
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_