From nobody Fri Jul 4 23:16:28 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1515036064097564.917152089613; Wed, 3 Jan 2018 19:21:04 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 88F3E222D1540; Wed, 3 Jan 2018 19:15:57 -0800 (PST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 71294222A54F4 for ; Wed, 3 Jan 2018 19:15:56 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jan 2018 19:20:28 -0800 Received: from fanwang2-hp.ccr.corp.intel.com ([10.239.9.33]) by orsmga001.jf.intel.com with ESMTP; 03 Jan 2018 19:20:27 -0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=fan.wang@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,505,1508828400"; d="scan'208";a="21245835" From: fanwang2 To: edk2-devel@lists.01.org Date: Thu, 4 Jan 2018 11:20:07 +0800 Message-Id: <1515036008-10700-4-git-send-email-fan.wang@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1515036008-10700-1-git-send-email-fan.wang@intel.com> References: <1515036008-10700-1-git-send-email-fan.wang@intel.com> Subject: [edk2] [Patch 3/4] NetworkPkg: Fix some coding style issues in UDP6 driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ye Ting , Wang Fan , Fu Siyuan , Jiaxin Wu MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Wang Fan In UDP6Dxe, there are some coding style issues, this patch is to fix these issues. Cc: Ye Ting Cc: Jiaxin Wu Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wang Fan --- NetworkPkg/Udp6Dxe/Udp6Driver.c | 20 ++++++++++---------- NetworkPkg/Udp6Dxe/Udp6Impl.c | 10 ++++++---- NetworkPkg/Udp6Dxe/Udp6Main.c | 2 +- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/NetworkPkg/Udp6Dxe/Udp6Driver.c b/NetworkPkg/Udp6Dxe/Udp6Drive= r.c index a4b1104..6dde1fc 100644 --- a/NetworkPkg/Udp6Dxe/Udp6Driver.c +++ b/NetworkPkg/Udp6Dxe/Udp6Driver.c @@ -1,9 +1,9 @@ /** @file Driver Binding functions and Service Binding functions for the Network d= river module. =20 - Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
=20 This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at http://opensource.org/licenses/bsd-license.php. @@ -162,11 +162,10 @@ Udp6DriverBindingStart ( &Udp6Service->ServiceBinding, NULL ); if (EFI_ERROR (Status)) { Udp6CleanService (Udp6Service); - goto EXIT; } =20 EXIT: if (EFI_ERROR (Status)) { if (Udp6Service !=3D NULL) { @@ -180,12 +179,13 @@ EXIT: Callback function which provided by user to remove one node in NetDestro= yLinkList process. =20 @param[in] Entry The entry to be removed. @param[in] Context Pointer to the callback context correspond= s to the Context in NetDestroyLinkList. =20 - @retval EFI_SUCCESS The entry has been removed successfully. - @retval Others Fail to remove the entry. + @retval EFI_INVALID_PARAMETER Entry is NULL or Context is NULL. + @retval EFI_SUCCESS The entry has been removed successfully. + @retval Others Fail to remove the entry. =20 **/ EFI_STATUS EFIAPI Udp6DestroyChildEntryInHandleBuffer ( @@ -241,16 +241,16 @@ Udp6DriverBindingStop ( IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer OPTIONAL ) { - EFI_STATUS Status; - EFI_HANDLE NicHandle; - EFI_SERVICE_BINDING_PROTOCOL *ServiceBinding; - UDP6_SERVICE_DATA *Udp6Service; - LIST_ENTRY *List; - UDP6_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT Context; + EFI_STATUS Status; + EFI_HANDLE NicHandle; + EFI_SERVICE_BINDING_PROTOCOL *ServiceBinding; + UDP6_SERVICE_DATA *Udp6Service; + LIST_ENTRY *List; + UDP6_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT Context; =20 // // Find the NicHandle where UDP6 ServiceBinding Protocol is installed. // NicHandle =3D NetLibGetNicHandle (ControllerHandle, &gEfiIp6ProtocolGuid= ); diff --git a/NetworkPkg/Udp6Dxe/Udp6Impl.c b/NetworkPkg/Udp6Dxe/Udp6Impl.c index 25d4e6a..458470c 100644 --- a/NetworkPkg/Udp6Dxe/Udp6Impl.c +++ b/NetworkPkg/Udp6Dxe/Udp6Impl.c @@ -156,11 +156,12 @@ Udp6RecycleRxDataWrap ( @param[in] Packet Pointer to the buffer containing the rece= ived datagram. @param[in] RxData Pointer to the EFI_UDP6_RECEIVE_DATA of t= his datagram. =20 - @return Pointer to the structure wrapping the RxData and the Packet. + @return Pointer to the structure wrapping the RxData and the Packet. NUL= L will + be returned if any error occurs. =20 **/ UDP6_RXDATA_WRAP * Udp6WrapRxData ( IN UDP6_INSTANCE_DATA *Instance, @@ -1372,11 +1373,12 @@ Udp6RecycleRxDataWrap ( @param[in] Packet Pointer to the buffer containing the rece= ived datagram. @param[in] RxData Pointer to the EFI_UDP6_RECEIVE_DATA of t= his datagram. =20 - @return Pointer to the structure wrapping the RxData and the Packet. + @return Pointer to the structure wrapping the RxData and the Packet. NUL= L will + be returned if any error occurs. =20 **/ UDP6_RXDATA_WRAP * Udp6WrapRxData ( IN UDP6_INSTANCE_DATA *Instance, @@ -1596,11 +1598,11 @@ Udp6Demultiplex ( UINT16 HeadSum; EFI_UDP6_RECEIVE_DATA RxData; EFI_UDP6_SESSION_DATA *Udp6Session; UINTN Enqueued; =20 - if (Packet->TotalSize < sizeof (EFI_UDP_HEADER)) { + if (Packet->TotalSize < UDP6_HEADER_SIZE) { NetbufFree (Packet); return; } =20 // @@ -1848,11 +1850,11 @@ Udp6IcmpHandler ( EFI_UDP_HEADER *Udp6Header; EFI_UDP6_SESSION_DATA Udp6Session; LIST_ENTRY *Entry; UDP6_INSTANCE_DATA *Instance; =20 - if (Packet->TotalSize < sizeof (EFI_UDP_HEADER)) { + if (Packet->TotalSize < UDP6_HEADER_SIZE) { NetbufFree (Packet); return; } =20 Udp6Header =3D (EFI_UDP_HEADER *) NetbufGetByte (Packet, 0, NULL); diff --git a/NetworkPkg/Udp6Dxe/Udp6Main.c b/NetworkPkg/Udp6Dxe/Udp6Main.c index 8495bc3..53145c3 100644 --- a/NetworkPkg/Udp6Dxe/Udp6Main.c +++ b/NetworkPkg/Udp6Dxe/Udp6Main.c @@ -583,11 +583,11 @@ Udp6Transmit ( Udp6Header->Checksum =3D Udp6Checksum (Packet, HeadSum); if (Udp6Header->Checksum =3D=3D 0) { // // If the calculated checksum is 0, fill the Checksum field with a= ll ones. // - Udp6Header->Checksum =3D 0XFFFF; + Udp6Header->Checksum =3D 0xffff; } } else { // // Set the checksum is zero if the ConfigData->StationAddress is uns= pcified // and the Ipv6 will fill the correct value of this checksum. --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel