Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp343526rdb; Thu, 15 Feb 2024 01:38:29 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUYxL+OmPTK2n53csc0blSC+EueOmjwqyX2XMVHHgPc1jRaQF95mqIeYshlo71NtKNgle5BceFzAM8OWeABDI0mXfekO9dMA55YgxqrvQ== X-Google-Smtp-Source: AGHT+IGM640XFLe2jxVM4ZaayCtX2DQ8mYO2id/wGF/ROilMUa5lJAoxVVJAkIdaG5/+wwLJCM6A X-Received: by 2002:a17:90a:ea13:b0:295:e149:a0d8 with SMTP id w19-20020a17090aea1300b00295e149a0d8mr1094107pjy.29.1707989909715; Thu, 15 Feb 2024 01:38:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707989909; cv=pass; d=google.com; s=arc-20160816; b=MpB1Yb3JVofUEaQ1BgLaQg1hdmjIHVKd1V61puTAoxFlEXVQvaE3cxz8A7vzh1d2Pf R7RHhj6jItMXIEVV5AI7k+ZfyasFad/7ij1rVoG2CdNRUldQizv/AdoPONkUZvsdiFKx 3Ez1Ztx9N9HXjt741IZft3cL/qAS/eXqFnWH+O1bN5jftKi9yf9vH7ZEFYOI0bPkcPxu BPbdk3KQYRd+haP+jnsUtCL5Z3M35H9QMKsr74KPeEitfvPsIeJoWpbYDDl4EOr2wDaw SpsBsjCRdHTHTppSnGIfDpiI03mjq0vjMkJMsH3j+pKo+QsREhO5Uz8UT8RHT1Vcj/0V 7LXg== 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=9ickuvkgsuryJ7QB6aeyaT4/rf7qDfQYCAiw5coU/dY=; fh=KdkJjeZw/67bsxRSoO8Cj8OsbWp5WsCKsMMy5B3Phrs=; b=YALDBrwZ7VdGbOCA+uK30B65FT31sNPIWJI2PtSvkIB6A3juBQ7m0xVZxyDFOWONt8 QMECMDZ4zbOzFBYn4SZuHeMxaj2IC306SjbqSESOWjT9W0v5O5k8PlgYnmIL/aScD5J3 TNvNpQ08S9D2Scz22Bmxljv5GovYQuL8eZiM9dz8ooR62BSz+I1tIPHOAO2BV9EqvVaD FOGe+qWV8v0dB9T3Zt1O/Z3FyhGg+5CC+XQsIuQIlgm/FNM8ajGOPdam7/W/llj0ATKF PJ0ukk+MDNhT6bBiXeVUYAbghvV/R/JEIat1j/q3xtNPKrz9wcs3cX/he2mce2+9ZkYf C/WQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=FDbUrGDJ; 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-66562-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66562-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d4-20020a17090b004400b00298eedaededsi956411pjt.71.2024.02.15.01.38.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 01:38:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66562-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=FDbUrGDJ; 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-66562-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66562-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 5930C280A78 for ; Thu, 15 Feb 2024 09:38:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7432E1C28B; Thu, 15 Feb 2024 09:37:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="FDbUrGDJ" Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) (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 8CFCF1BC36 for ; Thu, 15 Feb 2024 09:37:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707989827; cv=none; b=L7jdqrnZzV5BvZsnBTe92nVFksn237Awn8HhcwV1a3GyO0GCLJJJzxpIFyD2P98eGTT2z8UQsoY4QmG+Tkuc3gzizbgpFxHItYHIXCRptbnOnBxtjcFiUTN6f+AhAqUSlKPzG8oA9hu//agZ6J7YnT4t429RWCXxmUW5JxqZjDY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707989827; c=relaxed/simple; bh=jY5dj1ThpsIuN7XJJW1uT42jgkmQrscd1nxpX2OhyMA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=VYXbLjEOJqppCLfCjI42n4s2OnZYKZFx4/SnnoacxDIOsoXAuzBIbTcaQGnnf1ax4orqtVugFOjMkHI8JRwRGoFTFkzmnipgi6ginOpv0pkSY4My3NUSvB30LBdi5J67ynWXMXsc1s6KFgSyF9odbaqU3qAWt3ZNQsFCYOavg2w= 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=FDbUrGDJ; arc=none smtp.client-ip=209.85.218.48 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-ej1-f48.google.com with SMTP id a640c23a62f3a-a36126ee41eso81676766b.2 for ; Thu, 15 Feb 2024 01:37:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1707989823; x=1708594623; 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=9ickuvkgsuryJ7QB6aeyaT4/rf7qDfQYCAiw5coU/dY=; b=FDbUrGDJ4vqc1WfAmOgsAuUQ/kTqrzbK8EiPFx623EYwgtkTCn++RogLLV3bUrBh93 vhdf66mVV9dkn8xk9OqzNv6CgFiZO/oEY0iKoPRIZGh6B1G7q1JEUn1XkxO3IJYXTEka phvobhn5dGOBNNyolkMZ4b7JTl6xppe0ke/T+EVbbB84gzkNK20HidyLT665FqkgZXcJ 6jWZuBD8yDjYoAoILa0ltpFhIrGsE1eVf2a++BefQ7avlkYrP24bKdSt78VaUujNeAQP PsvFD9hoou16A3QOBgomznWYqpwsRZknmBhlZJkBkit33l+g58y0JjQll6+HKrfD4Qx3 CQXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707989823; x=1708594623; 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=9ickuvkgsuryJ7QB6aeyaT4/rf7qDfQYCAiw5coU/dY=; b=QnUYX64VlFSoe9+MVzkzlNn6CIC1PKa7+7d5yz+CLsqoSqwu+eLvjyp6GV5YKsfFrs Fli0o3svbAvZ6dAZC9pt18PiOLXcZi0SpLGIES1mJ8/nwwLjZNnXBMh/3SiLrayNFdZS MfmZxTtDWQPeFLGcSeJWlbYriGhCil1hY3aaaLkeoxM6gFdkp8J3LiJBpt+9zyGL1swN Erp1S+ToAwI3ZGeyQpbKYNtSdTUkCp8fGMxsIP/p1FgNA8XilLJHVEgib6Tf6PsJttvy EW0Igomsy7MetCE8G7+xkLsxDGPrPpteuNSQ1iThEDXAK8wEu0kVONMPpiCauWhxAIZH cioQ== X-Gm-Message-State: AOJu0YyFNTc9MjB850chVXZ36d40AuYxrB7wkjtTsRkMLjd/U5CAb/jC 3MgBfQ0ZOwigPnvqlEg3j32Adk9Thp//dZ/ZwsBlj2b8wa0jmHgySLXfOkug8JeXgk8nJWnkY4Y M X-Received: by 2002:a17:906:57d2:b0:a3d:916d:caba with SMTP id u18-20020a17090657d200b00a3d916dcabamr733451ejr.58.1707989823615; Thu, 15 Feb 2024 01:37:03 -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 rg14-20020a1709076b8e00b00a3d09d09e90sm362059ejc.59.2024.02.15.01.37.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 01:37:02 -0800 (PST) From: Max Kellermann To: linux-kernel@vger.kernel.org Cc: Max Kellermann Subject: [PATCH v1 8/8] linux/kernel.h: move PTR_IF() to ptr_util.h Date: Thu, 15 Feb 2024 10:36:46 +0100 Message-Id: <20240215093646.3265823-9-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215093646.3265823-1-max.kellermann@ionos.com> References: <20240215093646.3265823-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 --- drivers/gpio/gpio-sim.c | 1 + drivers/gpu/drm/i915/i915_driver.c | 1 + drivers/pinctrl/pinctrl-ingenic.c | 1 + include/linux/kernel.h | 2 -- include/linux/pm.h | 1 + include/linux/ptr_util.h | 7 +++++++ include/rdma/uverbs_ioctl.h | 1 + 7 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 include/linux/ptr_util.h diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c index c4106e37e6db..fdf17cc91b4c 100644 --- a/drivers/gpio/gpio-sim.c +++ b/drivers/gpio/gpio-sim.c @@ -29,6 +29,7 @@ #include #include #include +#include // for PTR_IF() #include #include #include diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c index 9ee902d5b72c..6dd0d8fdd6eb 100644 --- a/drivers/gpu/drm/i915/i915_driver.c +++ b/drivers/gpu/drm/i915/i915_driver.c @@ -34,6 +34,7 @@ #include #include #include +#include // for PTR_IF() #include #include #include diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-ingenic.c index bc6358a686fc..f88d2d3d217c 100644 --- a/drivers/pinctrl/pinctrl-ingenic.c +++ b/drivers/pinctrl/pinctrl-ingenic.c @@ -16,6 +16,7 @@ #include #include #include +#include // for PTR_IF() #include #include #include diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 01a0cc0a0776..1f1b2ced524f 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -40,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 97b0e23363c8..7e593b5fc5f1 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -9,6 +9,7 @@ #define _LINUX_PM_H #include +#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 */ diff --git a/include/rdma/uverbs_ioctl.h b/include/rdma/uverbs_ioctl.h index 5ed57a660ead..c94244e7a77d 100644 --- a/include/rdma/uverbs_ioctl.h +++ b/include/rdma/uverbs_ioctl.h @@ -7,6 +7,7 @@ #define _UVERBS_IOCTL_ #include +#include // for PTR_IF() #include #include #include -- 2.39.2