[edk2,v2,0/6] BaseTools: get rid of MAX_UINTN

Message ID 20181130224537.18936-1-ard.biesheuvel@linaro.org
Headers show
Series
  • BaseTools: get rid of MAX_UINTN
Related show

Message

Ard Biesheuvel Nov. 30, 2018, 10:45 p.m.
There should be no reason for the build tools to care about the native
word size of a particular target, so relying on a definition of MAX_UINTN
is definitely wrong, and most likely inaccurate on 32-bit build hosts.

So refactor the code in CommonLib and DevicePath so we no longer rely
on this definition.

Changes since v1:
- miss type change in #1 causing a build failure on MSVC
- add acks from Jaben

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>

Ard Biesheuvel (6):
  BaseTools/CommonLib: avoid using 'native' word size in IP address
    handling
  BaseTools/CommonLib: use explicit 64-bit type in Strtoi()
  BaseTools/DevicePath: use explicit 64-bit number parsing routines
  BaseTools/DevicePath: use MAX_UINT16 as default device path max size
  BaseTools/CommonLib: get rid of 'native' type string parsing routines
  BaseTools/CommonLib: drop definition of MAX_UINTN

 BaseTools/Source/C/Common/CommonLib.h         |  25 ---
 BaseTools/Source/C/Common/CommonLib.c         | 206 ++----------------
 .../Source/C/DevicePath/DevicePathFromText.c  |   4 +-
 .../Source/C/DevicePath/DevicePathUtilities.c |   4 +-
 4 files changed, 25 insertions(+), 214 deletions(-)

-- 
2.19.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Comments

Gao, Liming Dec. 5, 2018, 12:04 a.m. | #1
Reviewed-by: Liming Gao <liming.gao@intel.com> for this serials. 


On patch 4, I have the same comments to Laszlo. 

>-----Original Message-----

>From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ard

>Biesheuvel

>Sent: Saturday, December 01, 2018 6:46 AM

>To: edk2-devel@lists.01.org

>Cc: Gao, Liming <liming.gao@intel.com>; Carsey, Jaben

><jaben.carsey@intel.com>; Laszlo Ersek <lersek@redhat.com>

>Subject: [edk2] [PATCH v2 0/6] BaseTools: get rid of MAX_UINTN

>

>There should be no reason for the build tools to care about the native

>word size of a particular target, so relying on a definition of MAX_UINTN

>is definitely wrong, and most likely inaccurate on 32-bit build hosts.

>

>So refactor the code in CommonLib and DevicePath so we no longer rely

>on this definition.

>

>Changes since v1:

>- miss type change in #1 causing a build failure on MSVC

>- add acks from Jaben

>

>Cc: Laszlo Ersek <lersek@redhat.com>

>Cc: Yonghong Zhu <yonghong.zhu@intel.com>

>Cc: Liming Gao <liming.gao@intel.com>

>Cc: Bob Feng <bob.c.feng@intel.com>

>Cc: Jaben Carsey <jaben.carsey@intel.com>

>

>Ard Biesheuvel (6):

>  BaseTools/CommonLib: avoid using 'native' word size in IP address

>    handling

>  BaseTools/CommonLib: use explicit 64-bit type in Strtoi()

>  BaseTools/DevicePath: use explicit 64-bit number parsing routines

>  BaseTools/DevicePath: use MAX_UINT16 as default device path max size

>  BaseTools/CommonLib: get rid of 'native' type string parsing routines

>  BaseTools/CommonLib: drop definition of MAX_UINTN

>

> BaseTools/Source/C/Common/CommonLib.h         |  25 ---

> BaseTools/Source/C/Common/CommonLib.c         | 206 ++----------------

> .../Source/C/DevicePath/DevicePathFromText.c  |   4 +-

> .../Source/C/DevicePath/DevicePathUtilities.c |   4 +-

> 4 files changed, 25 insertions(+), 214 deletions(-)

>

>--

>2.19.1

>

>_______________________________________________

>edk2-devel mailing list

>edk2-devel@lists.01.org

>https://lists.01.org/mailman/listinfo/edk2-devel

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Ard Biesheuvel Dec. 5, 2018, 8:12 a.m. | #2
On Wed, 5 Dec 2018 at 01:04, Gao, Liming <liming.gao@intel.com> wrote:
>

> Reviewed-by: Liming Gao <liming.gao@intel.com> for this serials.

>


Thanks all

Series pushed as 64ab2c82e8f6..8efc6d84ca41

(with the requested MAX_UINT16 -> MAX_UINT32 change applied)

> On patch 4, I have the same comments to Laszlo.

>

> >-----Original Message-----

> >From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ard

> >Biesheuvel

> >Sent: Saturday, December 01, 2018 6:46 AM

> >To: edk2-devel@lists.01.org

> >Cc: Gao, Liming <liming.gao@intel.com>; Carsey, Jaben

> ><jaben.carsey@intel.com>; Laszlo Ersek <lersek@redhat.com>

> >Subject: [edk2] [PATCH v2 0/6] BaseTools: get rid of MAX_UINTN

> >

> >There should be no reason for the build tools to care about the native

> >word size of a particular target, so relying on a definition of MAX_UINTN

> >is definitely wrong, and most likely inaccurate on 32-bit build hosts.

> >

> >So refactor the code in CommonLib and DevicePath so we no longer rely

> >on this definition.

> >

> >Changes since v1:

> >- miss type change in #1 causing a build failure on MSVC

> >- add acks from Jaben

> >

> >Cc: Laszlo Ersek <lersek@redhat.com>

> >Cc: Yonghong Zhu <yonghong.zhu@intel.com>

> >Cc: Liming Gao <liming.gao@intel.com>

> >Cc: Bob Feng <bob.c.feng@intel.com>

> >Cc: Jaben Carsey <jaben.carsey@intel.com>

> >

> >Ard Biesheuvel (6):

> >  BaseTools/CommonLib: avoid using 'native' word size in IP address

> >    handling

> >  BaseTools/CommonLib: use explicit 64-bit type in Strtoi()

> >  BaseTools/DevicePath: use explicit 64-bit number parsing routines

> >  BaseTools/DevicePath: use MAX_UINT16 as default device path max size

> >  BaseTools/CommonLib: get rid of 'native' type string parsing routines

> >  BaseTools/CommonLib: drop definition of MAX_UINTN

> >

> > BaseTools/Source/C/Common/CommonLib.h         |  25 ---

> > BaseTools/Source/C/Common/CommonLib.c         | 206 ++----------------

> > .../Source/C/DevicePath/DevicePathFromText.c  |   4 +-

> > .../Source/C/DevicePath/DevicePathUtilities.c |   4 +-

> > 4 files changed, 25 insertions(+), 214 deletions(-)

> >

> >--

> >2.19.1

> >

> >_______________________________________________

> >edk2-devel mailing list

> >edk2-devel@lists.01.org

> >https://lists.01.org/mailman/listinfo/edk2-devel

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel