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: 5966441 Return-Path: X-Original-To: patchwork-linux-btrfs@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 4BDC0BF440 for ; Mon, 9 Mar 2015 11:40:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6DCAB20254 for ; Mon, 9 Mar 2015 11:40:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 97C742015A for ; Mon, 9 Mar 2015 11:40:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752468AbbCILkI (ORCPT ); Mon, 9 Mar 2015 07:40:08 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:58516 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751318AbbCILkH (ORCPT ); Mon, 9 Mar 2015 07:40:07 -0400 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 Cc: David Sterba , linux-btrfs@vger.kernel.org, Josef Bacik , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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; Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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));