From patchwork Wed Dec 6 14:18:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10095947 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 D77D460210 for ; Wed, 6 Dec 2017 14:19:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C984C28AC5 for ; Wed, 6 Dec 2017 14:19:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BCF0829B79; Wed, 6 Dec 2017 14:19:31 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A86D28AC5 for ; Wed, 6 Dec 2017 14:19:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752387AbdLFOTE (ORCPT ); Wed, 6 Dec 2017 09:19:04 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:62705 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752360AbdLFOS6 (ORCPT ); Wed, 6 Dec 2017 09:18:58 -0500 Received: from wuerfel.lan ([149.172.96.106]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0LoYQs-1f1fv542qQ-00gada; Wed, 06 Dec 2017 15:18:46 +0100 From: Arnd Bergmann To: Chris Mason , Josef Bacik , David Sterba Cc: Arnd Bergmann , Qu Wenruo , Su Yue , Nikolay Borisov , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] btrfs: tree-checker: use %zu format string for size_t Date: Wed, 6 Dec 2017 15:18:14 +0100 Message-Id: <20171206141844.788362-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:geZGOpKm59vTWgaS7A7X+Z13kcnYGWDU/AFCsuZWXL0vuK+OwsB kNyQ7iooFocM83zFJB2NqVEz0jHKdTc1QhhPs8rfm1YSFxjmv83+DTbe86qJtqMziQjwwgU Pkk/e7qPTNUc5YyoZ5FW2wSITJB2FYq8tvXF/OldJ8NnTB9Gj2Sk0j/BkDeZGBX1ldQE5no bkZwIhMfCtS1n5tivdKeg== X-UI-Out-Filterresults: notjunk:1; V01:K0:OdUI0Gc6OVI=:GXOI1Kq3tZ/NPGNdvwZ+fM PRfXmaYzhlfPLhrcTG3oEAnBUCpQheziD2uB45D/IWizAKm8WTv0MAhSP0WXKp95t1iFjo404 hX/jSBf9YsMoxjrL8+L6SFsd4mCg9LvBITK6Zg3hCB/laA098QzEa73AAbB4YROuP549Lx0hz 0xUtVnRShyqHMFGdjCUYGmQx8GHU9aeP5DLokfSe53jo1ladh+o+ThFaQ/R6P9xIDxcfXZUGE 564UCgNMfKP7WIRIggb/RKISN49cY7UlwOmXmYU/1Of71SAxbYsXmO3h3XmqUBxUML+gLKjfl p4HS1tGNbxqnQRrFV0rFpr9OAWmKPIBoJXVGvU21vzFi6vG9z3vgikOuy6KcDumyckyYyRZvP m/GW0V4GPTpc1fk6S9zI5KRADKQojr8D84l6iV3fBxrbjZDiilB5Go5h2pI4n5OlmZhlrJXS+ apT4xPWKUKa6qpHu538L0SClj4LIxG+Ox5JK/uGoKtHuU8rNUJ2WN94Y5I+cgXPwr36IEVWev 8ti5ZtNY/FcmMomwo7DF7k4CEKDNkWqQlGNTvnRcwzAZndJKpeUZoMGm9kFBB7T23hYh23v2d 4z2hnJVHMiEuZ98pQ7wZZp6IheHd8TB4O1LlFxyPJxlZ93+vlWy16HWGdc6DzIUacDO88jb8f Lyvr+Bssu43moXLl/H0gpe2whAzTHiWFtZhqCERH3kYfJwUgfRTkJOoZQpvR0b5q0bqnw1aiP QvZv3KabDqw9Mn6RJba0NXFIL0cswqW5O/JkQQ== Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The return value of sizeof() is of type size_t, so we must print it using the %z format modifier rather than %l to avoid this warning on some architectures: fs/btrfs/tree-checker.c: In function 'check_dir_item': fs/btrfs/tree-checker.c:273:50: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'u32' {aka 'unsigned int'} [-Werror=format=] Fixes: 005887f2e3e0 ("btrfs: tree-checker: Add checker for dir item") Signed-off-by: Arnd Bergmann Reviewed-by: David Sterba Reviewed-by: Qu Wenruo --- fs/btrfs/tree-checker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c index 66dac0a4b01f..7c55e3ba5a6c 100644 --- a/fs/btrfs/tree-checker.c +++ b/fs/btrfs/tree-checker.c @@ -270,7 +270,7 @@ static int check_dir_item(struct btrfs_root *root, /* header itself should not cross item boundary */ if (cur + sizeof(*di) > item_size) { dir_item_err(root, leaf, slot, - "dir item header crosses item boundary, have %lu boundary %u", + "dir item header crosses item boundary, have %zu boundary %u", cur + sizeof(*di), item_size); return -EUCLEAN; }