From patchwork Mon Jun 6 16:59:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King X-Patchwork-Id: 9158829 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 527FC60759 for ; Mon, 6 Jun 2016 17:01:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43DF12833E for ; Mon, 6 Jun 2016 17:01:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 38A212834D; Mon, 6 Jun 2016 17:01:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id DBDA32833E for ; Mon, 6 Jun 2016 17:01:54 +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 1b9xt6-0003Eq-W8; Mon, 06 Jun 2016 17:00:29 +0000 Received: from pandora.armlinux.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 1b9xsv-0001ZR-VE for linux-arm-kernel@lists.infradead.org; Mon, 06 Jun 2016 17:00:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.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=EeIAJeJRdqYdC8iXi3Gb1oZI4OPY4EWIgGso7I0TpFs=; b=EZ7hMaXeoGs1ihE64Re/nep6/vHDmhq181Wxk06GBdLpGDFted08D+xAXueh1BNLG+Vt2akDVrRS9oi/9oXYA8xTtYacYy+ykW6cZLj5oV9xnEOCoaDexlBYS7zMvBO1ERa5o6mbUzsjuAIivDdgs9+RQBrvYCOeFihtfuxc8nY=; Received: from [2002:4e20:1eda:1:b4eb:e902:622d:f2f0] (port=45126 helo=e0050434b2927.dyn.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1b9xsC-0000FM-JO; Mon, 06 Jun 2016 17:59:34 +0100 Received: from rmk by e0050434b2927.dyn.armlinux.org.uk with local (Exim 4.82) (envelope-from ) id 1b9xry-0003s5-Qd; Mon, 06 Jun 2016 17:59:18 +0100 In-Reply-To: <20160606164129.GM1041@n2100.armlinux.org.uk> References: <20160606164129.GM1041@n2100.armlinux.org.uk> From: Russell King To: kexec@lists.infradead.org,linux-arm-kernel@lists.infradead.org Subject: [PATCH kexec-tools v2 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: Mon, 06 Jun 2016 17:59:18 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160606_100018_582803_B0B55372 X-CRM114-Status: GOOD ( 13.40 ) 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 , Baoquan He Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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] Acked-by: Baoquan He Signed-off-by: Russell King --- 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; }