Patchwork lib: fwts_uefi: cast to __SWORD_TYPE 32 bit builds

login
register
mail settings
Submitter Colin King
Date April 23, 2013, 8:34 a.m.
Message ID <1366706065-32018-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/238794/
State Accepted
Headers show

Comments

Colin King - April 23, 2013, 8:34 a.m.
From: Colin Ian King <colin.king@canonical.com>

Fix 32 bit build failures:

fwts_uefi.c: In function 'fwts_uefi_get_interface':
fwts_uefi.c:130:22: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
cc1: all warnings being treated as errors

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/lib/src/fwts_uefi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Alex Hung - April 23, 2013, 9:31 a.m.
On 04/23/2013 04:34 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Fix 32 bit build failures:
>
> fwts_uefi.c: In function 'fwts_uefi_get_interface':
> fwts_uefi.c:130:22: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
> cc1: all warnings being treated as errors
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/lib/src/fwts_uefi.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/lib/src/fwts_uefi.c b/src/lib/src/fwts_uefi.c
> index 8149d23..d18c7b7 100644
> --- a/src/lib/src/fwts_uefi.c
> +++ b/src/lib/src/fwts_uefi.c
> @@ -60,9 +60,9 @@ typedef struct {
>   #define UEFI_IFACE_EFIVARS		(3)	/* efivar fs */
>
>   /* File system magic numbers */
> -#define PSTOREFS_MAGIC          0x6165676C
> -#define EFIVARFS_MAGIC          0xde5e81e4
> -#define SYS_FS_MAGIC		0x62656572
> +#define PSTOREFS_MAGIC          ((__SWORD_TYPE)0x6165676C)
> +#define EFIVARFS_MAGIC          ((__SWORD_TYPE)0xde5e81e4)
> +#define SYS_FS_MAGIC		((__SWORD_TYPE)0x62656572)
>
>   /*
>    *  fwts_uefi_get_interface()
>
Acked-by: Alex Hung <alex.hung@canonical.com>
Keng-Yu Lin - April 26, 2013, 2:06 a.m.
On Tue, Apr 23, 2013 at 4:34 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Fix 32 bit build failures:
>
> fwts_uefi.c: In function 'fwts_uefi_get_interface':
> fwts_uefi.c:130:22: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
> cc1: all warnings being treated as errors
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/lib/src/fwts_uefi.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/lib/src/fwts_uefi.c b/src/lib/src/fwts_uefi.c
> index 8149d23..d18c7b7 100644
> --- a/src/lib/src/fwts_uefi.c
> +++ b/src/lib/src/fwts_uefi.c
> @@ -60,9 +60,9 @@ typedef struct {
>  #define UEFI_IFACE_EFIVARS             (3)     /* efivar fs */
>
>  /* File system magic numbers */
> -#define PSTOREFS_MAGIC          0x6165676C
> -#define EFIVARFS_MAGIC          0xde5e81e4
> -#define SYS_FS_MAGIC           0x62656572
> +#define PSTOREFS_MAGIC          ((__SWORD_TYPE)0x6165676C)
> +#define EFIVARFS_MAGIC          ((__SWORD_TYPE)0xde5e81e4)
> +#define SYS_FS_MAGIC           ((__SWORD_TYPE)0x62656572)
>
>  /*
>   *  fwts_uefi_get_interface()
> --
> 1.8.1.2
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>

Patch

diff --git a/src/lib/src/fwts_uefi.c b/src/lib/src/fwts_uefi.c
index 8149d23..d18c7b7 100644
--- a/src/lib/src/fwts_uefi.c
+++ b/src/lib/src/fwts_uefi.c
@@ -60,9 +60,9 @@  typedef struct {
 #define UEFI_IFACE_EFIVARS		(3)	/* efivar fs */
 
 /* File system magic numbers */
-#define PSTOREFS_MAGIC          0x6165676C
-#define EFIVARFS_MAGIC          0xde5e81e4
-#define SYS_FS_MAGIC		0x62656572
+#define PSTOREFS_MAGIC          ((__SWORD_TYPE)0x6165676C)
+#define EFIVARFS_MAGIC          ((__SWORD_TYPE)0xde5e81e4)
+#define SYS_FS_MAGIC		((__SWORD_TYPE)0x62656572)
 
 /*
  *  fwts_uefi_get_interface()