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 6AA5FC02198 for ; Sat, 8 Feb 2025 03:34:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F10796B008C; Fri, 7 Feb 2025 22:34:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EBE686B0092; Fri, 7 Feb 2025 22:34:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D85746B0095; Fri, 7 Feb 2025 22:34:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id BA5C26B008C for ; Fri, 7 Feb 2025 22:34:00 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 3E244B41C8 for ; Sat, 8 Feb 2025 03:34:00 +0000 (UTC) X-FDA: 83095358640.19.697CA3D Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf10.hostedemail.com (Postfix) with ESMTP id A5EC2C000D for ; Sat, 8 Feb 2025 03:33:58 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=nwTDeFuO; spf=pass (imf10.hostedemail.com: domain of nathan@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=nathan@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1738985638; a=rsa-sha256; cv=none; b=Y4iNI8FKiHqIiixDSZFa3Bg/NNNtzsPdFn4ecwOK6mkfkpnc5CfrB+8feUW8jy6gFofoas aSHREFbVW0edIGMLLA5Ui0QUlHlpPlKQQlTm2PYztfoheMt0g4b3kitiSTUyaOwHB1Yr/D p2EsQdGeUFSB4rEJnpVNVO2+jbM9g2k= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=nwTDeFuO; spf=pass (imf10.hostedemail.com: domain of nathan@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=nathan@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1738985638; 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=jtflEEo5lHvRMpUXaO2nzhz0wQxHTI3DQMZlO1JDT1s=; b=51mLjrZd4CvU8ljAwbEnPinVG4tCrOloWib4aKNGQTI8pXaKeNn7EEz9lOkAskXXHeKtw1 p/gtsK6ToUNMh/SPsD2vGn84CM7cv6QivTx0Q6StOD41JYC0zdvU1luKJrm1CPLHYvCWvP nVjeNybdtfbhwXeKLPyNVimvRpQr0kw= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id E8D43A42663; Sat, 8 Feb 2025 03:32:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 741D0C4CED1; Sat, 8 Feb 2025 03:33:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1738985637; bh=ZRsJz66vWTq4YxYq5nUimSWV0SeHTzic6BwJiuEhDHU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nwTDeFuOwLdSbg4lmTQV0yNt8AcLXVli3KKGIWfqteIcTohzxDYQtdtOjrGgOohfs 4cugzOvuawE0QWX10xdXNOFE7BjV4sfatvKrlq7ziw4w1QeS9HiSpyv+EtPIrGyHg5 8dvpdxmYWCXhy4DgBYpjq9LxQSBSKMeoQnSPxUVVl+djhrKrQGeOIzl5uEG0ksSFIj pXJTf0MReum1+i6KM+wv5os6YKNOJ57xYJGL/+uIEi+7VdNgwcmG++2sJQIGnitabB VBdkgPcmoxQ5//6DsV4vurlzxCky0tKpfGoBACJs5wuNyzGsNb6SCEVTPVFi3nGABy +AS2rwpuwW+AA== Date: Fri, 7 Feb 2025 20:33:51 -0700 From: Nathan Chancellor To: Linus Torvalds Cc: Jakub Kicinski , Andrew Morton , Bart Van Assche , linux-mm@kvack.org, Ivan Shapovalov , Vlastimil Babka , David Laight , Pasha Tatashin , David Rientjes , David Hildenbrand , Kaiyang Zhao , Joel Granados , Sourav Panda , Johannes Weiner , llvm@lists.linux.dev Subject: Re: [PATCH] mm: Fix clang W=1 compiler warnings Message-ID: <20250208033351.GB3305705@ax162> References: <20250131191231.1370466-1-bvanassche@acm.org> <20250207164926.6daeac77@kernel.org> <20250207173813.5081ba76@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: A5EC2C000D X-Stat-Signature: fgn3cmawrs59uqm6c5da3jpbfu89n8ae X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1738985638-517989 X-HE-Meta: U2FsdGVkX19dXmTtnhzny7Nz+Ne1pf+ykRtaWGgC1SfuJqXZ+bZxuRjhCwvplcDkL5Dp1bIsT+IkP3jQWzp5RDTvwJEQzrKDjhqi8lVzVuZmonOrdvQzxKwSt2U/9otrZp22rfBoOSi85M5zIph9ol9p21WCGp/CI2liMR0H+4ihFOCUmMbjv5U772axPjEdWS2NakFdch836ob41S5qf/jz93s/thWD81Dvv053SACCXDrlWLPHFn6MeV5mFh7GQGI/jeWby+virbVGWz5tq4LFC2kv2Y01EXM6BaYDoSpR9+q5fxLLc3VoDwiUeQTIaNIEJAlkAuMgNMaO+Wk3Xw+kIB0SeFD7NTJHH67P2IPUBzMPg+psQEOgVvhLMbfOh/0kQ7F2ObExiVMo+VKDaWfRxS4omWZqFmTGK/pqVmWt/I3KsI3Iby5yjgXqDzJTUPJAzXx/CwoxW08DHpGD3mCiX08asYdaEO/b5NGvYc2NuWlSbZxrCzJC8E7TPiudJyTfHibG3W7edBftqUG2/oCm6w5hLXzk9mCHaEfcakmRBN1rbbPERNUywnzab7Yvx0Avb196XjUTQlcD3mbIPoJjFW5dA6OzT7oQTEAG7YOflGTyDBK21BeE9ZlOiuVHO7gxlbZ6UnlfLJSKzdU3fJvnhhUw+IzBrprAV64SxW6nrz4I4FQRXG5evaeiXNe6PjbonyhwfntVYisJbl4ynXNA/XuWdEjHKQbuJnYEwUlu63inVymukLuaMpFloYZNKOAUyZ1PzV9zoZvaEBe0nuGCd5+4wU4guu46824VZ30yd3VByJyATqclH6/OH+cv/TA4b9w8sJEJMORZHbHp7csisMHwE5naSIzYRdE+k2/LS68HdmA6XKfhXiVji2izu9skjZrLXj8BGq1S7j/7hY6aHHuO0ynJFNqIjPemCO/ozbP+D5TkJBI/fRzANuR+mqTQ3215GDnmToA0ns9 xEQseN9o +Ar0t6WObVBaLL6A9icL83RJM3COSTbRa9FJdszTzGgFq5gboJAUW+fldoh6LPIFr1HIyZ2BBBmnAL8Em9OVxaZ6HQegQLjSFEmQ2nk17ncEYB9rSfF185F1DzPuWetDs+3tvtUYGUoLKHPTUF1Lgxqv/JF2sr5HpDXmOdUwpdp6nUASwK3Sq757ps5PakWK7mEYaVtTWVicmWSETX5sP7f3CnHXiPH8FpGph6JHGXRIqq6l3BMRh72+rhqe3w6XbcOlPCxrOtrTDjQOLcPtUlREBBQ== 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, Feb 07, 2025 at 07:11:08PM -0800, Linus Torvalds wrote: > That said, we may not have *many* of those enum cases in the kernel > (and we do tend to have a history of using long series of '#define' > sequences to do these constants), so maybe the warning is acceptable > if it's a case of "this is literally the *only* one in the kernel". > > But not having clang-19, I can't see if this is a case of "this is so > rare that let's just avoid it", or "this is the case that causes the > most noise for every file build, but there are lots of other cases of > this". When this warning was turned on for C in clang-19 (it was C++ only prior to that IIRC), it was extremely noisy. Some of that was due to the warning occurring in headers that are included everywhere such as these couple of ones but even hiding the big ones, there were still a bunch of locations that triggered it (I did not do the best at hiding all of the header ones because I had given up trying to make leaving the warning on for the default build at that point). The diff to hide some of the really common ones: https://github.com/ClangBuiltLinux/linux/issues/2002#issuecomment-1970004069 The build log with that: https://gist.github.com/nathanchance/971e5abeba504d3017cd6ed4517bbda6 I looked at a number of them and none of them really seemed like bugs to me. Cheers, Nathan