Message ID | 20240211231518.349442-35-max.kellermann@ionos.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-61016-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp2143761dyd; Sun, 11 Feb 2024 15:23:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IEoeuUoFHOJ5678+QUfiUDTLRMWlBcyYZ/+YQOTLcPlHbD0OhPNSogaTIDotl0sJBicXshj X-Received: by 2002:a05:6358:c83:b0:176:71c3:80db with SMTP id o3-20020a0563580c8300b0017671c380dbmr6998055rwj.16.1707693801322; Sun, 11 Feb 2024 15:23:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707693801; cv=pass; d=google.com; s=arc-20160816; b=Fiwh7ugEaMb/2GEL2hwfHRDw6igdxt99kKQSOBUOpBADUjdMScVeMt9FUWK79gF0CD 0NNNosPXLcK1qXLy/q24WDHrwdv1EBtKb9Aq5pw1QCyDhLze309pJYNAiqZTRaV3ULaT +Qw1gXHev5khbY+M/vNJ3Ea5HqifTRckSxB5Vy1TdltOd8/E1Zih4ORUrk0VK6WntjsT QkZKksasXFJXeMtyFo8QoQVYiAOkCIz1zJC+4Z8EagNAsxuqCTODYk5Lu+ABXPtP0Si/ h21aMstDtYHa96th6/eoya/Y7Tw8tsXSveb3gnQKcYopXFtdA6ZW1cUOChGnqYEPQMxA 0MLg== 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=fwHtii56Sk9j6aWasrwO47WYwdkHuwukNe9vK4w9g6U=; fh=JwfDUrqtlzLGcK76suWD+CK8Mivx234bcOUQ2r7jwEc=; b=jC0b0wgWXYHWuScv+xhbhjHm/mlFveXBbQ/G3z7+1mAd9y1JhcIFVJpppk3iEW4pw+ Tv5GF16lC0NrvQM916Ge/haNUBj7ku21Dujd7RtemJZa05r/HU3oCmNuAUbAlHwuYfSE fcvdrXBuRgYnGA4ipruEE75qvtK6+GH9EiZOYTRnOcZFXr5dW1dOcL+VK0pnKxxvuBNB 0u0UHg6h/GsfGY7nPipxWYXBxzMahoZLOBoMvCPSwz9mpewVMY2U4NnjFgU94g82l68D RRyxvXZ5Cx5D+uGl2Su0IYoD4IUnW8k18mQB/9gNOY3w1ltNPIPNUQb4qw3w+EFmaEzX cNZg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=fLqLrnNq; 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-61016-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61016-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com X-Forwarded-Encrypted: i=2; AJvYcCVUdTq2Ql4hX2SjiLuUbFvYwvJ8iujKFSWlKW+qCLPo3sJoYqB/BU+2hlLsyOGzU3qyK4XlvhKdRoeE9qNRcRHIkK+0Dw== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ip4-20020a17090b314400b00295e0f76b7csi5339678pjb.172.2024.02.11.15.23.21 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 15:23:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61016-ouuuleilei=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=fLqLrnNq; 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-61016-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61016-ouuuleilei=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 ED192281F09 for <ouuuleilei@gmail.com>; Sun, 11 Feb 2024 23:23:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ECAEE3BB3D; Sun, 11 Feb 2024 23:16:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="fLqLrnNq" Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) (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 16F5A38DE4 for <linux-kernel@vger.kernel.org>; Sun, 11 Feb 2024 23:16:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707693370; cv=none; b=rbznNPE8I8daiQccGUvK7NVEXqmrI7gXPhtJbSTFy7f1gRs5pbSUZgcNQ6wmWgsnrbC3iq6kU2H5QTRAGDvLIsAo8xtU3zvEVk6jPMUTKwCPPZxJTLvKYtFd3r9j7OWxsG0Ied+kXfQp4oeOC3lPNlnMubdkClVTs1O1wBoO3TY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707693370; c=relaxed/simple; bh=HgB9s5w0AlPuLVyJkL0iJmSauVG9XEFFZWYHG9S9I54=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=E+2UgCkInB5zbgDscf4E/3NQOcVpuG0XNMFGE37OmgKP9AEV2XAL1xzZa9HEkZEyfg3DJyZsw2FCqAmAv6BC7nIafOgfaXjPyIIh3Noa2n4yKE/qqQnyc3W8Z5ZOJVCpgq11zOwPPERypq/ukCc17eQ8QXFEIjGaK6Ir74BQM1I= 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=fLqLrnNq; arc=none smtp.client-ip=209.85.208.171 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-f171.google.com with SMTP id 38308e7fff4ca-2d090c83d45so36390351fa.3 for <linux-kernel@vger.kernel.org>; Sun, 11 Feb 2024 15:16:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1707693365; x=1708298165; 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=fwHtii56Sk9j6aWasrwO47WYwdkHuwukNe9vK4w9g6U=; b=fLqLrnNqNTGw99jKxr6BP8rW5oBv7PY2SRhxW3sNX8/zB7qfa/tRf5+R35TjSNNXLk Bhs169/tgLNOT45ZtZUVZho7BHBi50ofVxjpV2bycRXASgl7QIJOamxwjIi5QTXxMW13 CPrE/Irs5bPR1THvH8ehMMkmo+jyNArpfZSHEwyf0r1+84E6+0rKmJ2hUuDvaRx1G6CL H/I9tLaFAloJtCD37xW7R00qGI3vZRzUHSKfNpBlVPV1R9dk4mRZAe17Gdr1lNEWdWY7 FM1TyzCIm1HMT+13FoEdvCtP8tVAMOT2z+kLNHe4+BkUTJhJ7a2c8rbKJR0UvZeI+p8s XIAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707693365; x=1708298165; 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=fwHtii56Sk9j6aWasrwO47WYwdkHuwukNe9vK4w9g6U=; b=RA4S5dKxytpeflaTr2vQZ2jhp7zG5CMp8NGy47KZrZnWLhzwhGQw0RoNpZEL2ke/Bz 6b8GV1WXa6/VFZD6ok2swM339e0mVoY3yrW8o32LbpmtQP3HqAPq3TyS/T00Rhf0KJFp WXa+rhVsa5K3BG4PQa7vWaw7YPXd0UKqOwhaNB7m9g1vad/x9jl7JUZzHOa+8KUQZMl1 w9g3KK/ynx4TiCtHKcLyL9ASCPmtX90wcdMNKybyRC9UYjAmjZjo008sK1Xn/R5Jn/Uc fEA3422g7bKKwWvCmPsciLnE8WcsSWZnnckeQI0QUu70gPbnRmhqnWtiRtkb3hD+0hXz g5aA== X-Gm-Message-State: AOJu0YxSDhcubrJlPOlhIZJsUw7VL0mJtKdBPZ2p/Gsr31XHg1c9r4o3 bhjSoCsYwknt+OGWzHUs9bpVHGaiNa5VIewsckW54PpLPxtv+cTnf6LRheVzK3RhVW6h1y1kKB6 x X-Received: by 2002:a2e:b0f2:0:b0:2cd:9503:f91 with SMTP id h18-20020a2eb0f2000000b002cd95030f91mr3026829ljl.15.1707693364749; Sun, 11 Feb 2024 15:16:04 -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.16.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 15:16:04 -0800 (PST) From: Max Kellermann <max.kellermann@ionos.com> To: linux-kernel@vger.kernel.org Cc: Max Kellermann <max.kellermann@ionos.com> Subject: [PATCH v4 34/35] linux/kernel.h: move PTR_IF() to ptr_util.h Date: Mon, 12 Feb 2024 00:15:17 +0100 Message-Id: <20240211231518.349442-35-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: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790646735256083047 X-GMAIL-MSGID: 1790646735256083047 |
Series |
Fast kernel headers: reduce header dependencies
|
|
Commit Message
Max Kellermann
Feb. 11, 2024, 11:15 p.m. UTC
Reducing dependencies on the header linux/kernel.h.
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
---
include/linux/kernel.h | 3 +--
include/linux/pm.h | 2 +-
include/linux/ptr_util.h | 7 +++++++
3 files changed, 9 insertions(+), 3 deletions(-)
create mode 100644 include/linux/ptr_util.h
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 6f436367dd16..e323fe139cc8 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -32,6 +32,7 @@ #include <linux/sprintf.h> #include <linux/static_call_types.h> #include <linux/instruction_pointer.h> +#include <linux/ptr_util.h> #include <linux/wordpart.h> #include <asm/byteorder.h> @@ -39,8 +40,6 @@ #define STACK_MAGIC 0xdeadbeef -#define PTR_IF(cond, ptr) ((cond) ? (ptr) : NULL) - #define u64_to_user_ptr(x) ( \ { \ typecheck(u64, (x)); \ diff --git a/include/linux/pm.h b/include/linux/pm.h index 34cf20dd1ad1..cccf320b67f6 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -9,7 +9,7 @@ #define _LINUX_PM_H #include <linux/export.h> -#include <linux/kernel.h> // for PTR_IF() +#include <linux/ptr_util.h> // for PTR_IF() #include <linux/list.h> #include <linux/workqueue_types.h> #include <linux/spinlock_types.h> diff --git a/include/linux/ptr_util.h b/include/linux/ptr_util.h new file mode 100644 index 000000000000..7469aff978a9 --- /dev/null +++ b/include/linux/ptr_util.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_PTR_UTIL_H +#define _LINUX_PTR_UTIL_H + +#define PTR_IF(cond, ptr) ((cond) ? (ptr) : NULL) + +#endif /* _LINUX_PTR_UTIL_H */