Patchwork [RESEND] uefi: uefirtvariable: fix build failure on 32 bit systems

login
register
mail settings
Submitter Colin King
Date Jan. 4, 2013, 12:24 p.m.
Message ID <1357302258-15349-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/209450/
State Rejected
Headers show

Comments

Colin King - Jan. 4, 2013, 12:24 p.m.
From: Colin Ian King <colin.king@canonical.com>

Fix build failure on 32 bit systems. Thanks to Keng-Yu for suggesting
a far better solution.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/lib/include/fwts_uefi.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Colin King - Jan. 4, 2013, 7:01 p.m.
On 04/01/13 12:24, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Fix build failure on 32 bit systems. Thanks to Keng-Yu for suggesting
> a far better solution.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/lib/include/fwts_uefi.h | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/lib/include/fwts_uefi.h b/src/lib/include/fwts_uefi.h
> index 64e72c1..e25da50 100644
> --- a/src/lib/include/fwts_uefi.h
> +++ b/src/lib/include/fwts_uefi.h
> @@ -46,7 +46,8 @@ enum {
>   	FWTS_UEFI_TIME_IN_DAYLIGHT = 		0x02
>   };
>
> -#define HIGH_BIT_SET	(1UL << 63)
> +#define BITS_PER_UINT64          	(sizeof(long) * 8)
> +#define HIGH_BIT_SET			(1UL << (BITS_PER_UINT64-1))
>
>   #define EFI_SUCCESS			0
>   #define EFI_LOAD_ERROR			(1 | HIGH_BIT_SET)
>
Ah, it seems I missed Keng-Yu's patch that landed in fwts. Ignore this.

Patch

diff --git a/src/lib/include/fwts_uefi.h b/src/lib/include/fwts_uefi.h
index 64e72c1..e25da50 100644
--- a/src/lib/include/fwts_uefi.h
+++ b/src/lib/include/fwts_uefi.h
@@ -46,7 +46,8 @@  enum {
 	FWTS_UEFI_TIME_IN_DAYLIGHT = 		0x02
 };
 
-#define HIGH_BIT_SET	(1UL << 63)
+#define BITS_PER_UINT64          	(sizeof(long) * 8)
+#define HIGH_BIT_SET			(1UL << (BITS_PER_UINT64-1))
 
 #define EFI_SUCCESS			0
 #define EFI_LOAD_ERROR			(1 | HIGH_BIT_SET)