Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp636769rdb; Tue, 5 Dec 2023 15:47:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IEHOtct5874GOXCVgLrRW0FGiLbmguU821DwJEt95OLCZN332Kp7szWx93DDuQAQAGeYNzm X-Received: by 2002:a05:6870:f811:b0:1fb:29f8:20eb with SMTP id fr17-20020a056870f81100b001fb29f820ebmr5441029oab.72.1701820036667; Tue, 05 Dec 2023 15:47:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701820036; cv=none; d=google.com; s=arc-20160816; b=fWh2THMGaBLzbygp85rPf0qZruT4dqprSbEegomMZxWCo0RsPayDCjhOX0L0591po1 j5hX/zg+csDeYZ7nosrTys8uJhSxdfjz4kxQQFfGu4xalLGWfU/024f0kzcLUc9rPYbs A3aAuIBZJ/HlhvhRwXzv/EZsb4eJhQIqqqBsDVokaD8yHXgr63s8umdfCJVHLyXLItrQ CBp/iR/9VWDixn5VAtyvuA0PN6QFMnRe66aWjjMsH766lSm1pgiJOieasljXFWcRl7rH Tzg5huw5JmgHJpQ2CAtuxImbowUifqUVopUYt1xg7lO/AtaLiNg2roB89LlJipvP7+x/ A1qA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:feedback-id:dkim-signature:dkim-signature; bh=v1AF7u8uyhL5eTCK0aLokAy6KSNNe4qNX9hwmxep6io=; fh=/SqMT3xBLd/1vcciXA3y7sVtuJspVt/IITUDPxkmca4=; b=Ct0MarvajBd2hJ3lOQJoK66+4ecCmfnn8UdaKoGPCeoqv3hmhEnhb33G2WuF4J+nh8 Val/8pFVMH6i4QBhns6pcDnA0RDvJoLGamApYHIgbVctLLoGuQiSWhnHKakcMl5hsTWs Ea1U5tmw69NyyJO8XbdTf1GZBAubp62QKg0NU60Iw7CVQgFu3Xwxfr0olU5JndaGBCpG Veu04wNb0znA1YwwXrXFzXU15XIxrgcmuNDKOuf12xIGNy3N6euYr/NzfgBXPHm5C3bA MG12RKOwq2tH0GJK8aJgn0l4kTDVFsO+NnpZZ8zFBKDm7bjeHKrkfGTLyiMXB+IFmcmr gRSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kroah.com header.s=fm1 header.b=nKkQEoBF; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=bBb4xJ6D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id s17-20020a632c11000000b005c66415a758si6125246pgs.468.2023.12.05.15.47.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 15:47:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kroah.com header.s=fm1 header.b=nKkQEoBF; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=bBb4xJ6D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id F34F781F843A; Tue, 5 Dec 2023 15:47:13 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346571AbjLEXrA (ORCPT + 99 others); Tue, 5 Dec 2023 18:47:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229591AbjLEXq6 (ORCPT ); Tue, 5 Dec 2023 18:46:58 -0500 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18D8C122; Tue, 5 Dec 2023 15:47:03 -0800 (PST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id C06CD5C0099; Tue, 5 Dec 2023 18:47:00 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 05 Dec 2023 18:47:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1701820020; x=1701906420; bh=v1AF7u8uyhL5eTCK0aLokAy6KSNNe4qNX9h wmxep6io=; b=nKkQEoBFCEngX8kMNRRFmVuttVFB1DLZ7o+9DXrTBtsmwB5Iz1Y tPVAjWSj8NXpHiGfap+IjroN2uT3B8fVXJhLk/+M1Unb5B3+uLETyQuax1Wv+q+t /okMrQbBvy1qcu2PAztdw/nsNi5I41FLPQ5zrFpcyjWgxVrbwjkRqGMJX/Pw6EIu TkBwpaXcIuFILIaU9V/pVg7Jr17YxI9XlOThRj6Qv5dfOtyK8ngvw1sZs41VOfFp DCWmcHHNY7S2AakMHTYZqfpS3YwoKf9hxlwiCuH8kSgM+rK56BBAztTVyA5jpO71 PpDNkso7KhZ+evVGEF/vvy/id2yVqDySOew== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1701820020; x=1701906420; bh=v1AF7u8uyhL5eTCK0aLokAy6KSNNe4qNX9h wmxep6io=; b=bBb4xJ6D+VfjxbfscIlwlcKLH6erIAl59Jjl51+g4B825FQh4aQ EjBIbZbofeuM+xeVMmZXmVCHgR9G7aLzPXpbIUDyrprcK9X/LeBz1OVsfT9GMk32 xh0UsSWuOcIH9v8SGhX6IYcL6DjFA/25sEBYJelozqvx9BG0eLORsJhXBBapSFlS i1y+tZMu1HdcwR10apfb/VJ2ZzAesAH7B+OXGXHSiQnaVW5QdZuR+CV+XnW5evHb WyIOr/T+hPCctGPXHp3aensKohAjJg1NqHuNkEbIvSlN+Bnw42Jfl9zN2cfnarTl LpShoSKvmi9M6bVU32GrVdvyJIb0d6SYV9A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudejledgudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggugfgjsehtkeertddttdejnecuhfhrohhmpefirhgv ghcumffjuceoghhrvghgsehkrhhorghhrdgtohhmqeenucggtffrrghtthgvrhhnpefgke ffieefieevkeelteejvdetvddtledugfdvhfetjeejieduledtfefffedvieenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvgheskhhroh grhhdrtghomh X-ME-Proxy: Feedback-ID: i787e41f1:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 5 Dec 2023 18:46:58 -0500 (EST) Date: Wed, 6 Dec 2023 08:46:50 +0900 From: Greg KH To: Nick Desaulniers Cc: Al Viro , tanzirh@google.com, Kees Cook , Andy Shevchenko , linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, Nick DeSaulniers , Andrew Morton , llvm@lists.linux.dev Subject: Re: [PATCH] lib/string: shrink lib/string.i via IWYU Message-ID: <2023120657-henna-spongy-9ef6@gregkh> References: <20231205-libstringheader-v1-1-7f9c573053a7@gmail.com> <20231205213807.GE1674809@ZenIV> <2023120608-ivy-snowdrop-890d@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email 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 (morse.vger.email [0.0.0.0]); Tue, 05 Dec 2023 15:47:14 -0800 (PST) On Tue, Dec 05, 2023 at 02:14:55PM -0800, Nick Desaulniers wrote: > On Tue, Dec 5, 2023 at 1:59 PM Greg KH wrote: > > > > On Tue, Dec 05, 2023 at 01:51:10PM -0800, Nick Desaulniers wrote: > > > On Tue, Dec 5, 2023 at 1:38 PM Al Viro wrote: > > > > > > > > It also breeds includes of asm/*.h, by the look of the output, which is > > > > not a good thing in general ;-/ E.g. #include *anywhere* > > > > outside of linux/uaccess.h is a bad idea. > > > > > > It's not clear to me when it's ok to #include . Is there a > > > convention here that I'm missing? > > > > General rule, NEVER include asm/*.h, there should be a include/*.h > > instead that works. So much so that checkpatch.pl should catch this, > > right? > > ah, shoot, I was showing Tanzir how to use `b4` for patch development, > and forgot to check this. Indeed it does. > > I can see how the check works (scripts/checkpatch.pl L5881). Decoding > that will probably help us improve the tooling. > > > > > But of course, it doesn't always hold true, there are a few minor > > exceptions, but they are rare. > > $ grep -r \\#include lib | grep asm > > shows quite a few exceptions, and just in lib/. > > For example, lib/math/int_log.c includes asm/bug.h. Is that a case > where lib/math/int_log.c should be #include 'ing linux/bug.h rather > than asm/bug.h? Probably yes, but we don't normally go back and take coding style fixes for old files like this as it doesn't make much sense to do so. But, if you are cleaning up the headers for large portions with the goal of faster builds, that's a good reason. Good luck! greg k-h