public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: akpm@linux-foundation.org
Cc: sfr@canb.auug.org.au, linux-kernel@vger.kernel.org,
	Fabio Estevam <fabio.estevam@freescale.com>,
	Peter Jones <pjones@redhat.com>,
	Matt Fleming <matt.fleming@intel.com>,
	Jens Axboe <axboe@kernel.dk>
Subject: [PATCH] block: partitions: efi: Typecast sizeof(gpt_header)
Date: Wed, 20 Feb 2013 11:52:10 -0300	[thread overview]
Message-ID: <1361371930-1520-1-git-send-email-festevam@gmail.com> (raw)

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]

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


             reply	other threads:[~2013-02-20 14:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-20 14:52 Fabio Estevam [this message]
2013-02-20 16:27 ` [PATCH] block: partitions: efi: Typecast sizeof(gpt_header) Peter Jones
2013-02-20 20:59   ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1361371930-1520-1-git-send-email-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=fabio.estevam@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt.fleming@intel.com \
    --cc=pjones@redhat.com \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox