From patchwork Sun Feb 11 12:29:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 199446 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1905433dyd; Sun, 11 Feb 2024 04:42:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVbS6UDweBno1CWmpqqBI/agq5J+2+/uuD+hZH3IykwblA71XV60vxNKHEMXoe815mil180cIkOFAbgI2/946bVI1dusQ== X-Google-Smtp-Source: AGHT+IEvVVxBrf3e9i0EANaLS9qyXb9+THmW1jpEuM5yXe+rcVPIcpq6QNiWjWtZXTwjL8Y9pwZK X-Received: by 2002:a05:6a20:9392:b0:19e:9b10:108a with SMTP id x18-20020a056a20939200b0019e9b10108amr8049404pzh.16.1707655370290; Sun, 11 Feb 2024 04:42:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707655370; cv=pass; d=google.com; s=arc-20160816; b=YhcBEnilQ3bXW/VCwNV8lU0snMdR+mmCzAZzfHerc0Me66K7ZydIhzWYyOH3jyxRrE I5ljtpwm8a94YtHgXtukdNxkERFKLH7GbtY+BVaPqUks+VaRjPPAHjC8PcjAHluZx8QP 8wTqwPZoPcCFTmsuwUH9IPkYctbZ5AbQ1PBacsoI5VH6wpyAGu/K6UKz20QjEnmRHnaZ +Vso2rE7hcIONb15tUMo92+xzNTo4UZDVKr5OEvwBuELJRdiRUHWPhprsNir69HUj+Mj i5rLFNfPmAtzmYHb92ZNqmVtMOzMYJgsTloeKtinbPv9VU0Qi6XVER61NZhkB9mrA485 7CHA== 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=p2LMj6qHGGGUsfUZJ18JW3cEfTIOk+vhQGsfcNtcuhk=; b=qQi4gLxslJRRZcNL2BlMJqSxzDkXhht7EpIWDn9baZ+YXPcp6oJjXCu6Ay0m9n6nRd U0JScBy37r18zgtk1zfUKWolDraYzTacaAKhahzpNV6qblEblh/cpUVa/OMZbjdPmoMf MvMW/upMJzBLGlm54rzhcdxWgZohY0Q0u33x44Z1GSEDFC+LWkydqqsmBzwM5BtQF+bd bXkakKoEukawHAULC4JfbGFnpdtVUDOM9QFV9rdgY+Zq90nZAF3F8fY0vN2igVUWf/Oh u2UpS0Ppx3ByFTF5Na4J1SVPE/5RIJQPcfe/pKW/Ygg8vHtKjSeFwtbUbvw+PUJtTTyo wGOw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b="NBS/tyTq"; 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-60763-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60763-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com X-Forwarded-Encrypted: i=2; AJvYcCU5+CKnI7yTka8gxmVhUFJLUO7NMV2oMSKihM3LZxr8C0gd4p6O2D7GdHEG1jVzIm/q5eA8qqlc+u9D5btXVSMuZVYRHg== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id ca8-20020a056a02068800b005cfbf651e25si5134097pgb.111.2024.02.11.04.42.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 04:42:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60763-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b="NBS/tyTq"; 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-60763-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60763-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id A2246B20BC3 for ; Sun, 11 Feb 2024 12:39:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 94E8F612E9; Sun, 11 Feb 2024 12:31:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="NBS/tyTq" Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (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 E6B84605A0 for ; Sun, 11 Feb 2024 12:30:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707654655; cv=none; b=diR9HVONqLq83BaS+vo99PcfTaw41mMomFFJhbURM2aqwW3G9KjSr/sDrg456TQ8ROqYRXedwcmAOKQLUMr6XbUd23Lkggz7dplCdUSVpFaAZuPoCXqouwfxGF5/ttpGRCUrMtESODeYWJdBwamFw4oEXkvv36TnvM8XyZVYZQI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707654655; c=relaxed/simple; bh=HgB9s5w0AlPuLVyJkL0iJmSauVG9XEFFZWYHG9S9I54=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=dMpT2iVUa2+8SuSta3l/4mUauApm1fRjwpo+fbZ5LaK7MWvVo9NcKqrdXpNH7j/GN0ScSpuEcAIss0w8HBJ1DbYUgt9Gr5rFBNICW6OvK3fG/ClRW49crjb3JA4UY2ekUsYKNXCtvbtcQOO044s164Kl1LjFgyfm5T0LmuEeX7g= 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=NBS/tyTq; arc=none smtp.client-ip=209.85.208.47 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-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-55c2cf644f3so2947615a12.1 for ; Sun, 11 Feb 2024 04:30:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1707654649; x=1708259449; 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=NBS/tyTq1Hk5fPR6h4ru1s2xgIKbQS9a8yXjjT3KsF8imj8g+JEqivWvLnn4cC/tVK uQjlcFmQMn5FAb8sMdu9TGryYB2AAq9mxGxmtWQ0uGE5jcT5EQ7s6kcQxQ7YmyX63bgB 9RU/0IHYb+eEsSBDhLq75OTsWDCtng11R9upluSAMoEk56VOe8J44TD7AdhyNc8phAAD q6Z4UGnbRkQ8ZyAd5D8pHAG+ieSoy3tfJfQfq6hO4UlBA/AFbjD+YJDC9AGpYh3QREma Bgpd/MJJxOpyMDXgaNonN0bkc43I3+4d1cp124Jc1eW3tpnQDsIeOE+HznThh2MD4I0v D1Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707654649; x=1708259449; 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=vDvExR2teMZXR0GC8wNV9ZFGr6PzoIg+C26MkJ927tP86lgsEsxXSEGV2fFWR9trWi +QHalcDJltUzH21iINu3KMg4tqa1bvVztdlwijCwHFr30gWmlbIIFaqsXQrPpI8dvrGn FuTSNzgC4acUACkZwEupoCJJJkdUt7S7HrSbagbwMh2nYprYODKtMCY8jTMR6oBYs19B LL5FhfiqG9GnrkfD9dztIVr3erIq9KuN0LinI76mQmuwvZfxSAD4J/cuHwPRzk2/nT9S Og9oxD2GPOrw14ls572BnI5Iiu/kyb1/nictI7js487UyJh0ReGRHO4JmiPAjlPWvqsw DHrA== X-Gm-Message-State: AOJu0Yxa/54hNk6aY0Dc0NoXMpBwBTZBJMHxEycb6N82mioCLQVCdmxc HNGYqJsmoGDMd3hhIhj6ScB5eZKQnHfms98hUTc+q6EEyYzzYusubiSM+prTv6pdYKTbZ7MfJBu N X-Received: by 2002:aa7:df04:0:b0:560:64f4:cbd3 with SMTP id c4-20020aa7df04000000b0056064f4cbd3mr2267489edy.20.1707654648967; Sun, 11 Feb 2024 04:30:48 -0800 (PST) Received: from raven.intern.cm-ag (p200300dc6f267100023064fffe740809.dip0.t-ipconnect.de. [2003:dc:6f26:7100:230:64ff:fe74:809]) by smtp.gmail.com with ESMTPSA id fj18-20020a0564022b9200b0056187ca4120sm1024611edb.10.2024.02.11.04.30.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 04:30:47 -0800 (PST) From: Max Kellermann To: linux-kernel@vger.kernel.org Cc: Max Kellermann Subject: [PATCH v3 34/35] linux/kernel.h: move PTR_IF() to ptr_util.h Date: Sun, 11 Feb 2024 13:29:59 +0100 Message-Id: <20240211123000.3359365-35-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240211123000.3359365-1-max.kellermann@ionos.com> References: <20240211123000.3359365-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790606438016904333 X-GMAIL-MSGID: 1790606438016904333 Reducing dependencies on the header linux/kernel.h. Signed-off-by: Max Kellermann --- 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 #include #include +#include #include #include @@ -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 -#include // for PTR_IF() +#include // for PTR_IF() #include #include #include 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 */