]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
add comments to function declarations and definitions and updated to match coding...
[mirror_edk2.git] / ShellPkg / Library / UefiShellNetwork1CommandsLib / Ping.c
index 7982f99c579cb05b22e5c3299f81a0f79515ed47..ab7658c45bbc0cacd5401139b36002a9771a28cc 100644 (file)
@@ -134,29 +134,21 @@ typedef struct _PING_PRIVATE_DATA {
   PING_IPX_COMPLETION_TOKEN   RxToken;\r
 } PING_PRIVATE_DATA;\r
 \r
+/**\r
+  Calculate the internet checksum (see RFC 1071).\r
+\r
+  @param[in] Packet  Buffer which contains the data to be checksummed.\r
+  @param[in] Length  Length to be checksummed.\r
+\r
+  @retval Checksum     Returns the 16 bit ones complement of \r
+                       ones complement sum of 16 bit words\r
+**/\r
 UINT16\r
 EFIAPI\r
 NetChecksum (\r
   IN UINT8   *Buffer,\r
   IN UINT32  Length\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Calculate the internet checksum (see RFC 1071)\r
-\r
-Arguments:\r
-\r
-  Packet             - Buffer which contains the data to be checksummed\r
-  Length             - Length to be checksummed\r
-\r
-Returns:\r
-\r
-  Checksum           - Returns the 16 bit ones complement of \r
-                       ones complement sum of 16 bit words\r
-\r
---*/\r
 {\r
   UINT32  Sum;\r
   UINT8   Odd;\r
@@ -167,11 +159,11 @@ Returns:
   Sum     = 0;\r
   Odd     = (UINT8) (Length & 1);\r
   Length >>= 1;\r
-  while (Length--) {\r
+  while ((Length--) != 0) {\r
     Sum += *Packet++;\r
   }\r
 \r
-  if (Odd) {\r
+  if (Odd != 0) {\r
     Sum += *(UINT8 *) Packet;\r
   }\r
 \r