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.126; helo=mga18.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 23A7221A02937 for ; Mon, 24 Sep 2018 19:24:19 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Sep 2018 19:24:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,300,1534834800"; d="scan'208";a="75909196" Received: from ray-dev.ccr.corp.intel.com (HELO [10.239.9.8]) ([10.239.9.8]) by orsmga008.jf.intel.com with ESMTP; 24 Sep 2018 19:24:18 -0700 To: Laszlo Ersek , edk2-devel@lists.01.org Cc: Star Zeng References: <20180921072539.268068-1-ruiyu.ni@intel.com> <20180921072539.268068-4-ruiyu.ni@intel.com> <12daedaa-952f-fc73-3ed5-62970f869ba9@redhat.com> From: "Ni, Ruiyu" Message-ID: <5be31a57-3cee-9c13-29d2-97803b01f384@Intel.com> Date: Tue, 25 Sep 2018 10:25:15 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <12daedaa-952f-fc73-3ed5-62970f869ba9@redhat.com> Subject: Re: [PATCH 3/3] MdeModulePkg/PciHostBridge: Add RESOURCE_VALID() to simplify code 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, 25 Sep 2018 02:24:20 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 9/21/2018 7:12 PM, Laszlo Ersek wrote: > On 09/21/18 09:25, Ruiyu Ni wrote: > > Two superficial comments: > > - edk2 prefers long parameter names, so I suggest replacing "R" in the > macro definition with "Resource" > > - taking the parameter as a pointer is frequently considered more flexible. > > #define RESOURCE_VALID(Resource) ((Resource)->Base <= (Resource)->Limit) > ... > if (RESOURCE_VALID (&Bridge->Mem)) { > ... > > Up to you -- if you like these, feel free to update the patch before > pushing it (from my side anyway; you do need MdeModulePkg maintainer > review as well). Good comments. I will update the patch then commit. > > With or without changes: > > Reviewed-by: Laszlo Ersek > > Thanks > Laszlo > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel > -- Thanks, Ray