Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3691818rdb; Wed, 13 Sep 2023 22:32:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEgGb9OZUA1ELSr3dI0v28oK+LCiURZeaqFN2LxLfL0F+g+BA/vRALgssq3dlhctpFqrhsr X-Received: by 2002:a67:f8c8:0:b0:44d:590d:28a6 with SMTP id c8-20020a67f8c8000000b0044d590d28a6mr4672613vsp.27.1694669568909; Wed, 13 Sep 2023 22:32:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694669568; cv=none; d=google.com; s=arc-20160816; b=cLRQ6atMWUaB6Gpzhu7fJAF8HWzPnGZQh1ghQYmgBywWZTtU4QCgZoPKsyT3UH+K0O 1zrNaf3lxqOeon16QR1zzR3PNYatdPcjHotvsCNGPBp2isFa1lLxZ8ffRqrbb2QtVA0S Sh/Q9APJcx1C0EipIq166769aT3p/nnU3w8A7wsHHR8FZWj3/Qto7D2iP4LM7hIPywSi qsqY6xvazadpVklWk1iXLMtXcDY3TtrXr37ADBRI2AGdTVddhFXrNEIF5fvpA48R+tKS ohRns/wSm0CLwwfXRxEyJiayx9l2mhh0g7HjalGoFSaIUw4H0rz/kUfDZKuyKzuQ57lk uxMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hS6LHZP97enWTuQrtj4p55fJQ0mnk4aMtCPKI4xtC9M=; fh=wDmW3MygM6z458EHrOQ+wgmpjHiSULaiIug1BUWvUok=; b=x8s5KV4b61ioOKYIRHViD3wMNoyQ/wOEHLxiTPiovyy5MEDhbBJUX+LCHYymmPQ3nR PLWwYESQjDYEkaQgyUoSccrko8FegLPkxGhowlSiPRZ6PRbNYLATAkudJmPEuxMZQeM+ JySbs1G9hS98LYbXb/CRQFFAeqlRs1YUJ5R4lij2YfHE89z19aKOBQRPg5F4j20VqR24 xkiMYX2CLXyZ4xXpEy53/GNVKWitB9sq5eP/wMo5/C1OVluR0r5qGn3sCEC5XaE8/Vt7 hvozy4x6pc1I/FPCzk7ZoQ8hnev+aYYrm6vr1dpty4x9SRSif9Z5w+OqlLbjSPeowXnS fkcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=18tlNagW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id bk13-20020a056a02028d00b0056418c0864csi736053pgb.456.2023.09.13.22.32.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 22:32:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=18tlNagW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 5F929803DCC5; Wed, 13 Sep 2023 14:46:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229543AbjIMVqJ (ORCPT + 99 others); Wed, 13 Sep 2023 17:46:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229743AbjIMVqI (ORCPT ); Wed, 13 Sep 2023 17:46:08 -0400 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2A821739 for ; Wed, 13 Sep 2023 14:46:04 -0700 (PDT) Received: by mail-io1-xd31.google.com with SMTP id ca18e2360f4ac-7927f24140eso9661039f.2 for ; Wed, 13 Sep 2023 14:46:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1694641564; x=1695246364; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=hS6LHZP97enWTuQrtj4p55fJQ0mnk4aMtCPKI4xtC9M=; b=18tlNagWct2lJErMpBBze8hACFvX5AZfJLqUoJDTdn8+tzMzPrIui3pb2PRkgj3YRu f3PuBDz4ls1YMRvPhgpSyYyA6cuJ4I5XNaR6KVrZiBdpZf4zJxTuT43MBLxiREBUSS0h n0rMasvjPs+aSvU1ZoLuE4EJrbCDGYGXaOjaTabw0jAPqvNi8OB2Zs35x0jwYYoeZL1t GCazIk56jwrycpvcVMZDZuY4cmhHxFrFJYFGDTEOghy3vcv022pDC3ofYa/CDup4TApO zsqta+wTSCB6mC7WWxEw7SwfhbeBOm48l4Kvz/qeKWRo2I6tLda2b1MaCpapl6aCnH08 4F2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694641564; x=1695246364; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=hS6LHZP97enWTuQrtj4p55fJQ0mnk4aMtCPKI4xtC9M=; b=V7pPtgwR96A99sRG7MGfP41+ZBXL4WnVrFwzQEgGdFKoAE80AWpZRq12YpRPqkh7gY l2Yd++BR3VyrandtaID5+fSl+9x+jIqnwkCWpRFeQ8iXAO9NfI4N9mYSfNqxY/BaP2bD X2bkCt0i/zBvELGhTCPMeikbQfCDzLReH37VSqmFOTpLG3Adr44gIsaFYes7goI18Vr0 24TKiSOEnEsi1Md+FyNzPjzsfAQslzBhQ0+cWpf78GCuwkWhuBiBkOkPHmexl6nLC5NL juo0Ubls/lcQEmqmbn2adKb/oLAnkNbMJpnTw8ZK3+8H3TgAEhxMmehILe7TjsOtXGa/ fiiA== X-Gm-Message-State: AOJu0Yz6FQeCSew2buelE5kkayBji0zbqCKyDqjGLVrVB/zYSIKJ8lzN AVrjouDTAcK7m33uiV3RsYCNPg== X-Received: by 2002:a05:6e02:214d:b0:349:9af9:d412 with SMTP id d13-20020a056e02214d00b003499af9d412mr4794802ilv.0.1694641564057; Wed, 13 Sep 2023 14:46:04 -0700 (PDT) Received: from google.com (26.103.132.34.bc.googleusercontent.com. [34.132.103.26]) by smtp.gmail.com with ESMTPSA id f15-20020a056638118f00b004316bbe1d4csm24843jas.78.2023.09.13.14.46.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 14:46:03 -0700 (PDT) Date: Wed, 13 Sep 2023 21:46:00 +0000 From: Justin Stitt To: Nathan Chancellor Cc: kent.overstreet@linux.dev, bfoster@redhat.com, linux-bcachefs@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, patches@lists.linux.dev Subject: Re: [PATCH 3/7] bcachefs: Fix -Wformat in bch2_alloc_v4_invalid() Message-ID: <20230913214600.y3eo3emayljnxfuy@google.com> References: <20230912-bcachefs-warning-fixes-v1-0-a1cc83a38836@kernel.org> <20230912-bcachefs-warning-fixes-v1-3-a1cc83a38836@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230912-bcachefs-warning-fixes-v1-3-a1cc83a38836@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 13 Sep 2023 14:46:11 -0700 (PDT) X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email On Tue, Sep 12, 2023 at 12:15:40PM -0700, Nathan Chancellor wrote: > When building bcachefs for 32-bit ARM, there is a compiler warning in > bch2_alloc_v4_invalid() due to use of an incorrect format specifier: > > fs/bcachefs/alloc_background.c:246:30: error: format specifies type 'unsigned long' but the argument has type 'unsigned int' [-Werror,-Wformat] > 245 | prt_printf(err, "bad val size (%u > %lu)", > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > | %u > 246 | alloc_v4_u64s(a.v), bkey_val_u64s(k.k)); > | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ > fs/bcachefs/bkey.h:58:27: note: expanded from macro 'bkey_val_u64s' > 58 | #define bkey_val_u64s(_k) ((_k)->u64s - BKEY_U64s) > | ^ > fs/bcachefs/util.h:223:54: note: expanded from macro 'prt_printf' > 223 | #define prt_printf(_out, ...) bch2_prt_printf(_out, __VA_ARGS__) > | ^~~~~~~~~~~ > > This expression is of type 'size_t'. On 64-bit architectures, size_t is > 'unsigned long', so there is no warning when using %lu but on 32-bit > architectures, size_t is 'unsigned int'. Use '%zu', the format specifier > for 'size_t' to eliminate the warning. > > Fixes: 11be8e8db283 ("bcachefs: New on disk format: Backpointers") > Signed-off-by: Nathan Chancellor Reviewed-by: Justin Stitt > --- > fs/bcachefs/alloc_background.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c > index 540d94c0cceb..67e73864823c 100644 > --- a/fs/bcachefs/alloc_background.c > +++ b/fs/bcachefs/alloc_background.c > @@ -242,7 +242,7 @@ int bch2_alloc_v4_invalid(const struct bch_fs *c, struct bkey_s_c k, > struct bkey_s_c_alloc_v4 a = bkey_s_c_to_alloc_v4(k); > > if (alloc_v4_u64s(a.v) > bkey_val_u64s(k.k)) { > - prt_printf(err, "bad val size (%u > %lu)", > + prt_printf(err, "bad val size (%u > %zu)", > alloc_v4_u64s(a.v), bkey_val_u64s(k.k)); > return -BCH_ERR_invalid_bkey; > } > > -- > 2.42.0 >