From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 DC2AD8030A for ; Sun, 5 Mar 2017 17:03:57 -0800 (PST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP; 05 Mar 2017 17:03:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,251,1484035200"; d="scan'208";a="940929672" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga003.jf.intel.com with ESMTP; 05 Mar 2017 17:03:54 -0800 Received: from fmsmsx125.amr.corp.intel.com (10.18.125.40) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 5 Mar 2017 17:03:51 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX125.amr.corp.intel.com (10.18.125.40) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 5 Mar 2017 17:03:51 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.20]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.177]) with mapi id 14.03.0248.002; Mon, 6 Mar 2017 09:03:49 +0800 From: "Fu, Siyuan" To: "Wu, Hao A" , "edk2-devel@lists.01.org" CC: "Wu, Jiaxin" Thread-Topic: [PATCH v3 4/6] NetworkPkg: Refine type cast for pointer subtraction Thread-Index: AQHSjxxpZL3Mbchcv0Sohy7lGmXH2qGHDMPQ Date: Mon, 6 Mar 2017 01:03:48 +0000 Message-ID: References: <1487995514-7628-1-git-send-email-hao.a.wu@intel.com> <1487995514-7628-5-git-send-email-hao.a.wu@intel.com> In-Reply-To: <1487995514-7628-5-git-send-email-hao.a.wu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMTgwOWM0NTktZTEzNC00ZmE4LWEzOGMtNDYxMjlhZDc2MjRiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6InBjV1Ftd0puVlQ3NWNKRnhBM0c3R2JBa2NXdXFcL0NHSjNPQWlmT2J3cDhZPSJ9 x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH v3 4/6] NetworkPkg: Refine type cast for pointer subtraction X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Mar 2017 01:03:58 -0000 Content-Language: en-US Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: base64 UmV2aWV3ZWQtYnk6IEZ1IFNpeXVhbiA8c2l5dWFuLmZ1QGludGVsLmNvbT4NCg0KDQotLS0tLU9y aWdpbmFsIE1lc3NhZ2UtLS0tLQ0KRnJvbTogV3UsIEhhbyBBIA0KU2VudDogMjAxN8TqMtTCMjXI 1SAxMjowNQ0KVG86IGVkazItZGV2ZWxAbGlzdHMuMDEub3JnDQpDYzogV3UsIEhhbyBBIDxoYW8u YS53dUBpbnRlbC5jb20+OyBGdSwgU2l5dWFuIDxzaXl1YW4uZnVAaW50ZWwuY29tPjsgV3UsIEpp YXhpbiA8amlheGluLnd1QGludGVsLmNvbT4NClN1YmplY3Q6IFtQQVRDSCB2MyA0LzZdIE5ldHdv cmtQa2c6IFJlZmluZ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