From patchwork Mon Mar 9 11:39:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 5966451 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5FC719F318 for ; Mon, 9 Mar 2015 11:42:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8EFA320254 for ; Mon, 9 Mar 2015 11:42:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C23E12015A for ; Mon, 9 Mar 2015 11:42:29 +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 1YUw2Z-000790-0o; Mon, 09 Mar 2015 11:40:07 +0000 Received: from mout.kundenserver.de ([212.227.126.130]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YUw2V-0006Ra-Iz for linux-arm-kernel@lists.infradead.org; Mon, 09 Mar 2015 11:40:04 +0000 Received: from wuerfel.localnet ([149.172.15.242]) by mrelayeu.kundenserver.de (mreue003) with ESMTPSA (Nemesis) id 0M5L11-1XWfKw08eF-00zagZ; Mon, 09 Mar 2015 12:39:37 +0100 From: Arnd Bergmann To: Chris Mason Subject: [PATCH] btrfs: fix size_t format string Date: Mon, 09 Mar 2015 12:39:36 +0100 Message-ID: <2448187.keuqSF9F23@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V03:K0:eY6ZEj8Tia88pH4Fhy90oKBzJZ5NCUe9h0Ofb1LerHHC2J7yYj7 t7MBRgqxpiNk/Q+YUEtv/V8uPDwldyA8k52Wv29IUe8ff7r7P9RHcb+TRsWkgxyObDS4J7a HnJE154p7EHJ8qu3zfa0pKDPI42WTErLeZ3A0CMUfq9idVOby/KVKpgoIzvNC5ZjS6diBZ1 qOr0C5cF+FzN7G/a6qiYQ== X-UI-Out-Filterresults: notjunk:1; X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150309_044004_001397_3E11F780 X-CRM114-Status: UNSURE ( 8.78 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) Cc: Josef Bacik , linux-arm-kernel@lists.infradead.org, David Sterba , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, 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 This resolves a harmless gcc warning in btrfs_check_super_valid that results from a size_t value being printed as %lu: fs/btrfs/disk-io.c:3927:21: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'unsigned int' [-Wformat=] On all Linux systems, size_t is the same length as unsigned long, but the compiler does not know this, and warns about potentially unportable code here. The correct printf string for size_t is %z. Signed-off-by: Arnd Bergmann Fixes: ce7fca5f57ed0f "btrfs: add checks for sys_chunk_array sizes" Cc: David Sterba Cc: Chris Mason --- This warning has been rather annoying because it shows up in every 'allmodconfig' build. I assume others have reported it before, but please apply some fix for it, ideally before 4.0. diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index f79f38542a73..639f2663ed3f 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -3921,7 +3921,7 @@ static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info, } if (btrfs_super_sys_array_size(sb) < sizeof(struct btrfs_disk_key) + sizeof(struct btrfs_chunk)) { - printk(KERN_ERR "BTRFS: system chunk array too small %u < %lu\n", + printk(KERN_ERR "BTRFS: system chunk array too small %u < %zu\n", btrfs_super_sys_array_size(sb), sizeof(struct btrfs_disk_key) + sizeof(struct btrfs_chunk));