Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2172555rdb; Sun, 11 Feb 2024 15:22:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IH723MK9jvNOawAZBu3jCjs2GhiwEJG4jK99ui1taGGHRDj6DMUyMd0VWgZK7Pk+1jB09hg X-Received: by 2002:ac8:7e83:0:b0:42b:f656:c0a5 with SMTP id w3-20020ac87e83000000b0042bf656c0a5mr8274750qtj.18.1707693726671; Sun, 11 Feb 2024 15:22:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707693726; cv=pass; d=google.com; s=arc-20160816; b=dmvJgBGmsPvkH2y0g+XNjWvhu8v91BfhIhhsCt9vxBriv7FNGxZjM2AveI0W2Z1GEi mwdWELejojMZlBRKmYVVtP+XeqaxzVxTqZ+++NsMYjRFf7xw80ctwmWTgBzMjBOK4zTd O/QOnoKRuaObaD/TrllPF6O/1KsJAL0NCk7mx1b+xL/NdBgg70Dp9SUS8FIOdDDogClE rSNf2qRrMlR2DSDaTM3+7LOiOjLUxLEA0BB9hdoRkZaxHujz8G8zNrbE5+BNzwQRQs5I cvWy/RtX7A5RttLnk+dNShdE9FZJHDmPnMo3kB7+BLbfVqn1KGITy5iuscTimQh3EEO4 Nj+A== 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=1DxySM+PLjyLGIQJyGu+gg6NVix8tpr/vS+1CVTpljs=; b=nZIA/1W2hN29t2LVzcrs+0aYPFAlRO5beo2Br1SUlrKwGvlGANEVGRsgbhUxWbuxBY K/ikBFpfMyJ/XxA9It1guKF4LP9xTSZhmIYyGt8ZYWgVrcwbfnKz6LH/NzpFV19+erM2 HYA1fFvMD6ipOpy2XWCyFc0ZPCwFZV01MgVW+kUKwS8WLMT4GOPiucT77PWRbvR5m7Y7 hJvnESYsWWzHqzHM8P+ynE1UrfdYLMEPCQMLgSCR6ybe/VwxjAdEQF4J4/TlyVw5AKiV witOahsu3sev9WkFaq7wCrl7POOSs3viXhAsyVXUm9iFnEXatcbWTK8X5895MUt/rfyX DUfQ==; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61016-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; AJvYcCWi0qQPh7oiOvhwym0vR9a4hrShRetrqjluCeEpsyjKvvhjCSACXJO0cZhhy29pXDRakufwsLT6E+sHPNiJcmgmev9BjRzgQ7FyAopvaA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id h18-20020ac85852000000b0042c4567e386si7263169qth.491.2024.02.11.15.22.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 15:22:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61016-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61016-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 6CE681C217D9 for ; Sun, 11 Feb 2024 23:22:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A9B5A17981; Sun, 11 Feb 2024 23:16:16 +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 ; 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 ; 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 To: linux-kernel@vger.kernel.org Cc: Max Kellermann 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: 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