Received: by 2002:ac8:5349:0:b0:427:7d78:cd45 with SMTP id d9csp272499qto; Tue, 19 Dec 2023 07:51:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IGV0KT2TJXonlnBMT+uhcrwKCvQHdsg7ou9N4Ujn7fhhp/IwmX5TncQiPWY4Zn30Xr5RQBK X-Received: by 2002:a50:f61c:0:b0:553:5a96:8533 with SMTP id c28-20020a50f61c000000b005535a968533mr1428368edn.52.1703001106749; Tue, 19 Dec 2023 07:51:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703001106; cv=none; d=google.com; s=arc-20160816; b=we9CDfzIdnZeYUkJcH9DbAP4fn0qfI9kmUqmX1jmb2Z5YAHsidTYe2uYwbL88HkXIW RWcOnAZ5E98L+wMamWHPJwdqlRCaL9GR9KaY+jAo0+h8FNaowoo9++Iolhv+J2hHMXTb 2MB2fVUcovwY3NehXH+e6rdW2/2LqG298ESzM5DOqR+r0CCpYNDX0xGM4K31p/hbEkZW 9JAcB1VKrkUOQqz1TcArqoRVV2/5ieHFPH7QheLMNUTk41KFPFq1aRjbIt9AhlL5+qOd YfEqXkKlJXmfccxB6g0peD3o6vDbJ0KQX7mYjynTOVKpeuJakFc2cYyhjpGGTypDp3sP OsUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=organization:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=2LGE/lv1GfOMWtgiYD5vXZ2qBEixulcP/Z5eL9R82Mc=; fh=3TGqEH+eF4DshGe+nn+HZ0fNGrbfL6lX+940/JvH3FQ=; b=BbHQ6Y8EoND/Ck+BSCJarjnJy0Yx7RSW7ghGYLqdKmxZmMoetn364AWMbgxZkf/8Kj 8VqzLlCIaNWSdYYqspkfjmyNmolbcyIs9uJuvJdmbFkvJEC+YYT3mjALtEusoKI0XcfO SG1tzQHq0EFvKe4hL+sWo7AlTNY9MUDSML9x7AXCeur7RB5Bw5VoROgr0zEOAVRn1gsP X00hL1f5XftgGCM3qil20qWRPJ51jNt1IwtGZxY+j3yBWbn1XaUZqAB0llw/vntJtClc rIKioJVXFig3YiT1T15c8iXQ5C+krk6fd4qVj6h/Bio6voipr2Y3IuQdwAUZupCsuK3R yhvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-5518-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5518-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id x6-20020a50d606000000b0054c460fbfccsi11122918edi.457.2023.12.19.07.51.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 07:51:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5518-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-5518-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5518-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 661201F251A3 for ; Tue, 19 Dec 2023 15:51:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A12EC1CF96; Tue, 19 Dec 2023 15:51:26 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC9291D542; Tue, 19 Dec 2023 15:51:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=kernel.org X-IronPort-AV: E=McAfee;i="6600,9927,10929"; a="2501826" X-IronPort-AV: E=Sophos;i="6.04,288,1695711600"; d="scan'208";a="2501826" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2023 07:51:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10929"; a="841919777" X-IronPort-AV: E=Sophos;i="6.04,288,1695711600"; d="scan'208";a="841919777" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga008.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2023 07:50:38 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rFcMd-00000007IkS-34jQ; Tue, 19 Dec 2023 17:50:35 +0200 Date: Tue, 19 Dec 2023 17:50:35 +0200 From: Andy Shevchenko To: tanzirh@google.com Cc: Kees Cook , linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, Nick DeSaulniers , Andrew Morton , llvm@lists.linux.dev, Al Viro Subject: Re: [PATCH v3 1/2] kernel.h: removed REPEAT_BYTE from kernel.h Message-ID: References: <20231218-libstringheader-v3-0-500bd58f0f75@google.com> <20231218-libstringheader-v3-1-500bd58f0f75@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231218-libstringheader-v3-1-500bd58f0f75@google.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Mon, Dec 18, 2023 at 06:44:47PM +0000, tanzirh@google.com wrote: > This patch creates wordpart.h and includes it in asm/word-at-a-time.h > for the all architectures. WORD_AT_A_TIME_CONSTANTS depends on kernel.h > because of REPEAT_BYTE. Moving this to another header and including it > where necessary allows us to not include the bloated kernel.h. Making > this implicit dependancy on REPEAT_BYTE explicit allows for later > improvements in the lib/string.c inclusion list. ... > #include > +#include Expected is to get rid of kernel.h completely. For instance, in arch/arm/include/asm/word-at-a-time.h case this should become: #include #include (Briefly looking the same is for include/asm-generic/word-at-a-time.h) And so on... ... > --- a/include/linux/kernel.h > +++ b/include/linux/kernel.h > @@ -39,13 +39,6 @@ > -/** > - * REPEAT_BYTE - repeat the value @x multiple times as an unsigned long value > - * @x: value to repeat > - * > - * NOTE: @x is not checked for > 0xff; larger values produce odd results. > - */ > -#define REPEAT_BYTE(x) ((~0ul / 0xff) * (x)) Okay, we don't back include because we changing all the users at once. ... > +++ b/include/linux/wordpart.h > @@ -0,0 +1,17 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* > + * Copyright (C) 2023 Google LLC > + */ Can be on a single line. Is it? Personally I skip this from the split headers, but I'm not your lawyer. -- With Best Regards, Andy Shevchenko