Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2172270rdb; Sun, 11 Feb 2024 15:20:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IEfg5rUXcxNuMIIiU/kOyOxgIoP+cSEClgD1u9/qwzrvJdApN42bC0xp9VM26Uc91dwmNh2 X-Received: by 2002:a05:6808:18a9:b0:3c0:3568:8d38 with SMTP id bi41-20020a05680818a900b003c035688d38mr2963619oib.47.1707693655441; Sun, 11 Feb 2024 15:20:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707693655; cv=pass; d=google.com; s=arc-20160816; b=x5TZJTFB4bWRxW8qJWfo1M7V/rKSDvhWgFOHrCQ82jSLqpGInoEe6MAUmEcoGb/6Kl Wtxe/VFe3W0nPytMS9cRXf7CSE8Az0AKHaeitopKw4t/CuereLzC9oNEmcaxnhuD7+t1 2xJvS3rKagYWOgQGHDUoUE3PHIsRN+HW38jv2rmRf6Px9nAeknSSZi28j2+i9HYwmz/w bLe1vyA0X+aUO7OFpoyKV5Rg4VvDz/3j/Uc+RNDXyqF07l+TbPaWAyq8OOaZm416V2mr 78NbmvmDW5HqIFlnlHrpvCLB86TmE2qAQ3hFDQ90yLiuUXjlidGY27uWGgTbo5lS5tDt V4qA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=XX6bIIKIb3vW/PKEEaoSMBsPTHp310cah7cFw0U4FkA=; fh=JZQ4fA70XfNNsNuM6ifwnH47/Kapst/5xr1DIL1zBk0=; b=VjiXMgxSqmMFIJHSSyLN3hRx2YnlZZnmAmigtZROd9LX5XFwOvAccnuoLZYaUEUDVU VXBkqCCfA1js4ZN75TCKYlQJhIC8H0gQlakO8UzfhYYWh1pS9ajBxr7iHUJqGN4kux60 HOIGbzig/eT9ezNIz8JlfCWfgAQk3EF5WBB9ev0pEJzp6e8nJLdq3KzAdi//0aGtX0Xg gJUy/BKmbeMW71AENO+wnHewCD3HdKogyJdXQkz2SELx6ch9Rr3rCbpQIl0jFmx7VADM J5mf9QD1Ygv/k2DM4OvkSP74LyvMX/akpMeEgG6LPyqxt9qhhrFE2N5bHShGuRKY7NFa x31w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=Sa5qFr9V; arc=pass (i=1 spf=pass spfdomain=ionos.com dkim=pass dkdomain=ionos.com dmarc=pass fromdomain=ionos.com); spf=pass (google.com: domain of linux-kernel+bounces-61010-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61010-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com X-Forwarded-Encrypted: i=2; AJvYcCU6Ow+MXtVwghHfVFSX2HR4tPK2y5a79cdIvHHxuDO13mFjWU5gqB/WEeX/rchIUj1vG62R0ay1HqN4jEgW9Th1/DBnOwdx/yorNvxsGw== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id w66-20020a636245000000b00589fcc39ef1si5367664pgb.365.2024.02.11.15.20.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 15:20:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61010-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=@ionos.com header.s=google header.b=Sa5qFr9V; arc=pass (i=1 spf=pass spfdomain=ionos.com dkim=pass dkdomain=ionos.com dmarc=pass fromdomain=ionos.com); spf=pass (google.com: domain of linux-kernel+bounces-61010-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61010-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.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 B9329282C15 for ; Sun, 11 Feb 2024 23:20:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CC4793A1C9; Sun, 11 Feb 2024 23:16:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="Sa5qFr9V" Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (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 5905B2BAE7 for ; Sun, 11 Feb 2024 23:16:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707693365; cv=none; b=VlvYOsgyssy3Y3b46pdUwwblPwdONE+p5Z11Tr1H6dPgEegNwrz+YqwxpL0vww8DUUXUu/hS/b0FFkjiDKl1D3/xMwFMkJbJj2i6l/sPnRbM3A5CzBfH/F9kVNZDdRkoM8X8rDAeDNjX5O60ftYQZDko9/E2zVhsYpmGuXibRig= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707693365; c=relaxed/simple; bh=9VepcIf+uQXyWSLDd7i+zmQ7WwRV4PEenyG1HPJqLa0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=psxLPigQgkdAamCG03E9AY3T1zwdgl16Kbe9VlioOlNRQ8Oz0Zw8hP6cgyKZAAso02yP7IV0De6+bVxf0VeexACd+qlkA4ObN650q5AeeYQtrw9Y+zeBXqitICoJ7FGy/8Wcp2olq5Ek7P3mIWcf9l0sMUIModwSG1ZYxeStvYw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ionos.com; spf=pass smtp.mailfrom=ionos.com; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b=Sa5qFr9V; arc=none smtp.client-ip=209.85.208.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ionos.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ionos.com Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-2d0e521de4eso15845241fa.2 for ; Sun, 11 Feb 2024 15:16:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1707693360; x=1708298160; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XX6bIIKIb3vW/PKEEaoSMBsPTHp310cah7cFw0U4FkA=; b=Sa5qFr9ViqD45qtzFhI/9+8XShB/SQYsorIEewUtVf66BgxaI18TGcBDXqSBPhtxct w/WTMfj2ZyvaL1rUg+Aof+6VRuDzEzf7B7C3MBlw5Uxc93C2df0G2mneJ9UxEPjB4AzT IpsDOmdVJX6wMFyJelyGBLvu27EAi9N+CvrESs9q5kIf7sICyLcToLPNw9VMsl8VKgeS ASNDQNzgkkPxpCyqgPfFY67vpWZnvOvGhb1b3aYQU6bMnBjLqH2y0o/EMrehd/rUpohb M4oUFxXR+CVNPSgxVy4+lFl9T440lV/jnTRyy9n7zz79P5Jou7CO6Bz71xknLYvViOON GMVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707693360; x=1708298160; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XX6bIIKIb3vW/PKEEaoSMBsPTHp310cah7cFw0U4FkA=; b=Nej/c3DhQQH/qSgqX5faVMIGuSracpKAfWkrlxaQto2ZwqG8PBENUp/S9yV1zdtNz/ bUS8rlwYRZuX6ujTdeJQvBP4s2gQo9Y88kALcCo8gq0mO6tr8FuFU2TnhSdRcwBnAMLd d9Bm9HYbEzvfHPdXqpkZp+MqvN5cfPL9WteFkHcsyRIbKZX8T5lCnRXx2f1jl9PaPhk1 6Tp1vWgzR98+E+QuSNI3LSNH0J2UbD4tiNWPOi1P2rhWsDHkotjL0Exkrw+JpKLk1aR4 s2XNdzNB4sci/BoQvcNsijlp4t0F5yNVHTYGCwyDsUD5PITiItfZ5UAtHnLKk44HZ/nc X4gA== X-Gm-Message-State: AOJu0YxNIm5KLcSsGVNrxd7tGbv9xYSAH6MwoZBd5G0c2P7R//GBHPnA kfr+Xor59SqrFMcxqRoiWJyyYvXZUola1MImk++6SHfHK7bD4505687Vw8PGAGwyQOWbu0rokZ1 g X-Received: by 2002:a05:6512:61b:b0:511:8d4a:72da with SMTP id b27-20020a056512061b00b005118d4a72damr1171446lfe.3.1707693360063; Sun, 11 Feb 2024 15:16:00 -0800 (PST) Received: from raven.blarg.de (p200300dc6f267100023064fffe740809.dip0.t-ipconnect.de. [2003:dc:6f26:7100:230:64ff:fe74:809]) by smtp.gmail.com with ESMTPSA id et13-20020a056402378d00b0055d19c9daf2sm2170180edb.15.2024.02.11.15.15.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 15:15:59 -0800 (PST) From: Max Kellermann To: linux-kernel@vger.kernel.org Cc: Max Kellermann Subject: [PATCH v4 28/35] radix-tree.h: move declarations to radix-tree_types.h Date: Mon, 12 Feb 2024 00:15:11 +0100 Message-Id: <20240211231518.349442-29-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240211231518.349442-1-max.kellermann@ionos.com> References: <20240211231518.349442-1-max.kellermann@ionos.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit By providing declarations in a lean header, we can reduce header dependencies. Signed-off-by: Max Kellermann --- drivers/usb/cdns3/cdnsp-mem.c | 1 + include/linux/backing-dev-defs.h | 2 +- include/linux/iocontext.h | 2 +- include/linux/irqdomain.h | 2 +- include/linux/mlx4/device.h | 2 +- include/linux/radix-tree.h | 44 +--------------------------- include/linux/radix-tree_types.h | 50 ++++++++++++++++++++++++++++++++ kernel/dma/debug.c | 1 + kernel/irq/irqdomain.c | 1 + 9 files changed, 58 insertions(+), 47 deletions(-) create mode 100644 include/linux/radix-tree_types.h diff --git a/drivers/usb/cdns3/cdnsp-mem.c b/drivers/usb/cdns3/cdnsp-mem.c index 97866bfb2da9..bab13f8a0b62 100644 --- a/drivers/usb/cdns3/cdnsp-mem.c +++ b/drivers/usb/cdns3/cdnsp-mem.c @@ -12,6 +12,7 @@ #include #include +#include #include #include diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h index ffdd82f2f3e6..a48509f21b71 100644 --- a/include/linux/backing-dev-defs.h +++ b/include/linux/backing-dev-defs.h @@ -3,7 +3,7 @@ #define __LINUX_BACKING_DEV_DEFS_H #include -#include +#include #include #include #include diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h index a05d8a45cce5..aa1409bd9edd 100644 --- a/include/linux/iocontext.h +++ b/include/linux/iocontext.h @@ -2,7 +2,7 @@ #ifndef IOCONTEXT_H #define IOCONTEXT_H -#include +#include #include #include diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index 0503bd4ea55b..c439d47b37a9 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h @@ -35,7 +35,7 @@ #include #include #include -#include +#include struct device_node; struct fwnode_handle; diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 18d71b808bc2..e354c967a21d 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index 231c526ec9b8..eb28f5be02cd 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h @@ -8,6 +8,7 @@ #ifndef _LINUX_RADIX_TREE_H #define _LINUX_RADIX_TREE_H +#include #include #include #include @@ -20,10 +21,6 @@ #include #include -/* Keep unconverted code working */ -#define radix_tree_root xarray -#define radix_tree_node xa_node - struct radix_tree_preload { local_lock_t lock; unsigned nr; @@ -70,45 +67,6 @@ static inline bool radix_tree_is_internal_node(void *ptr) #define RADIX_TREE_MAX_PATH (DIV_ROUND_UP(RADIX_TREE_INDEX_BITS, \ RADIX_TREE_MAP_SHIFT)) -/* The IDR tag is stored in the low bits of xa_flags */ -#define ROOT_IS_IDR ((__force gfp_t)4) -/* The top bits of xa_flags are used to store the root tags */ -#define ROOT_TAG_SHIFT (__GFP_BITS_SHIFT) - -#define RADIX_TREE_INIT(name, mask) XARRAY_INIT(name, mask) - -#define RADIX_TREE(name, mask) \ - struct radix_tree_root name = RADIX_TREE_INIT(name, mask) - -#define INIT_RADIX_TREE(root, mask) xa_init_flags(root, mask) - -static inline bool radix_tree_empty(const struct radix_tree_root *root) -{ - return root->xa_head == NULL; -} - -/** - * struct radix_tree_iter - radix tree iterator state - * - * @index: index of current slot - * @next_index: one beyond the last index for this chunk - * @tags: bit-mask for tag-iterating - * @node: node that contains current slot - * - * This radix tree iterator works in terms of "chunks" of slots. A chunk is a - * subinterval of slots contained within one radix tree leaf node. It is - * described by a pointer to its first slot and a struct radix_tree_iter - * which holds the chunk's position in the tree and its size. For tagged - * iteration radix_tree_iter also holds the slots' bit-mask for one chosen - * radix tree tag. - */ -struct radix_tree_iter { - unsigned long index; - unsigned long next_index; - unsigned long tags; - struct radix_tree_node *node; -}; - /** * Radix-tree synchronization * diff --git a/include/linux/radix-tree_types.h b/include/linux/radix-tree_types.h new file mode 100644 index 000000000000..d0d4e051a424 --- /dev/null +++ b/include/linux/radix-tree_types.h @@ -0,0 +1,50 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +#ifndef _LINUX_RADIX_TREE_TYPES_H +#define _LINUX_RADIX_TREE_TYPES_H + +#include + +/* Keep unconverted code working */ +#define radix_tree_root xarray +#define radix_tree_node xa_node + +#define RADIX_TREE_INIT(name, mask) XARRAY_INIT(name, mask) + +#define RADIX_TREE(name, mask) \ + struct radix_tree_root name = RADIX_TREE_INIT(name, mask) + +#define INIT_RADIX_TREE(root, mask) xa_init_flags(root, mask) + +static inline bool radix_tree_empty(const struct radix_tree_root *root) +{ + return root->xa_head == NULL; +} + +/** + * struct radix_tree_iter - radix tree iterator state + * + * @index: index of current slot + * @next_index: one beyond the last index for this chunk + * @tags: bit-mask for tag-iterating + * @node: node that contains current slot + * + * This radix tree iterator works in terms of "chunks" of slots. A chunk is a + * subinterval of slots contained within one radix tree leaf node. It is + * described by a pointer to its first slot and a struct radix_tree_iter + * which holds the chunk's position in the tree and its size. For tagged + * iteration radix_tree_iter also holds the slots' bit-mask for one chosen + * radix tree tag. + */ +struct radix_tree_iter { + unsigned long index; + unsigned long next_index; + unsigned long tags; + struct radix_tree_node *node; +}; + +/* The IDR tag is stored in the low bits of xa_flags */ +#define ROOT_IS_IDR ((__force gfp_t)4) +/* The top bits of xa_flags are used to store the root tags */ +#define ROOT_TAG_SHIFT (__GFP_BITS_SHIFT) + +#endif /* _LINUX_RADIX_TREE_TYPES_H */ diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c index e7e236599307..1e892a5b0d93 100644 --- a/kernel/dma/debug.c +++ b/kernel/dma/debug.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index d3431093c40d..d3313b7a22c8 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include -- 2.39.2