Blame SOURCES/0014-Fix-a-sign-error-in-the-debughook-example-app.patch

ba2c15
From 25cebcee2ae0b92829841321220ec9837479c118 Mon Sep 17 00:00:00 2001
ba2c15
From: Peter Jones <pjones@redhat.com>
ba2c15
Date: Tue, 13 Mar 2018 15:20:24 -0400
ba2c15
Subject: [PATCH 14/25] Fix a sign error in the debughook example app
ba2c15
ba2c15
On ISO C90 on i386 4294967294 is a signed integer, and so x can't be
ba2c15
greater (or equal) to that.  Make it an unsigned and choose a better type
ba2c15
for the variable.
ba2c15
ba2c15
Signed-off-by: Peter Jones <pjones@redhat.com>
ba2c15
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
ba2c15
---
ba2c15
 apps/debughook.c | 4 ++--
ba2c15
 1 file changed, 2 insertions(+), 2 deletions(-)
ba2c15
ba2c15
diff --git a/apps/debughook.c b/apps/debughook.c
ba2c15
index 93cd0cf7eb0..78e4a767b1d 100644
ba2c15
--- a/apps/debughook.c
ba2c15
+++ b/apps/debughook.c
ba2c15
@@ -50,7 +50,7 @@ DebugHook(void)
ba2c15
 	UINT8 *data = NULL;
ba2c15
 	UINTN dataSize = 0;
ba2c15
 	EFI_STATUS efi_status;
ba2c15
-	register volatile UINTN x = 0;
ba2c15
+	register volatile unsigned long long x = 0;
ba2c15
 	extern char _text, _data;
ba2c15
 
ba2c15
 	if (x)
ba2c15
@@ -71,7 +71,7 @@ DebugHook(void)
ba2c15
 	while (x++) {
ba2c15
 		/* Make this so it can't /totally/ DoS us. */
ba2c15
 #if defined(__x86_64__) || defined(__i386__) || defined(__i686__)
ba2c15
-		if (x > 4294967294)
ba2c15
+		if (x > 4294967294ULL)
ba2c15
 			break;
ba2c15
 		__asm__ __volatile__("pause");
ba2c15
 #elif defined(__aarch64__)
ba2c15
-- 
ba2c15
2.15.0
ba2c15