Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752348AbdLGAc5 (ORCPT ); Wed, 6 Dec 2017 19:32:57 -0500 Received: from mout.gmx.net ([212.227.15.18]:54894 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752150AbdLGAc4 (ORCPT ); Wed, 6 Dec 2017 19:32:56 -0500 Subject: Re: [PATCH] btrfs: tree-checker: use %zu format string for size_t To: Arnd Bergmann , Chris Mason , Josef Bacik , David Sterba Cc: Qu Wenruo , Su Yue , Nikolay Borisov , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org References: <20171206141844.788362-1-arnd@arndb.de> From: Qu Wenruo Message-ID: Date: Thu, 7 Dec 2017 08:32:04 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20171206141844.788362-1-arnd@arndb.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="WOVne66d7EDv24WRx0t0thDtAeGuHDWk6" X-Provags-ID: V03:K0:mzR8A5TNcRDUv9TNUG2KWU9WFpd1MqlEjIl1xripUCqknCQn9Pf 26DfviW2KwfbCXab9TYtVrLHuE5bxeYedEe9y6eR17FZRwj9OtskMIcKehhgL4AXSpzVTaI 6/S4rZRC79LeIFI8PbOQAjJNEaqEm+W2t3ax+sjG1fpkO37zT6ji2eI2Zqt3/72pqYETX2d n/uZGdukC+s10P9bUqHQg== X-UI-Out-Filterresults: notjunk:1;V01:K0:R3y9GgHN3IU=:4I7fcTlj3+CB3BfKbY7Lvk R8+JOF9zp6qMlXxraMjISo7CuvLPbjQswUQfEgkpiqLF3CtpLI6sgOfYlb9MKg9aiJ19lf9c+ WeOY28Cm9RUdMaCieL0DNThduQ1O4gQppPNZvaw+Ol6ed1/PWfe4UoRjTYxF9wCRqwbPcceVU o3FiBKI09Wd9MGUx7a7baieiCPdwo+1E4sXduKHQiKSD0M+7D22+WK5o0Enu+wbd10wEYPtbp x1jpBdMXleNfH+TYO/0mUMedGImIGvrD+LL3XFRUHYXQnvPYLXuU+HZaedMsllmpAbzqXG2iN 7vJplTqRZUEgtDu+GE59AmGZuPnKmK6V75MpNTQmKtmAL54THCDuET3oC1wncGBrn47bPxBX+ 8h6n8MGQ5of4CoAwGeP2YNsSjKfuroFh1ESolkk4Nf9yx57l1dHv67TfnQrNDWlgjjTmH0e5b hOz6dISuuHzCNkzIlUv0qIZCnpPqS0oFsLQreg/4vPl6fcwq2KHJhVekBemJ59YopFpNyMjh1 bGlCjFBp/tfufd1LYGHzjTTct+W5fTVauzsqKMXWEu6KouJxsldqp1ssWXcCHzFFxUyKX7iKR qNhizzSYS3SW6u6s+juUC/444dhqLGKF/3kA354XvU8/8TJI+G8H0IVhG1Z2oReunDl6d4Rp3 TVlNDXCl5CEMbjZeQ9JGhb17/6sPucORxx1aYpyl5CjOxbIFBD0NSaaz9lzv2C98vyQzxutti 0MCriQ/3mmUsoIzqKi52j0srLJXz8HsYr9aUTv+HF00wB3PdKvwBW7qUo60WStb0y08wV91Z/ N1LG2AKGPcvvv5CAJqR3GKGq7JieA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3145 Lines: 84 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --WOVne66d7EDv24WRx0t0thDtAeGuHDWk6 Content-Type: multipart/mixed; boundary="xh4mvJ0Bkvg2ew2c3FiVpHwoqCN4d204b"; protected-headers="v1" From: Qu Wenruo To: Arnd Bergmann , Chris Mason , Josef Bacik , David Sterba Cc: Qu Wenruo , Su Yue , Nikolay Borisov , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: Subject: Re: [PATCH] btrfs: tree-checker: use %zu format string for size_t References: <20171206141844.788362-1-arnd@arndb.de> In-Reply-To: <20171206141844.788362-1-arnd@arndb.de> --xh4mvJ0Bkvg2ew2c3FiVpHwoqCN4d204b Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2017=E5=B9=B412=E6=9C=8806=E6=97=A5 22:18, Arnd Bergmann wrote: > 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: >=20 > 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 i= nt'} [-Werror=3Dformat=3D] Any idea about which architecture will cause such warning? On x86_64 I always fail to get such warning. >=20 > Fixes: 005887f2e3e0 ("btrfs: tree-checker: Add checker for dir item") Reviewed-by: Qu Wenruo Thanks, Qu > Signed-off-by: Arnd Bergmann > --- > fs/btrfs/tree-checker.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > 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; > } >=20 --xh4mvJ0Bkvg2ew2c3FiVpHwoqCN4d204b-- --WOVne66d7EDv24WRx0t0thDtAeGuHDWk6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQFLBAEBCAA1FiEELd9y5aWlW6idqkLhwj2R86El/qgFAloojAQXHHF1d2VucnVv LmJ0cmZzQGdteC5jb20ACgkQwj2R86El/qi6Wwf/Yua2tI7Wky7GbeY+PxTWK2th TGAB51XihT39TQycGuKyQKp7dJx6LS8hFlX5uJHTnl2NcsewTfM/D3/VunTJLqcf gCn7D6kOwmTfrkPJB/nqzi2w/nwM5D9eAmWtmnrQtuSzkgOqXafDHK7Z2zKykdEC r6UZsr6n2FYXK4LgtwU3tw+lT5KbculPL0MMdaSF3cQ7hoUh+oY8YAYiiAHc9TaN 2mYhnOn8UhtyuQu0+VWGLvfpGV/LtyaDlgg4FkWH8vQ2++AibFbHOThqqpkxZSme TvTJn32NyoQ2l25I2wEJqlBq5XgmTPTk3scVjLdypC8yvpKbdRYhmm4YoaoY+Q== =0fbR -----END PGP SIGNATURE----- --WOVne66d7EDv24WRx0t0thDtAeGuHDWk6--