From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Sun, 28 Feb 2016 21:18:55 -0700 Subject: [U-Boot] [PATCH 03/30] dm: part: Correct a sandbox build warning In-Reply-To: References: <1455502619-16093-1-git-send-email-sjg@chromium.org> <1455502619-16093-4-git-send-email-sjg@chromium.org> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Bin, On 16 February 2016 at 03:09, Bin Meng wrote: > Hi Simon, > > On Mon, Feb 15, 2016 at 10:16 AM, Simon Glass wrote: >> Adjust the cast to avoid a warning when stdint.h is used. >> >> Signed-off-by: Simon Glass >> --- >> >> disk/part_efi.c | 10 ++++++---- >> 1 file changed, 6 insertions(+), 4 deletions(-) >> >> diff --git a/disk/part_efi.c b/disk/part_efi.c >> index db5e7ed..7bd840f 100644 >> --- a/disk/part_efi.c >> +++ b/disk/part_efi.c >> @@ -658,11 +658,13 @@ int gpt_verify_partitions(struct blk_desc *dev_desc, >> gpt_part_size = le64_to_cpu(gpt_e[i].ending_lba) - >> le64_to_cpu(gpt_e[i].starting_lba) + 1; >> debug("size(LBA) - GPT: %8llu, ENV: %8llu ", >> - gpt_part_size, (u64) partitions[i].size); >> + (unsigned long long)gpt_part_size, >> + (unsigned long long)partitions[i].size); > > Can you elaborate why this is needed? When using stdint.h (CONFIG_USE_STDINT) I get this warning with sandbox. I don't know if it is my compiler or there is a better way to make stdint work... > >> >> if (le64_to_cpu(gpt_part_size) != partitions[i].size) { >> error("Partition %s size: %llu does not match %llu!\n", >> - efi_str, gpt_part_size, (u64) partitions[i].size); >> + efi_str, (unsigned long long)gpt_part_size, >> + (unsigned long long)partitions[i].size); >> return -1; >> } >> >> @@ -678,12 +680,12 @@ int gpt_verify_partitions(struct blk_desc *dev_desc, >> /* Check if GPT and ENV start LBAs match */ >> debug("start LBA - GPT: %8llu, ENV: %8llu\n", >> le64_to_cpu(gpt_e[i].starting_lba), >> - (u64) partitions[i].start); >> + (unsigned long long)partitions[i].start); >> >> if (le64_to_cpu(gpt_e[i].starting_lba) != partitions[i].start) { >> error("Partition %s start: %llu does not match %llu!\n", >> efi_str, le64_to_cpu(gpt_e[i].starting_lba), >> - (u64) partitions[i].start); >> + (unsigned long long)partitions[i].start); >> return -1; >> } >> } >> -- Regards, Simon