From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 6A32E211B736F for ; Mon, 14 Jan 2019 17:26:21 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jan 2019 17:26:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,479,1539673200"; d="scan'208";a="108265575" Received: from jiaxinwu-mobl.ccr.corp.intel.com ([10.239.193.52]) by orsmga006.jf.intel.com with ESMTP; 14 Jan 2019 17:26:20 -0800 From: Jiaxin Wu To: edk2-devel@lists.01.org Cc: Ye Ting , Fu Siyuan , Wu Jiaxin Date: Tue, 15 Jan 2019 09:26:13 +0800 Message-Id: <20190115012613.16748-3-Jiaxin.wu@intel.com> X-Mailer: git-send-email 2.17.1.windows.2 In-Reply-To: <20190115012613.16748-1-Jiaxin.wu@intel.com> References: <20190115012613.16748-1-Jiaxin.wu@intel.com> Subject: [PATCH v1 2/2] MdeModulePkg/Dhcp4Dxe: Use NET_LIST_FOR_EACH instead of NET_LIST_FOR_EACH_SAFE. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jan 2019 01:26:21 -0000 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1456 NET_LIST_FOR_EACH_SAFE is defined to iterate through the double linked list in delete-safe way. It's unnecessary to use this macro if list entries won't be deleted. Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Wu Jiaxin --- MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c index 98a22a77b4..47a9db6489 100644 --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Io.c @@ -1493,15 +1493,15 @@ DhcpOnTimerTick ( IN EFI_EVENT Event, IN VOID *Context ) { LIST_ENTRY *Entry; - LIST_ENTRY *Next; DHCP_SERVICE *DhcpSb; DHCP_PROTOCOL *Instance; EFI_STATUS Status; + Entry = NULL; DhcpSb = (DHCP_SERVICE *) Context; Instance = DhcpSb->ActiveChild; // // 0xffff is the maximum supported value for elapsed time according to RFC. @@ -1644,11 +1644,11 @@ DhcpOnTimerTick ( ON_EXIT: // // Iterate through all the DhcpSb Children. // - NET_LIST_FOR_EACH_SAFE (Entry, Next, &DhcpSb->Children) { + NET_LIST_FOR_EACH (Entry, &DhcpSb->Children) { Instance = NET_LIST_USER_STRUCT (Entry, DHCP_PROTOCOL, Link); if ((Instance != NULL) && (Instance->Token != NULL)) { Instance->Timeout--; if (Instance->Timeout == 0) { -- 2.17.1.windows.2