From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A0F8C4345F for ; Fri, 3 May 2024 16:08:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 46C886B007B; Fri, 3 May 2024 12:08:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 41B966B0082; Fri, 3 May 2024 12:08:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2E3366B0083; Fri, 3 May 2024 12:08:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 0D3276B007B for ; Fri, 3 May 2024 12:08:28 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 6386BC11C1 for ; Fri, 3 May 2024 16:08:27 +0000 (UTC) X-FDA: 82077567054.05.9368445 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf17.hostedemail.com (Postfix) with ESMTP id 9E5EC40008 for ; Fri, 3 May 2024 16:08:25 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=hDHJj670; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf17.hostedemail.com: domain of nathan@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=nathan@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1714752505; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=gv9QVfigdjVD0crnDRipmNokaRQrCSMx9GpxZQsccT4=; b=JsxW9tcoModRFhTZjKKmpRmN4dtFDXb2KE2R6x+1BHItp4Qtz2/TOSYj0K78jSNXT/vzcX SDAFXd0UaGfPuvnwg9dP5HaDaFNLt2AIC4UYw6diKs8GbZqlj5RMhEf0l1XM4ZxjznaYwN ct+S1w7LYXet2wwyqqjzboPHkoUeNmE= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=hDHJj670; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf17.hostedemail.com: domain of nathan@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=nathan@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714752505; a=rsa-sha256; cv=none; b=oFyLFqzkGxL2tvc4wf8tEZb3+EpSzgr372gC3P/OuwBnQbEynIWfrpHNQoYH0tikGQY/It ZKcjBkKvuSeafJHmPT8UokK3R70jl3JfTOS1Y2YQHXGwm9Epp0RV32F8ybWA11vOv4b6NJ spNX8krbpRuxaMJlIbksnHP/vOEr/mQ= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 7510361DC4; Fri, 3 May 2024 16:08:24 +0000 (UTC) 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 9E5EC40008 X-Stat-Signature: nn6yb9w8qnd5sjq6o1befnnm4uhm8rkp X-HE-Tag: 1714752505-471493 X-HE-Meta: U2FsdGVkX1+Yd0Jk4BmpX93SCRZgZM4CY5l8u165FF7tgOTfLowuP8SqMq4g9mxLpDHAiMKZ/JOzmZLY1O/JMs7w+HC2yzRYUhxAEN1dFL6ZdNoIRNnaOAwhUmXMb4h2I/vZ/IqP96XR8CBYuX4GPIAVaeGNkRmGDHQsWqxxJ7Mo+hwSIn6nficu5BlOZ6tndtU1qaqAC7Cpat/LAssJjDySfajXMzoPWnCyHnQSOWFAkWgI2Bfae1BNkDbul4JURz7nexaJg4Xl0lslPr1Mk75Xrvm6JZPhAW7YJ8B4eoXCUiqYZDMkHpQhTR0YcCOlHgKeNQAlFPOqzRoRJ1Xgk7c77CFoLJ1fdtIJYcKDgyxXJexiHmma7RlUmtOw30uk3nCtoRbrCRLUg7/E4QtDlSzNIzkYfek39s8WpAGn41EkvObE/U7k5N3e5iXnWPesfx1QTCJwGByS4PIOXlHlazi+HXq/kGE6EoaChrShAgTuBJtQH6cCS8iz4pDlvDIVeMcuNCtFNtRt+WEfa1XAzEVfh/+fQ1ldTH0pz0itWEPFJvtuzuSBGy23yx7WPREXNTJofVP32PIvryRQtJl1tiCH2STqLix/2dAnm44WjS2MPGuQqsnMdJws9kRH8UKxy+o69yB0N9DG+5SPACG6Xt8YAcdPCZWTGc9/S0FyBWIp/ZBS5X1hja4I97LJGyM4kerjkk5m+cV6F4dIQpi7LR7ggsTAiKrorQbrvPn6/znfNL3vYq6gLy9FqXXStp16dxOP8MQTulC9DoVTJHjmhbITNHL0H8bJWTVD8Fd7OWjOtnLKKoTMkkEU9JshUGFtsgyRtI4cYDCzQ5udIy+0ahxtpd4AjO+YyvndFStMzUbCOySuo6kkOH+xH6ytCB+omFdfYvtTfnaGIJt0UNVo/AaFPVEnhcAYCU5K7Awfuyr3MN5DzjHjKqpMyh+L5Lt7ZQ5WVW13hKYUI3vPGD0 2ktDnLl5 nTFDr2E+jC6PlQ+vBO3Xq9ylVUhxlZBZBYbxcP1sR9wD9uNjestqtmCm+h1euMij3rEUOw6Z4LtmfSp9/BErLQCdHh1znuiulmt6sIkp2wO4GQLmUd/HY8xJtZgs1C0m9pxSzG2dklrooddlJKcvtsuMCSpRj4dpvs16+e28nxI/LXVPwqHvEJEOcydue+yHcyuGBOb1a+QByTWj23Q06SRjmxvRY5PFhtSiskKTVMdMLZyufjF0VP+QrpXNfMWb5+iZaSvdi9BA4VZ2/6wy+Uw5eh7tqysjVwpBrVuMFuFb8isDDjJbqocutL5OdVGRSAuMskx39ikEcpp23sbggt0sGiIWFld04lHuYuAx+E6jaOFFADjE1pan0j9rHjcJf2dioDjelf+5H8MpE0PQ4N2E4YQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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