Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp2942161rdb; Tue, 26 Dec 2023 10:01:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IFhTFiNRmffK6lB+r6Vo8bCVzfL9G7RFSimAM77PAFzu046WFFn/haaFRczsKbk1opfdBQv X-Received: by 2002:a05:6a00:21cf:b0:6d9:9261:a516 with SMTP id t15-20020a056a0021cf00b006d99261a516mr7580792pfj.18.1703613685476; Tue, 26 Dec 2023 10:01:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703613685; cv=none; d=google.com; s=arc-20160816; b=i66DeaVVCuXYkygDBHtlk9tHXUwS+jsHotWqEApgDukIbyZj7mhAJANsVLZJHAUQIf DH/iz5zV0GWb3FyMu3Qry6YZc7d9G2QhzzWP8Aa59biv2YewCFVB8Ikns+bwKAiIzRcn iqxClp/dvc0l929SPHX2dkwFmC8nOsjpTHP0FCDNQCTLzMZiXs0yPgHm5pgvAmZrTKi3 kGXupetarZxUww8Dl5vk4c75Jb87aOS4J3ldiz4FVSkQTfVokyKaeUZS7mRhLJfbTSyS 632c+WsMicmuN+lYC6eKh/vI+Sv9tIgOtSruF9Iw+6bg/1WJ8W7T1Sgaf6+hJJJHgJ0a klZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=GQnopqwXCPJwf1o31D0QkbeUw9iOW+EHq9+aREsG9fw=; fh=Ct44eMeJTK9DQ3BTqWJblkRHb6om26y3oSdBFVTe/+U=; b=VIL9mf+zCjxNbOIxp+7W6w5I3EQnJCIytkP2s2IS/f7jgcBi14ffLGPs4zCnm+YsiU s1IWWgQYGc7dF0xDhDyMq3qCdj3AfgspD1a5eHa9ILWFmMekgxU6tzf9QFHteYOl7Dmp RQ3w5b8DMplvuQnYuKT/uu7avNEuq9Mziw3tRKSMREZC8q3iN7qNJQpt2tZnmwZRO9Ne nsEcs4QhnHepICsVrbjOB9jz5eqXSaAHgKnO1RkI9SJO25cy5DOjf/A5tazYABr33HQf ILzea+/qKkVgWCXmRwXk8WSR44hQXiD7N8gUjRUxzwDWejFZZrri8xpNy4lz9y3aeCMY yB6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="f73C2U3/"; spf=pass (google.com: domain of linux-kernel+bounces-11603-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11603-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id a127-20020a624d85000000b006d93b1d9b38si6797307pfb.226.2023.12.26.10.01.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 10:01:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11603-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="f73C2U3/"; spf=pass (google.com: domain of linux-kernel+bounces-11603-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11603-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 6321A282BD7 for ; Tue, 26 Dec 2023 18:01:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 75AD4537E6; Tue, 26 Dec 2023 18:00:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="f73C2U3/" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 62F6C51C32 for ; Tue, 26 Dec 2023 18:00:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--tanzirh.bounces.google.com Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-dbdb46770d7so5562076276.1 for ; Tue, 26 Dec 2023 10:00:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1703613652; x=1704218452; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=GQnopqwXCPJwf1o31D0QkbeUw9iOW+EHq9+aREsG9fw=; b=f73C2U3/jNohZsnmPU/1qJJSEHwpxbCFXOoE9tPRapD5CwVVDo0yHg+mM79FLkOWNI 4mR58BHVjKgFv1TKAYARakV188mPY/1ccQJb3TdP4PIAJKozZJJ80uVli1e18KP5rN68 ty6wSj731PBpSLR9EGyZQ1AkjqVHqanNjMHwo5V/cZTkBH8uQA89d0R+reqchBdfSkbT nAV0K9PuFsyioln/BtGO6nWGOJvDXIFYXMq5rUad4es2lHZNN4TE/ATbzI06u7RQ+Obp Ivf6V4fh8lC5n/vtF3qkpam/aESr4vLiaEho8QfFu5ZtekC/EG6/zEsBUYS5F0DohQy7 TdEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703613652; x=1704218452; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GQnopqwXCPJwf1o31D0QkbeUw9iOW+EHq9+aREsG9fw=; b=c6/8qdKFjfSBlx5R2Z6QItj6PlqYkyNutEt3Y6dDljU86B8m/i0NLdkPMarcwzSfV4 Bc/Brt7uUc1P9JGpGzyiLiN+uaSU6Z9tU2k+QNTVpp0CVGDWg2sCGDc67GtiR0sP1F3U iMLOC9d55RO0Hj8vhwL7xYVZM+DGnW1DsY4DHaga2yt6WOVJbgNuyxg/rjIbbz2L72id mdplGjBWjgq5gVjDDdFa0hDuOeoNwWMgbZoJgTQz9HZwO8h1YbzAMi2UVGwBAfI8DYmE fTOe2Ex64kUQBT/qdDTHZ5/ltjFJABebzYmDQUr39ihjAfzksKB53glRXOdHl266m7Id cjaQ== X-Gm-Message-State: AOJu0YwmJxwpMX/6IkHuEHKfHgJt0xClq3jr1vMTjBM6mrD/fFzsPZTu Y6h0Iw2ezHl6bqls+OalJOkmTj45On2OFQXcs0c= X-Received: from tanz.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:c4a]) (user=tanzirh job=sendgmr) by 2002:a05:6902:1369:b0:db5:4692:3ab7 with SMTP id bt9-20020a056902136900b00db546923ab7mr2904081ybb.8.1703613652544; Tue, 26 Dec 2023 10:00:52 -0800 (PST) Date: Tue, 26 Dec 2023 18:00:01 +0000 In-Reply-To: <20231226-libstringheader-v6-0-80aa08c7652c@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20231226-libstringheader-v6-0-80aa08c7652c@google.com> X-Developer-Key: i=tanzirh@google.com; a=ed25519; pk=UeRjcUcv5W9AeLGEbAe2+0LptQpcY+o1Zg0LHHo7VN4= X-Developer-Signature: v=1; a=ed25519-sha256; t=1703613647; l=1528; i=tanzirh@google.com; s=20231204; h=from:subject:message-id; bh=kLkju4pFci+nx2b0Vi+mSe3j1L2n+dGn+lmNlbPb2hw=; b=mnCi82pkDQhlhIICzaZ9DKF5LW8Zyzd5r/uBAp0bJK6KM0spwTVgAqlizK/vym/fbXNq9suqF X+rsoO7J6/2AhGVmTzCIFtKYKnxLFv7kczzhqPaEYO9mne7MtTmJCDp X-Mailer: b4 0.12.4 Message-ID: <20231226-libstringheader-v6-2-80aa08c7652c@google.com> Subject: [PATCH v6 2/2] lib/string: shrink lib/string.i via IWYU From: Tanzir Hasan To: Kees Cook , Nick Desaulniers Cc: Andy Shevchenko , linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Morton , Greg KH , llvm@lists.linux.dev, Tanzir Hasan Content-Type: text/plain; charset="utf-8" This diff uses an open source tool include-what-you-use (IWYU) to modify the include list, changing indirect includes to direct includes. IWYU is implemented using the IWYUScripts github repository which is a tool that is currently undergoing development. These changes seek to improve build times. This change to lib/string.c resulted in a preprocessed size of lib/string.i from 26371 lines to 5321 lines (-80%) for the x86 defconfig. Link: https://github.com/ClangBuiltLinux/IWYUScripts Reviewed-by: Kees Cook Signed-off-by: Tanzir Hasan --- lib/string.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/string.c b/lib/string.c index be26623953d2..06d9b46875ef 100644 --- a/lib/string.c +++ b/lib/string.c @@ -15,19 +15,20 @@ */ #define __NO_FORTIFY -#include -#include -#include -#include -#include +#include #include +#include #include -#include +#include +#include +#include +#include +#include +#include +#include #include -#include #include -#include #ifndef __HAVE_ARCH_STRNCASECMP /** -- 2.43.0.472.g3155946c3a-goog