lkml.org 
[lkml]   [2013]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] block: partitions: efi: Typecast sizeof(gpt_header)
On Wed, Feb 20, 2013 at 11:52:10AM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> Since commit ef25bb0fa6e2 (block/partitions/efi.c: ensure that the GPT header is
> at least the size of the structure.) , when building for a 32-bit architecture,
> such as ARM, the following build warning is seen:
>
> block/partitions/efi.c:324:3: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'unsigned int' [-Wformat]

Hi Fabio,

I sent and updated version of ef25bb0fa6e2 this morning to fix this
issue. Thanks for the patch, though. Andrew, if you'd like you can
just use this instead of replacing my patch with the new one.

Signed-off-by: Peter Jones <pjones@redhat.com>

>
> Typecast sizeof(gpt_header) to (unsigned long) to avoid such warning on 32-bit
> systems.
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Cc: Peter Jones <pjones@redhat.com>
> Cc: Matt Fleming <matt.fleming@intel.com>
> Cc: Jens Axboe <axboe@kernel.dk>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> block/partitions/efi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/block/partitions/efi.c b/block/partitions/efi.c
> index a7475e7..62e05cf 100644
> --- a/block/partitions/efi.c
> +++ b/block/partitions/efi.c
> @@ -323,7 +323,7 @@ static int is_gpt_valid(struct parsed_partitions *state, u64 lba,
> if (le32_to_cpu((*gpt)->header_size) < sizeof(gpt_header)) {
> pr_debug("GUID Partition Table Header size is too small: %u < %lu\n",
> le32_to_cpu((*gpt)->header_size),
> - sizeof(gpt_header));
> + (unsigned long)sizeof(gpt_header));
> goto fail;
> }
>
> --
> 1.7.9.5
>

--
Peter


\
 
 \ /
  Last update: 2013-02-20 18:21    [W:0.764 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site