Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1052794rdb; Fri, 9 Feb 2024 08:56:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IGsRyMm/kbv64LOwnkvDXQm4RZ7J4XE04YzV05K2TuHukQplZ870AmWUh00BCO10dyYBDCV X-Received: by 2002:a05:6402:2681:b0:561:55d1:371a with SMTP id w1-20020a056402268100b0056155d1371amr455709edd.41.1707497774496; Fri, 09 Feb 2024 08:56:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707497774; cv=pass; d=google.com; s=arc-20160816; b=x025NLpZI8rT8N0Hlqu97Oq5/1RofemvrBH8xFnn8Yuuo0fSidAlFU4FiYemf48x15 mYSaGDkq9tk9vEB/P6INtGs56urvm+M41Rph6Kq4ygRNLeYE6/fEpSx2xXRF1nnzmkcT BfCv+ywEo03E0q17/X/bZkAaSDdL/5t81C8crAnUI0JTDnL13HrKHu/Vj1eZvdcpLP81 cATxb3yWm+JP2LRtEJHfW3e6GUoAhGZkZfpJl8DRJuhaachEN2fMMHuK6naj8GRPrLMw /g2ook/gRRPd6OqzaIN5eaPZVUtdsuxJbkSSniH6YRRZfjHBqDpCwniyHitMj3TrAg5p ISUA== 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=HBEHJKz1KoIPwSOTxqH1wMh5XTwkx8lCnL4ccgb4hBo=; b=pPccuT1Z7euuAphSX3xTeqa6sJ/7aAL5m7OxRdOgR762dYMzZN2IA9cRXGsTQ51B5v H7dszwmzYjR+suZRqYoGf/7JQLDhSgZRGoqmbDNuRpLRmMQnAoBnlwEJkGDbak+W0hh7 VDqIN8e8bwFzsmI8KXCzL0o/qnEfcESImjk6gVz1R6Qv6dFvJB/+v8m52vj10Zfi9YWs DRh3Z44hzKNqCHh/o7YsZSn8ksgWo8o2MJ4vxn0x0oymxLgr9wee7UyONKyoXO401fBc w20ZurKAibNob2INQlCmUeQA5R2arzb3a/+61zDvNV6a7X58FthXWGNGPzSDFD5v9nzZ KIFQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=UDaUf46p; 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-59651-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59651-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; AJvYcCVqlO6LyuZML0CR/a/2llXf4fgRHIDsR3tIkrKmOFwv6fnTFYw0wu1erRDS5vUdEgcyhMHBHGlfz4PLe+JGAnt4rrM5Z8cw/fpf6OoXtQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id bl18-20020a056402211200b0055f0fa701e1si1019244edb.628.2024.02.09.08.56.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 08:56:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59651-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; dkim=pass header.i=@ionos.com header.s=google header.b=UDaUf46p; 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-59651-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59651-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 am.mirrors.kernel.org (Postfix) with ESMTPS id A33CA1F253D2 for ; Fri, 9 Feb 2024 16:46:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 05A5412BF30; Fri, 9 Feb 2024 16:41:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="UDaUf46p" Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (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 3A93F7BB1C for ; Fri, 9 Feb 2024 16:41:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707496883; cv=none; b=PStYM4CMP8x7HES0H2M/e5/Ou47mRzRKo3AQ8I7E25O2m6bCQiA6OfZxF724d5d/BEnhuS5GViDO7Dnjx5mQgj4xuByrYPR3rBfodb/CJvNBo7BQo6nM7Cc+txtHJhdX26lwarv+rD4dQHvyLZy7fGYdJDZSWf5kb1/tVMk7x+w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707496883; c=relaxed/simple; bh=HgB9s5w0AlPuLVyJkL0iJmSauVG9XEFFZWYHG9S9I54=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=uUm4Zsaon2Oquu/IfyVDajc5JWTr4uKIJpv/ltCHiOQUv9KDR1imGUx9plPJZRJMny3q5dwfxntxXjRc1lKfn227x2ZGmE8cmFmNVa02Iw3Pg2RKar+2fflTIu3cqn5jtH8qFCBQjvUfitU1ZV8NGd1nlYCkk21aeD9e/JuyhB4= 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=UDaUf46p; arc=none smtp.client-ip=209.85.208.44 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-f44.google.com with SMTP id 4fb4d7f45d1cf-55ad2a47b7aso1752573a12.3 for ; Fri, 09 Feb 2024 08:41:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1707496878; x=1708101678; 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=UDaUf46p4r7ACglzo08S3q27tOfCVYWlEenHCqB5PDcTDqEFIBrgdIUuXFaXnKBsgh mkkAnP5dpmdy+84TVTX8ZelZOx+kOUFWlwQ/ng/KBC0dIDDDcD9GJhSz2oQFyclJC/Nd yzJDLskv8qFtIh/YkIqcXDn0XrgFLmnMzGMROmsijm3bNNTy6Koq9U0drZVjWUy67XYC FA3BuODkEl0HLaoil5KgivXH+72RTEM9SQKU3CqSIivBHo2M9WywmqEmBcRcSwtOvjEy 1iKQQYRBRQepK3+35SFKq5Jxh04/BnDvaQAoFFmeqiyFA6f6t0cNxzPWVuORqRSgyl/z HKgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707496878; x=1708101678; 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=dGQxsVy81KzR9eiPmoAPwrnuuN3+7HH41kZxIRmywJxD4ohc/7B73+EoChprmK7ln8 V3LDjl4NqAnJY2jjdcxxAQWLU9daRbGLGVf22osrd1Yca7rX3OE4k+Ge3b0dH4tfuJol 26RGNWrl4lfb0XsGZuwzsYYdosYx6ghFv0+NlJoIQ01HK/jEzcorGUbLrI45rYmLc7m7 Cyo6CAW9sTbsr5zW4vPKyvYeUFTXdaMfn4POHXWszxCe0uU0yYrRldu7MMeqSqeVdaQn ZHjOlN1h4QucLAzMLLuwLnBmdF9S46muqB5iy2CJ0gLLOTNC2CfLTtuN9KGy3M5jkf8D sz9w== X-Gm-Message-State: AOJu0YzKSvU0U92OkzhMc8VcUAbgqHTcLRWReQaICuCOEa+h98zIVg3Y +gNB1ENjnA+uoOl4tODkJx4TACNmtz+x6IRlTWLVAClXIufU4BWsXUFRmDKvyqSVQ6nhphajrQb Z X-Received: by 2002:a17:906:5a95:b0:a3c:b2:3f99 with SMTP id l21-20020a1709065a9500b00a3c00b23f99mr1106849ejq.21.1707496878145; Fri, 09 Feb 2024 08:41:18 -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 tl27-20020a170907c31b00b00a3bfe97fe27sm477724ejc.218.2024.02.09.08.41.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 08:41:17 -0800 (PST) From: Max Kellermann To: linux-kernel@vger.kernel.org Cc: Max Kellermann Subject: [PATCH v2 34/35] linux/kernel.h: move PTR_IF() to ptr_util.h Date: Fri, 9 Feb 2024 17:40:26 +0100 Message-Id: <20240209164027.2582906-35-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240209164027.2582906-1-max.kellermann@ionos.com> References: <20240209164027.2582906-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 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 */ -- 2.39.2