dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0377-include-grub-efi-api.h-GRUB_EFI_DEVICE_PATH_LENGTH-U.patch

f96e0b
From 9609731b185923ba8ce177b0c8a0679b876c8f1a Mon Sep 17 00:00:00 2001
f96e0b
From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
f96e0b
Date: Sun, 28 Apr 2013 15:15:57 +0200
f96e0b
Subject: [PATCH 377/482] 	* include/grub/efi/api.h
f96e0b
 (GRUB_EFI_DEVICE_PATH_LENGTH): Use 	grub_get_unaligned16 rather than
f96e0b
 shifts.
f96e0b
f96e0b
---
f96e0b
 ChangeLog              | 5 +++++
f96e0b
 include/grub/efi/api.h | 3 +--
f96e0b
 2 files changed, 6 insertions(+), 2 deletions(-)
f96e0b
f96e0b
diff --git a/ChangeLog b/ChangeLog
f96e0b
index da92415..727a8c8 100644
f96e0b
--- a/ChangeLog
f96e0b
+++ b/ChangeLog
f96e0b
@@ -1,5 +1,10 @@
f96e0b
 2013-04-28  Vladimir Serbinenko  <phcoder@gmail.com>
f96e0b
 
f96e0b
+	* include/grub/efi/api.h (GRUB_EFI_DEVICE_PATH_LENGTH): Use
f96e0b
+	grub_get_unaligned16 rather than shifts.
f96e0b
+
f96e0b
+2013-04-28  Vladimir Serbinenko  <phcoder@gmail.com>
f96e0b
+
f96e0b
 	* grub-core/kern/file.c: Use const char * rather than casting to
f96e0b
 	non-const.
f96e0b
 
f96e0b
diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h
f96e0b
index 2917d14..69bcd0c 100644
f96e0b
--- a/include/grub/efi/api.h
f96e0b
+++ b/include/grub/efi/api.h
f96e0b
@@ -553,8 +553,7 @@ typedef struct grub_efi_device_path grub_efi_device_path_protocol_t;
f96e0b
 
f96e0b
 #define GRUB_EFI_DEVICE_PATH_TYPE(dp)		((dp)->type & 0x7f)
f96e0b
 #define GRUB_EFI_DEVICE_PATH_SUBTYPE(dp)	((dp)->subtype)
f96e0b
-#define GRUB_EFI_DEVICE_PATH_LENGTH(dp)		\
f96e0b
-  ((dp)->length[0] | ((grub_efi_uint16_t) ((dp)->length[1]) << 8))
f96e0b
+#define GRUB_EFI_DEVICE_PATH_LENGTH(dp)		(grub_get_unaligned16 ((dp)->length))
f96e0b
 
f96e0b
 /* The End of Device Path nodes.  */
f96e0b
 #define GRUB_EFI_END_DEVICE_PATH_TYPE			(0xff & 0x7f)
f96e0b
-- 
f96e0b
1.8.2.1
f96e0b