diff options
Diffstat (limited to 'ShellPkg/Library/UefiShellNetwork1CommandsLib')
3 files changed, 15 insertions, 23 deletions
diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c index d4326448f6..13d24969f8 100644 --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c @@ -20,7 +20,7 @@ BOOLEAN mIp4ConfigExist = FALSE;
STATIC EFI_HII_CONFIG_ROUTING_PROTOCOL *mHiiConfigRouting = NULL;
-STATIC CONST UINTN SEC_TO_NS = 10000000;
+STATIC CONST UINTN SecondsToNanoSeconds = 10000000;
STATIC CONST CHAR16 DhcpString[5] = L"DHCP";
STATIC CONST CHAR16 StaticString[7] = L"STATIC";
STATIC CONST CHAR16 PermanentString[10] = L"PERMANENT";
@@ -173,7 +173,7 @@ TestChildHandle ( Get the child handle of the NIC handle.
@param[in] Controller Routing information: GUID.
- @param[in] ChildHandle Returned child handle.
+ @param[out] ChildHandle Returned child handle.
@retval EFI_SUCCESS Successfully to get child handle.
**/
@@ -1128,7 +1128,7 @@ IfconfigStartIp4( Status = gBS->SetTimer (
TimerToGetMap,
TimerRelative,
- MultU64x32 (SEC_TO_NS, 5)
+ MultU64x32 (SecondsToNanoSeconds, 5)
);
if (EFI_ERROR (Status)) {
diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c index 7982f99c57..ab7658c45b 100644 --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c @@ -134,29 +134,21 @@ typedef struct _PING_PRIVATE_DATA { PING_IPX_COMPLETION_TOKEN RxToken;
} PING_PRIVATE_DATA;
+/**
+ Calculate the internet checksum (see RFC 1071).
+
+ @param[in] Packet Buffer which contains the data to be checksummed.
+ @param[in] Length Length to be checksummed.
+
+ @retval Checksum Returns the 16 bit ones complement of
+ ones complement sum of 16 bit words
+**/
UINT16
EFIAPI
NetChecksum (
IN UINT8 *Buffer,
IN UINT32 Length
)
-/*++
-
-Routine Description:
-
- Calculate the internet checksum (see RFC 1071)
-
-Arguments:
-
- Packet - Buffer which contains the data to be checksummed
- Length - Length to be checksummed
-
-Returns:
-
- Checksum - Returns the 16 bit ones complement of
- ones complement sum of 16 bit words
-
---*/
{
UINT32 Sum;
UINT8 Odd;
@@ -167,11 +159,11 @@ Returns: Sum = 0;
Odd = (UINT8) (Length & 1);
Length >>= 1;
- while (Length--) {
+ while ((Length--) != 0) {
Sum += *Packet++;
}
- if (Odd) {
+ if (Odd != 0) {
Sum += *(UINT8 *) Packet;
}
diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.h b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.h index 144063c615..1093479f83 100644 --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.h +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.h @@ -13,7 +13,7 @@ **/
-#if !defined (_UEFI_SHELL_NETWORK1_COMMANDS_LIB_H_)
+#ifndef _UEFI_SHELL_NETWORK1_COMMANDS_LIB_H_
#define _UEFI_SHELL_NETWORK1_COMMANDS_LIB_H_
#include <Uefi.h>
|