Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp588682rdb; Tue, 5 Dec 2023 13:57:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IGmFOuF1+1oL4hJC+CneB/GNi9QihznNlN+JgU1vcpt41SZk5y0wH8FF2Dbl1XORuJ6c0ll X-Received: by 2002:a05:6a21:6d90:b0:18c:e9e:e17c with SMTP id wl16-20020a056a216d9000b0018c0e9ee17cmr7748429pzb.25.1701813470115; Tue, 05 Dec 2023 13:57:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701813470; cv=none; d=google.com; s=arc-20160816; b=pe2RJl6JRRfW77ltLFaATyD++Aj0yRSt7OE4ViQ+SJn6WnYaNhdS0lzHfTfTZNFV4a qNYUBnhNfJBs8R7GnLYynvPKsxqeD7a7Yz+jmtcVBqX1RmIjPVj8mlTFrvL4NuvoZmJm 1552aSASRQZwTA5SR6nQf8xAqK7ofU7GuFBD3za5BWpYCWholjTgABAmn6abVX2dPw9/ JE0AoG8miHTcJRnF4b4OPBX770Hj3RFNCdvY65rMmc2omDv/GokPUpwETM6CAiWzuza5 BTPBk414nvbxwGdqRj5/q25C87FcVjzL1TK9a3BMTFt1ZubLEaviilAGgl21Dk02ktTe VEjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=4R8XorxoFVOpovwERfSrloKkn2fMEhR5jZoBji1BSzM=; fh=wQ/MfPyor7VZuyNTiU1NVMIIKKxAKr5Rx2v5O+hhMwg=; b=iWaDmMqq0xiR+0OBHcmLZ48VeIeDgOKMU9qb8yB7Ozqb2QOsEGlCedQQZ3LpIwblmk QOkCFioPDjSzZeACBl8F1oxZvm4thH8pYy1yoosNl/kOMVsxI45IZMT0nhtoyv8/8Pr2 77XUI34iKRrv854ILHtJk0SiEV1xhe65ZGdD1lUFguM6YyOVjFTY5HmNGJDNlU/yrLQt fs9hoBZOzC1+/+gt3Pk//s5x4hUNf4fjlCfYqi5FV75q/GrMay02NA+wliXc0NVO2OQx 8IQKgEQAFjElXBM6uxurR1d+6MMph6fQHXKk8m/HoxC/xzGbrIDyR55LWqw9YdL/5/Yk bimQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b="qlh/FNeD"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id y4-20020a056a001c8400b006cc01c90d31si10253007pfw.312.2023.12.05.13.57.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 13:57:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b="qlh/FNeD"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 5625E8032A3F; Tue, 5 Dec 2023 13:57:47 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346287AbjLEV53 (ORCPT + 99 others); Tue, 5 Dec 2023 16:57:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229591AbjLEV50 (ORCPT ); Tue, 5 Dec 2023 16:57:26 -0500 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 801961B8; Tue, 5 Dec 2023 13:57:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=4R8XorxoFVOpovwERfSrloKkn2fMEhR5jZoBji1BSzM=; b=qlh/FNeDT4RM5b8OO4gTtNwyyw Yj566rfENDUFrZyrSODB7/RDqkMAoxkYS6Kqmvz/6ib39OUcGVHBY2AdXtFHtOrWZMpAmntVEYmeq Q4ox4UkGCyDPct/YjeoqTVzAak1qLHfUSr9eHYzJgCGeaSv/ofdJavh6WHUxRUviF/KOMiAeXuHxx cjvhQlTkXKiQ53swhQP37deCDEWQT51eQYoWRVjm+ZboLMI1xvqJT8iHwcV73gQGDV35Gccz1AUGz LGYZmNwp1qXNNKD2M9l634UMZw0J2f7EEHy8VVTMz28+ht0YI6Xh6xz2sEm6PBrlsNsU6Kl7peIep 16Q8aXKQ==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1rAdQ1-007Tjl-1a; Tue, 05 Dec 2023 21:57:29 +0000 Date: Tue, 5 Dec 2023 21:57:29 +0000 From: Al Viro To: tanzirh@google.com Cc: 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: <20231205215729.GG1674809@ZenIV> References: <20231205-libstringheader-v1-1-7f9c573053a7@gmail.com> <20231205213807.GE1674809@ZenIV> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231205213807.GE1674809@ZenIV> Sender: Al Viro X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 05 Dec 2023 13:57:47 -0800 (PST) On Tue, Dec 05, 2023 at 09:38:07PM +0000, 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. Let me elaborate a bit: Consider e.g. a situation when we have linux/foo.h pulling asm/foo.h; among the things declared there is foo_bar(), which is identical in 18 instances of asm/foo.h (out of current 21). At some point we notice that; the obvious approach would be to have 3 unusual architectures have their asm/foo.h define _ARCH_HAS_ODD_FOO_BAR and put the common variant in linux/foo.h under ifndef _ARCH_HAS_ODD_FOO_BAR. Except that any file that pulls asm/foo.h will get broken by that. And something like your tool might convert the users of linux/foo.h to asm/foo.h - all it takes is using only the primitives that currently happen to be in asm/foo.h on all architectures. This is not an artifical example, BTW - look at the history of uaccess.h and checksum.h...