Re: [edk2] [PATCH] OvmfPkg/XenPvBlkDxe: Don't include system inttypes.h

Subject: Re: [edk2] [PATCH] OvmfPkg/XenPvBlkDxe: Don't include system inttypes.h

From: Andrew Fish <>


Date: 2014-11-11 22:04:30

On Nov 11, 2014, at 1:51 PM, Jordan Justen <> wrote:

EDK II code should not include system include files.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <>
Cc: Anthony PERARD <>
Cc: Scott Duplichan <>
OvmfPkg/XenPvBlkDxe/BlockFront.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/OvmfPkg/XenPvBlkDxe/BlockFront.c b/OvmfPkg/XenPvBlkDxe/BlockFront.c
index 8d43d83..6add552 100644
--- a/OvmfPkg/XenPvBlkDxe/BlockFront.c
+++ b/OvmfPkg/XenPvBlkDxe/BlockFront.c
@@ -3,6 +3,7 @@

  Copyright (c) 2007-2008 Samuel Thibault.
  Copyright (C) 2014, Citrix Ltd.
+  Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
@@ -34,10 +35,8 @@
#include <IndustryStandard/Xen/io/protocols.h>
#include <IndustryStandard/Xen/io/xenbus.h>

-// Header used for UINT32_MAX and UINT16_MAX
-#include "inttypes.h"
+#define UINT16_MAX ((UINTN)0xFFFF)

Why do we need to #define these? They already exist?
/// Maximum values for common UEFI Data Types
#define MAX_INT8    ((INT8)0x7F)
#define MAX_UINT8   ((UINT8)0xFF)
#define MAX_INT16   ((INT16)0x7FFF)
#define MAX_UINT16  ((UINT16)0xFFFF)
#define MAX_INT32   ((INT32)0x7FFFFFFF)
#define MAX_UINT32  ((UINT32)0xFFFFFFFF)

/// Maximum legal x64 INTN and UINTN values.


Andrew Fish

  Helper to read an integer from XenStore.

Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
edk2-devel mailing list