From patchwork Tue May 3 10:21:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King X-Patchwork-Id: 9002361 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8C070BF29F for ; Tue, 3 May 2016 10:24:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BC0DA2010C for ; Tue, 3 May 2016 10:24:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DAF25200E9 for ; Tue, 3 May 2016 10:24:30 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1axXTg-0008Ht-Sy; Tue, 03 May 2016 10:22:52 +0000 Received: from pandora.arm.linux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1axXT7-0007HG-98 for linux-arm-kernel@lists.infradead.org; Tue, 03 May 2016 10:22:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=pandora-2014; h=Date:Sender:Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References:In-Reply-To; bh=5D3QRMa7zw6jdZBH9XYOpI4diIXUUr10++p4QjBCK7Y=; b=qEnyZ8vljnRW+OGZteU+WOReAxnq/JKHn64gzj0CgLtEMjbVLVxGakgyT/h4G46UZiEMFvnhABJmi06IKPEWWWe2EkQM3WkdKwqzMufYgB6g4q25maTOu0K++HOCbm/DGaumBjbaXIj9TidnSteOtlD+evDLg7V9WiHBBJ4XZiw=; Received: from [2001:4d48:ad52:3201:452d:3855:1c55:6d46] (port=48546 helo=e0050434b2927.dyn.arm.linux.org.uk) by pandora.arm.linux.org.uk with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1axXSb-0004wK-Cl; Tue, 03 May 2016 11:21:45 +0100 Received: from rmk by e0050434b2927.dyn.arm.linux.org.uk with local (Exim 4.82) (envelope-from ) id 1axXSV-0004hZ-CH; Tue, 03 May 2016 11:21:39 +0100 In-Reply-To: References: From: Russell King To: kexec@lists.infradead.org,linux-arm-kernel@lists.infradead.org Subject: [PATCH kexec-tools 07/32] kexec: fix warnings caused by selecting 64-bit file IO on 32-bit platforms MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 03 May 2016 11:21:39 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160503_032218_588268_DC151D28 X-CRM114-Status: GOOD ( 14.15 ) X-Spam-Score: -5.3 (-----) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pratyush Anand Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix warnings caused by selecting 64-bit file IO on 32-bit platforms. kexec/kexec.c:710:2: warning: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'off_t' [-Wformat] kexec/zlib.c:63:4: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'off_t' [-Wformat] kexec/kexec-uImage.c:85:3: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'off_t' [-Wformat] Signed-off-by: Russell King Acked-by: Baoquan He --- kexec/kexec-uImage.c | 3 ++- kexec/kexec.c | 4 ++-- kexec/zlib.c | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/kexec/kexec-uImage.c b/kexec/kexec-uImage.c index 9df601b..5e24629 100644 --- a/kexec/kexec-uImage.c +++ b/kexec/kexec-uImage.c @@ -82,7 +82,8 @@ int uImage_probe(const unsigned char *buf, off_t len, unsigned int arch) if (be32_to_cpu(header.ih_size) > len - sizeof(header)) { printf("uImage header claims that image has %d bytes\n", be32_to_cpu(header.ih_size)); - printf("we read only %ld bytes.\n", len - sizeof(header)); + printf("we read only %lld bytes.\n", + (long long)len - sizeof(header)); return -1; } #ifdef HAVE_LIBZ diff --git a/kexec/kexec.c b/kexec/kexec.c index f0bd527..500e5a9 100644 --- a/kexec/kexec.c +++ b/kexec/kexec.c @@ -707,8 +707,8 @@ static int my_load(const char *type, int fileind, int argc, char **argv, /* slurp in the input kernel */ kernel_buf = slurp_decompress_file(kernel, &kernel_size); - dbgprintf("kernel: %p kernel_size: 0x%lx\n", - kernel_buf, kernel_size); + dbgprintf("kernel: %p kernel_size: %#llx\n", + kernel_buf, (unsigned long long)kernel_size); if (get_memory_ranges(&info.memory_range, &info.memory_ranges, info.kexec_flags) < 0 || info.memory_ranges == 0) { diff --git a/kexec/zlib.c b/kexec/zlib.c index 7170ac3..95b6080 100644 --- a/kexec/zlib.c +++ b/kexec/zlib.c @@ -60,8 +60,8 @@ char *zlib_decompress_file(const char *filename, off_t *r_size) if ((errno == EINTR) || (errno == EAGAIN)) continue; _gzerror(fp, &errnum, &msg); - dbgprintf("Read on %s of %ld bytes failed: %s\n", - filename, (allocated - size) + 0UL, msg); + dbgprintf("Read on %s of %d bytes failed: %s\n", + filename, (int)(allocated - size), msg); size = 0; goto fail; }