Patchwork uefi: uefirtvariable: fix build failure on 32 bit systems

login
register
mail settings
Submitter Colin King
Date Dec. 20, 2012, 10:36 a.m.
Message ID <1355999815-29473-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/207647/
State Superseded
Headers show

Comments

Colin King - Dec. 20, 2012, 10:36 a.m.
From: Colin Ian King <colin.king@canonical.com>

Fix build failure on 32 bit systems cause by not using ULL.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/uefi/uefirtvariable/uefirtvariable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Keng-Yu Lin - Dec. 20, 2012, 2:23 p.m.
On Thu, Dec 20, 2012 at 6:36 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Fix build failure on 32 bit systems cause by not using ULL.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/uefi/uefirtvariable/uefirtvariable.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c
> index 1599c5b..2a9db0b 100644
> --- a/src/uefi/uefirtvariable/uefirtvariable.c
> +++ b/src/uefi/uefirtvariable/uefirtvariable.c
> @@ -41,7 +41,7 @@
>  }
>
>  #define EFI_SUCCESS            0
> -#define EFI_NOT_FOUND          (14 | (1UL << 63))
> +#define EFI_NOT_FOUND          (14 | (1ULL << 63))
>

from kernel's efi.h

#define EFI_NOT_FOUND           (14 | (1UL << (BITS_PER_LONG-1)))

shall we just mimic the kernel's definition like:

#define BITS_PER_LONG          sizeof(long) * 8
#define EFI_NOT_FOUND          (14 | (1UL << (BITS_PER_LONG-1)))

if it is better this way?

>  #define MAX_DATA_LENGTH                1024
>
> --
> 1.8.0
>
>
> --
> fwts-devel mailing list
> fwts-devel@lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/fwts-devel
Alex Hung - Jan. 2, 2013, 2:38 a.m.
On 12/20/2012 06:36 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Fix build failure on 32 bit systems cause by not using ULL.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/uefi/uefirtvariable/uefirtvariable.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c
> index 1599c5b..2a9db0b 100644
> --- a/src/uefi/uefirtvariable/uefirtvariable.c
> +++ b/src/uefi/uefirtvariable/uefirtvariable.c
> @@ -41,7 +41,7 @@
>   }
>
>   #define EFI_SUCCESS		0
> -#define EFI_NOT_FOUND		(14 | (1UL << 63))
> +#define EFI_NOT_FOUND		(14 | (1ULL << 63))
>
>   #define MAX_DATA_LENGTH		1024
>
>
Acked-by: Alex Hung <alex.hung@canonical.com>
Colin King - Jan. 4, 2013, 12:13 p.m.
On 20/12/12 10:36, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Fix build failure on 32 bit systems cause by not using ULL.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/uefi/uefirtvariable/uefirtvariable.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c
> index 1599c5b..2a9db0b 100644
> --- a/src/uefi/uefirtvariable/uefirtvariable.c
> +++ b/src/uefi/uefirtvariable/uefirtvariable.c
> @@ -41,7 +41,7 @@
>   }
>
>   #define EFI_SUCCESS		0
> -#define EFI_NOT_FOUND		(14 | (1UL << 63))
> +#define EFI_NOT_FOUND		(14 | (1ULL << 63))
>
>   #define MAX_DATA_LENGTH		1024
>
>
As per Keng-Yu's comments, I'm NACK'ing my own patch.

Patch

diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c
index 1599c5b..2a9db0b 100644
--- a/src/uefi/uefirtvariable/uefirtvariable.c
+++ b/src/uefi/uefirtvariable/uefirtvariable.c
@@ -41,7 +41,7 @@ 
 }
 
 #define EFI_SUCCESS		0
-#define EFI_NOT_FOUND		(14 | (1UL << 63))
+#define EFI_NOT_FOUND		(14 | (1ULL << 63))
 
 #define MAX_DATA_LENGTH		1024