Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1886309lqm; Fri, 3 May 2024 09:08:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWgEtUozmiaBMMNHTOjIx9Fu/xQKH6SEyKzJd1O6weAD5yjVvPigy81KirscDft3oJHf20z1c2FbhuIeGFnTm6JDI1JGoLQSDf6DWvF4Q== X-Google-Smtp-Source: AGHT+IH1GuYnGpa2A43CP8Pag6VGDb+OZSonwhj8XYAOb/BE4Pb4sR4CfoAEaW7Nr3K63e6GXuvL X-Received: by 2002:a05:620a:4042:b0:78e:e45c:cc1a with SMTP id i2-20020a05620a404200b0078ee45ccc1amr3900808qko.73.1714752508081; Fri, 03 May 2024 09:08:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714752508; cv=pass; d=google.com; s=arc-20160816; b=mVjupvmXZVQaQTKpWfrZ77O/6TbSBjSeIPIuu8yDRgLFVf2SGlGHOq+PD3Fev/n/01 uC43apaEXDegvb9yawyAQwOk5BGmQsSmlCChg/Af+8cE1W4FyY60HD2uUFaAMkldz63J jnYiT8iQRXsQ0IbJm8JG+qkPSX6I40ZE9BR3zbgGdhYPVfI8/s54PjVuwsJGpwZpZlfX pY9zOw30pNPlZUaQGy70UCxjh+zR5UtpApq7Q6afiK0UmTBMlB4YOcobpBeKjmm13g/8 QzIGAcgvyDzYZofm0aGt16UXwrVVMTonb4YYSqE79whaEdql0kCK9N3x8pKP45FL2DdO WRkg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=gv9QVfigdjVD0crnDRipmNokaRQrCSMx9GpxZQsccT4=; fh=cNnOUeYY99J3TJOiIz/KVQxSV3nbIPn+qdMTTmK4P44=; b=iDia0nLSnsE7x5i3Qw3VewSn3wmyk7BK63obilIwGjd3c4nKIy/IaDIGHI7EYIS1z4 GF+ffEVi/nizHY5XnbYg1JHzPDuM3AUfDucjhPf7EZ/fcsECIowosODqs9HvuIJ0ag8y MrVaYXkVAdrrQCWEDVTRpRpRuuQnQ42BaiSxVNXMF2p6itOw6aZdTw++R5X4zCwRdLZD R/LEWtHVuVXseNfTQCLnGWgJdMGZvcAYubPXQK79DvHLwVZLf6h0Hbhhaa7hZM8L+yhl pxxItg00payT94yNurnxDir/z/yeYBkfcVtYWaGe7AuUnKIEt9cBcx/ILGxzcE1SVztB J4KA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hDHJj670; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-167872-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167872-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id h4-20020a05620a21c400b0078d53e11b9bsi3419648qka.128.2024.05.03.09.08.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 09:08:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167872-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hDHJj670; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-167872-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167872-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A5C501C20CA6 for ; Fri, 3 May 2024 16:08:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6355215533E; Fri, 3 May 2024 16:08:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hDHJj670" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 87CF4155321; Fri, 3 May 2024 16:08:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714752504; cv=none; b=rPu4t4T8/xVGwWIMgAcCXDg2M71wmKYiMHtXvGXmK5ZiwIMjmitnQ4dYCmY9GzxUI68IBp0aofshX9De9ELrDBbJI3cKse3jvGWwzjhAqhLBPAqt6SBeg9InW4dL9HErvOn8WdKklfhcJ3yn1yez/tlTRGXe3uv15F/SU065TbA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714752504; c=relaxed/simple; bh=Op1fwSHEx5VUMYnhUE1pmFnrDf64oFwBqfLu6MjJiGw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IxPzYmAJldtZO8zgwDF1S0Q4QYO9juqftHVUwg1C9dVw1JSK273jh5wHY9mgU1yCGk+Ff4nv0EjyIwuSxLGKgSeIMyxyvf3RLsvHYzOFdQGwtGw7wu+0mwrk7YjVe6hdvmdbS86iZhB6Jum8feIm80qCDGLlzcLyfe88dIsT4x8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hDHJj670; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C2C2C116B1; Fri, 3 May 2024 16:08:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714752504; bh=Op1fwSHEx5VUMYnhUE1pmFnrDf64oFwBqfLu6MjJiGw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hDHJj670+u4EudbKqjlYrFhMEQ+DkMYCstxBrVboCyhLYRGS0YHQkCoXlQC0CmB/b yOVnRxKraKTtqBMDsOc2e13JJBxpx0FvQgmSu/HFEIXWspIn1oaSjUxxQRPfIItKdc qxtjxZQAUm2azBafIErhdPJvylutd9zIW+Gonbqq+rvkkZaKgukRihbrpKjvuBXfqA y+0oGYHBrgGwMZodjCgeSxGtYy6d7xN0raodKgWt839+OEwU+i+n1PGq64QPlRyVmT 4elwlDcZxOtkxHgL7R4CBZQu3vlvP6c+AHFqJj0ec8kTcDd7mUXwVn+rjHKcA+2lw7 bFy5iBEPazORw== Date: Fri, 3 May 2024 09:08:21 -0700 From: Nathan Chancellor To: Matthew Wilcox Cc: Kuan-Wei Chiu , akpm@linux-foundation.org, Liam.Howlett@oracle.com, ndesaulniers@google.com, morbo@google.com, justinstitt@google.com, linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org, linux-mm@kvack.org, llvm@lists.linux.dev, jserv@ccns.ncku.edu.tw Subject: Re: [PATCH] maple_tree: Fix build failure with W=1 and LLVM=1 Message-ID: <20240503160821.GB3960118@thelio-3990X> References: <20240503095027.747838-1-visitorckw@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, May 03, 2024 at 02:29:12PM +0100, Matthew Wilcox wrote: > On Fri, May 03, 2024 at 09:01:06PM +0800, Kuan-Wei Chiu wrote: > > On Fri, May 03, 2024 at 01:20:32PM +0100, Matthew Wilcox wrote: > > > On Fri, May 03, 2024 at 05:50:27PM +0800, Kuan-Wei Chiu wrote: > > > > When compiling library code using "make W=1 LLVM=1 lib/", clang > > > > generated the following compilation errors: > > > > > > > > lib/maple_tree.c:351:21: error: unused function 'mte_set_full' [-Werror,-Wunused-function] > > > > static inline void *mte_set_full(const struct maple_enode *node) > > > > > > Uh, clang is wrong to flag these as an error. They're just not used > > > yet. > > > > I think it's because the kernel defaults to treating all compilation > > warnings as errors. If you turn off the option to treat compilation > > warnings as errors, they will be treated as warnings instead. Should I > > update my commit message to change compilation errors to compilation > > warnings? > > just don't use W=1 and clang. This patch has effectively been sent four times now: https://lore.kernel.org/all/20220914101829.82000-1-jiapeng.chong@linux.alibaba.com/ https://lore.kernel.org/all/20230217084647.50471-1-jiapeng.chong@linux.alibaba.com/ https://lore.kernel.org/all/20230319132903.1702426-1-trix@redhat.com/ https://lore.kernel.org/all/20240503095027.747838-1-visitorckw@gmail.com/ (this change obviously) Your first comment from the 2022 patch: They're not used now, but they will be in a release or two. I think a few releases have passed since then :) I don't personally care if there is a solution here or not, as I don't test with W=1 (there's enough to do at W=0 :P), but maybe it is time for either __maybe_unused (as that strikes at the heart of the issue) or at the very least a comment saying "hey, these functions are currently unused but there are plans for them to be used, so don't remove them", rather than just saying the status quo? Cheers, Nathan