From nobody Sat Feb 7 22:06:45 2026 Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.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 20C0D1759D for ; Thu, 15 Feb 2024 09:36:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707989820; cv=none; b=PBzLquFeo4R5wvSDpVgM1m/v5j8EbL2wu9PId1jN5+6bQJydgYNfoRRuw1Z5LzFK1S6adTO21svUFSlAYWntvxob+tkSURHi/yEMMpj9CwVnEfYH1D5iujvoi9k/0gsA0/JZx0yputU9iQstMZluENUCBB+vDa47juX2aBZe/mg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707989820; c=relaxed/simple; bh=QFSJlfZ0cuy/SCkf7m23AisvA4XUownlEXQJ0SdvNmo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nsQGWhDzXbRDsnx3xXFJiZ1PZTl/3oE4Gh+VQ5QfQSWvKSd+DdkrPUwt5FTNML5EWO8OHTN/KtNub00sMK6dZy8ZkLh6RMPn/N37YTmyp6OLBu5c0KvVlfrAB0KdILP5mttQOyAhqfyVSrXboKyv5vLMEtVUNzQPI5v4PJ8I1OA= 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=eprXqSW7; arc=none smtp.client-ip=209.85.218.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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="eprXqSW7" Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-a3122b70439so71933466b.3 for ; Thu, 15 Feb 2024 01:36:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1707989815; x=1708594615; 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=OlOv7BRUYrcRJiYDdqOKsBmYsp7bUKSz0hes5xiUYu0=; b=eprXqSW7HbG27C5a4OluLa5l1kqssxi5bAQgTOSxQWrg5kfkDzBF+cvgmOj8EHsWYK lMjeceHXhP0nTIkLOLSMaK3zJBW37wf4WbrXokvP6xoxykqHT2LzcX9mIWudNnpju8vY xoC2xxFB1EFEY1lJncuUDY7oKmt6V7rxMq/i6hrvRpJPlHncn3i37d2EbU/bmHP4znvI jhMTzFA/WvmJ3ex+4BIHnbDs1Kz6g9vrPoDhVr9u3+pFhqYFU9fCL83GrEr1NehfmyB8 mBw8Ll/IamKLSjMJq0jfwv7iN+bUF7Aiuw10UQNnvtBIGE/CUexRDonbhRMZ6iJYeH+t D78A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707989815; x=1708594615; 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=OlOv7BRUYrcRJiYDdqOKsBmYsp7bUKSz0hes5xiUYu0=; b=NYXUAPwp6bsRUZzNv5yRLkLfu7ZbFMSii6dFWfRlxGwL3RPhRKcv7ZaC0qNgXWGK3f RMP34bgg6X9ka2C66UfgaiSlXGQcexQ5WOzYu2wE/Y7YCo5XWCvfxNZhW8cmOfJZDv6t ZUZ7DebrCCPv0pAfSyeIEs+pcP4ZAqTZFPf0TcDQtBwXP9UDLxc35A7Z+9o4tlcNrRdl 8VCtcvPSO9WQY9ponUcTh9q4k3nxJ7RQopfu+DtoKtMP69SKLpr7Yij6flkRpvHhvG0z 9cx5QLFs4X62rBFrnAd3e5JwsOHbGntYImdKdAridPp5lB5vVnuxKX0GiEzs+lVcZMdR 5jVw== X-Gm-Message-State: AOJu0Yzb3Ci9btWS4J8gnvuxrnGrLS8+2gG+0Gm7GlViNqjphk65Z9th yc3qk8bpcwfDMsuqC9X81XGMcNO4xPXj//bOpaDO7m+rtqjDIpwzOcNisi1SZ1JY3BtBY6kfPxz g X-Google-Smtp-Source: AGHT+IFp147rXeL/v+hUBunybZpFHkLKQGAb7OwuIF85O9OLg9OS7wvrtgVouk3T/iQW/vypc+5yKA== X-Received: by 2002:a17:906:3bca:b0:a3d:6b5c:ab22 with SMTP id v10-20020a1709063bca00b00a3d6b5cab22mr852168ejf.64.1707989815555; Thu, 15 Feb 2024 01:36:55 -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.36.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 01:36:55 -0800 (PST) From: Max Kellermann To: linux-kernel@vger.kernel.org Cc: Max Kellermann Subject: [PATCH v1 1/8] include/linux/goldfish.h: include linux/wordpart.h instead of linux/kernel.h Date: Thu, 15 Feb 2024 10:36:39 +0100 Message-Id: <20240215093646.3265823-2-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: quoted-printable Content-Type: text/plain; charset="utf-8" This header only needs lower_32_bits() and upper_32_bits(), but nothing else from kernel.h. Signed-off-by: Max Kellermann --- include/linux/goldfish.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/goldfish.h b/include/linux/goldfish.h index bcc17f95b906..8b2b3046f779 100644 --- a/include/linux/goldfish.h +++ b/include/linux/goldfish.h @@ -2,7 +2,7 @@ #ifndef __LINUX_GOLDFISH_H #define __LINUX_GOLDFISH_H =20 -#include +#include // for lower_32_bits(), upper_32_bits() #include #include =20 --=20 2.39.2 From nobody Sat Feb 7 22:06:45 2026 Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.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 7C54A1759E for ; Thu, 15 Feb 2024 09:36:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707989821; cv=none; b=WfQqIWTJdbEoiFwLQ/5kKgxM1Ji6b/mK4oFNBO96TZ3Ie7F666JJNGtUmOJgT5Cxl2PInmbW9XUGDeHVrgz69YEY+s04RJYZ+kuS8BTnHyAx+9mstR1EKHuBpBW8IAEbEw2ezEvhvGHT2Xss5n4bnvjO6UxsyNl1E88lzOYiVrI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707989821; c=relaxed/simple; bh=lWTPwBKh6CAzhCcPD0ePdAhVQq7zZq5SFvy6M4Uovwg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ac2UpuAT6Y/L/uXKc99AwaRte+7Z319gZAzoTa/bJrVUQFCqrgbf3yGb/uGsuJOOCRcEQgLS1VpgtjBmkTVP/8UkyxVGDAjwkd0FwqIiHo33MhXvS6G/U/yPnQaN6AitxPaftbU+2NHJjwdjwB6h8WinKkRXj8KCMY2Qbfbr4kw= 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=MFFOGtBB; arc=none smtp.client-ip=209.85.218.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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="MFFOGtBB" Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-a26f73732c5so80773866b.3 for ; Thu, 15 Feb 2024 01:36:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1707989817; x=1708594617; 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=r0xEyIIS/tv0UXDMyOsQAyxi6COhgq9kYeUYOeDXc8c=; b=MFFOGtBBjEeZO+VC59RR9FXkmH3YMjuSJYDhEsJ6PU7dYhYDf4mtkjkkbL45e+dpDw d10P05S6/xx9hwYfscGR3CUQ2/qaUA5MEET5XR6J4rI8gUrwQu4haCveBp4T4FI8LPxD N6HO1CpQZYD4NIE2eAOzFJiUNlOjgwgNT7qd0j2ElVpspB9YdX/yjoTs/uGl+OneBRvv QpN0TLkXRHDMX7ZC44SFINNbzVbWzkZ+ISHEZZAPRaI5AWx6OMCWuhNEfHcM9ugGH+r0 kVEVtRc4aJV4PapyHw/f24I0WO5fsVbCph00kX7+NT+OicOB8DQyrFc/JicKykQpISW5 OD2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707989817; x=1708594617; 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=r0xEyIIS/tv0UXDMyOsQAyxi6COhgq9kYeUYOeDXc8c=; b=XPU9NDWEGGlgJRhfPvI84IIAHJNgScoGKpaUfhKrymQq9qQBEksTRZq3l1y/K8L2VL pX4Baru731YpmErM8gMidbzjxvgcv7tRY/D98+dKbfKPgSpj3ok9vQZlb77ebhwQZIJ3 CdwXS/XxFesnApcGFlzk0WN2pM3wRvJLRAaZxS/+BXQcDetceaQCEYlMUNFcwZf5zsn5 dS2HLAJQN4OoHCIlxo6UpgK1E9/dzZG07Mi20jnXruHrV/Hd/6xGChSqWXEenN3aXarX Ly3ddiWThuzRKJhb9vJbweoltLfeRxc3mDbA+gOl3VWQqkZwbex5fqReyOZjKKvRgErL 2VPw== X-Gm-Message-State: AOJu0Yw06GSOzsad/fE1jksmNCQJR0H+CfTZmhFjo8ReYrQisHRmVBUv n702tvkuwPghKlAkXpAozmdkAhzRXzpKPDFbFkEk9ypY3l8H1inQtr1fXfTegZEYHLwXQc+DsZO j X-Google-Smtp-Source: AGHT+IHFm7jDUJt+CrTpA4FBEWfq/7UW2/LEyOXohhylCos4LIsb8QXyQk6urj5P09j6MTjQtLxkmg== X-Received: by 2002:a17:906:4ec1:b0:a3d:1170:e6e3 with SMTP id i1-20020a1709064ec100b00a3d1170e6e3mr873474ejv.14.1707989817485; Thu, 15 Feb 2024 01:36:57 -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.36.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 01:36:55 -0800 (PST) From: Max Kellermann To: linux-kernel@vger.kernel.org Cc: Max Kellermann Subject: [PATCH v1 2/8] include/drm/drm_fixed.h: include linux/wordpart.h instead of linux/kernel.h Date: Thu, 15 Feb 2024 10:36:40 +0100 Message-Id: <20240215093646.3265823-3-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: quoted-printable Content-Type: text/plain; charset="utf-8" This header only needs lower_32_bits(), but nothing else from kernel.h. Signed-off-by: Max Kellermann --- include/drm/drm_fixed.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/drm/drm_fixed.h b/include/drm/drm_fixed.h index 0c9f917a4d4b..ff9a91fa40b6 100644 --- a/include/drm/drm_fixed.h +++ b/include/drm/drm_fixed.h @@ -25,7 +25,7 @@ #ifndef DRM_FIXED_H #define DRM_FIXED_H =20 -#include +#include // for lower_32_bits() #include =20 typedef union dfixed { --=20 2.39.2 From nobody Sat Feb 7 22:06:45 2026 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (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 A57C917741 for ; Thu, 15 Feb 2024 09:37:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707989823; cv=none; b=mVW8D1D1Std04weHUPI3dZCfmEwd9tOJC+ENNzfJcP1i920gsuk21kN+RcntiIoXsAWQp9vw8428qL5duh9NQKmM+qFNn1azCQsjw/kTjwQgTENazMm1Ajzklmpq6L8rWnmeYjcF9SMokxHY06pWbsaJXGHn0D9H206utYLZOVI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707989823; c=relaxed/simple; bh=aHKYH9vQ7JcKnIwHUJk+K0PHkYd1aK39zza+S+q5sZc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sjaCNOOuH3X55naYBpChwUx84//A8ZrrHrWbGa6DZmLj0OPuHmQzTobjiWRA8YB0YU96+tv3BeAqwRvt6SpgGXsJ8lURv52JxTRKO/dxOVrKO/ZoGNkIPR0YMpEq3olzmZ2dYJF8XhWEgvkbrX7wl+RSZ4rKyczHvkhTK4wsICU= 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=RG4slG63; arc=none smtp.client-ip=209.85.218.46 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="RG4slG63" Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-a3da5bf7f9cso26000166b.1 for ; Thu, 15 Feb 2024 01:37:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1707989818; x=1708594618; 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=m7dUZOBLu7d+3R+DKHO2TzD/GDIM7CR+ZFQySZN2YdQ=; b=RG4slG634Nd/V5uD81rPAdcXUVt/QNjQV8C1lWfF2KjNp1tbz7pppnO5EKBvpYzBF0 nK0cbP3PTk1KOZFRCKkhvMsPJ+F/LoBNMVjs16XWI1SkF8xiKf1f4kzzkLLA7n7wvg6O YbgKdlbaabWtUCxofsIlCjNy2mJBxCqgel4W9l6n44FMUyCzHl0HBbTfKDAPt7gp+5oz FGgZghhljJtlLzy/7J5NzQG98aIRV3Dr7nXjoWSJmZ9TNYKNCTD83TTRpyiuqRNgeiHV H9xtXa3HGK3aBOi61jz9qSBGaqP1p7/B3gGhumJPozxgiNl8V4HQO3aBI55Jgy7BWkP2 g9zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707989818; x=1708594618; 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=m7dUZOBLu7d+3R+DKHO2TzD/GDIM7CR+ZFQySZN2YdQ=; b=dM13CgCUEevSHn2uKOfOHqKrpDlynEya83Yjq2zQ1YHT6NKQNxAEbbZuMKAVXHQaJ9 RwTdbSbzsZ7VOPo5lAJGI1EwUQ8kydc/Or3l3MDHRumlIthQ48iL0wA5dCdtTlegT5CP thDjOWADXxeKq2Vv9Uuk8pACAjpsvUQPwum3M8CGXQHV5/oivmjqjD4+M+gf6O+qH09i py/l6EwjdZpotEcAtGicmjPnLj8Ckly5TzQCFHXsgTrexXg75ZT8Z1j1fko/h7HrXpUy iPi5yvCmCSfJkC2WX6cl2NC4PF+6Q/TMYH61qPJMon/cwOrGo2/vfoiIHRE8K+ZFbuH4 wjsQ== X-Gm-Message-State: AOJu0YxYg1OVXy5JB2J5zpN1gjdFbMTBwLbIXe8NhpXtVVlDCpxqmw23 KBmNLKteq48LfS4qOvbCH2X93Ov6Xe/hxakMKe0x1wtoUk2kLVxG+0sKjpnFyPRKfWnOmIV9RmY Z X-Google-Smtp-Source: AGHT+IFUXii2K0AUUpMDVe1jokORv8xAqgKb9r+fePYUohnjQor5QUILIeJjCrEzoMJ9tSh3SHsKWw== X-Received: by 2002:a17:906:7196:b0:a3d:1899:ec3 with SMTP id h22-20020a170906719600b00a3d18990ec3mr884874ejk.35.1707989818387; Thu, 15 Feb 2024 01:36:58 -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.36.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 01:36:57 -0800 (PST) From: Max Kellermann To: linux-kernel@vger.kernel.org Cc: Max Kellermann Subject: [PATCH v1 3/8] include linux/wordpart.h in various sources that need it Date: Thu, 15 Feb 2024 10:36:41 +0100 Message-Id: <20240215093646.3265823-4-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: quoted-printable Content-Type: text/plain; charset="utf-8" After commit edf2f6fb51bc ("kernel.h: Move upper_*_bits() and lower_*_bits() to wordpart.h"), the lower/upper_*_bits functions can be found in that header, and all sources that use those functions should include the header that provides it. This is just the beginning, many more sources are still missing, but a large patch adding the "#include" everywhere (700+ sources) would be hard to review. (Found with "git grep -E '\b(upper|lower)_(16|32)_bits\('") Signed-off-by: Max Kellermann --- arch/arm64/include/asm/syscall.h | 1 + arch/arm64/kvm/handle_exit.c | 1 + drivers/bus/uniphier-system-bus.c | 1 + drivers/irqchip/irq-gic-v3-its.c | 1 + drivers/spi/spi-pci1xxxx.c | 1 + fs/ext4/super.c | 1 + fs/hfs/hfs_fs.h | 1 + fs/hfsplus/hfsplus_fs.h | 1 + fs/notify/fanotify/fanotify_user.c | 1 + fs/open.c | 1 + fs/ufs/util.h | 1 + include/linux/dma-fence.h | 1 + include/linux/qed/common_hsi.h | 1 + include/rdma/uverbs_ioctl.h | 2 +- include/soc/fsl/bman.h | 2 ++ include/soc/fsl/qman.h | 1 + 16 files changed, 17 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/syscall.h b/arch/arm64/include/asm/sysc= all.h index ab8e14b96f68..e5f462cc1a54 100644 --- a/arch/arm64/include/asm/syscall.h +++ b/arch/arm64/include/asm/syscall.h @@ -8,6 +8,7 @@ #include #include #include +#include // for lower_32_bits() =20 typedef long (*syscall_fn_t)(const struct pt_regs *regs); =20 diff --git a/arch/arm64/kvm/handle_exit.c b/arch/arm64/kvm/handle_exit.c index 617ae6dea5d5..91bd5b701acf 100644 --- a/arch/arm64/kvm/handle_exit.c +++ b/arch/arm64/kvm/handle_exit.c @@ -10,6 +10,7 @@ =20 #include #include +#include // for lower_32_bits(), upper_32_bits() =20 #include #include diff --git a/drivers/bus/uniphier-system-bus.c b/drivers/bus/uniphier-syste= m-bus.c index cb5c89ce7b86..964f31287d3c 100644 --- a/drivers/bus/uniphier-system-bus.c +++ b/drivers/bus/uniphier-system-bus.c @@ -10,6 +10,7 @@ #include #include #include +#include // for upper_32_bits() =20 /* System Bus Controller registers */ #define UNIPHIER_SBC_BASE 0x100 /* base address of bank0 space */ diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-= its.c index 201055382bd1..94f917352ac6 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -29,6 +29,7 @@ #include #include #include +#include // for lower_32_bits(), upper_32_bits() =20 #include #include diff --git a/drivers/spi/spi-pci1xxxx.c b/drivers/spi/spi-pci1xxxx.c index 969965d7bc98..775673861c79 100644 --- a/drivers/spi/spi-pci1xxxx.c +++ b/drivers/spi/spi-pci1xxxx.c @@ -9,6 +9,7 @@ #include #include #include +#include // for upper_32_bits(), lower_32_bits() #include #include #include diff --git a/fs/ext4/super.c b/fs/ext4/super.c index e487623f9456..6a7686343bd0 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -48,6 +48,7 @@ #include #include #include +#include // for lower_32_bits(), upper_32_bits() =20 #include "ext4.h" #include "ext4_extents.h" /* Needed for trace points definition */ diff --git a/fs/hfs/hfs_fs.h b/fs/hfs/hfs_fs.h index b5a6ad5df357..514d3856aa27 100644 --- a/fs/hfs/hfs_fs.h +++ b/fs/hfs/hfs_fs.h @@ -20,6 +20,7 @@ #include #include #include +#include // for lower_32_bits() #include =20 #include diff --git a/fs/hfsplus/hfsplus_fs.h b/fs/hfsplus/hfsplus_fs.h index 7ededcb720c1..79cac82d050e 100644 --- a/fs/hfsplus/hfsplus_fs.h +++ b/fs/hfsplus/hfsplus_fs.h @@ -21,6 +21,7 @@ #include #include #include +#include // for lower_32_bits() #include "hfsplus_raw.h" =20 #define DBG_BNODE_REFS 0x00000001 diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanoti= fy_user.c index fbdc63cc10d9..9ca5adbf39ae 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c @@ -20,6 +20,7 @@ #include #include #include +#include // for upper_32_bits() =20 #include =20 diff --git a/fs/open.c b/fs/open.c index a7d4bb2c725f..b006de16a15a 100644 --- a/fs/open.c +++ b/fs/open.c @@ -34,6 +34,7 @@ #include #include #include +#include // for upper_32_bits() =20 #include "internal.h" =20 diff --git a/fs/ufs/util.h b/fs/ufs/util.h index 0ecd2ed792f5..0d4b89794cc5 100644 --- a/fs/ufs/util.h +++ b/fs/ufs/util.h @@ -9,6 +9,7 @@ =20 #include #include +#include // for lower_32_bits() #include "swab.h" =20 /* diff --git a/include/linux/dma-fence.h b/include/linux/dma-fence.h index e06bad467f55..02ad83247ea8 100644 --- a/include/linux/dma-fence.h +++ b/include/linux/dma-fence.h @@ -22,6 +22,7 @@ #include #include #include +#include // for lower_32_bits() =20 struct dma_fence; struct dma_fence_ops; diff --git a/include/linux/qed/common_hsi.h b/include/linux/qed/common_hsi.h index 827624840ee2..fa9cc2be077f 100644 --- a/include/linux/qed/common_hsi.h +++ b/include/linux/qed/common_hsi.h @@ -11,6 +11,7 @@ #include #include #include +#include // for lower_32_bits(), upper_32_bits() =20 /* dma_addr_t manip */ #define PTR_LO(x) ((u32)(((uintptr_t)(x)) & 0xffffffff)) diff --git a/include/rdma/uverbs_ioctl.h b/include/rdma/uverbs_ioctl.h index 06287de69cd2..5ed57a660ead 100644 --- a/include/rdma/uverbs_ioctl.h +++ b/include/rdma/uverbs_ioctl.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ -/* + /* * Copyright (c) 2017, Mellanox Technologies inc. All rights reserved. */ =20 diff --git a/include/soc/fsl/bman.h b/include/soc/fsl/bman.h index 173e4049d963..b01d8c0ac204 100644 --- a/include/soc/fsl/bman.h +++ b/include/soc/fsl/bman.h @@ -31,6 +31,8 @@ #ifndef __FSL_BMAN_H #define __FSL_BMAN_H =20 +#include // for upper_32_bits() + /* wrapper for 48-bit buffers */ struct bm_buffer { union { diff --git a/include/soc/fsl/qman.h b/include/soc/fsl/qman.h index 0d3d6beb7fdb..c5230a844114 100644 --- a/include/soc/fsl/qman.h +++ b/include/soc/fsl/qman.h @@ -33,6 +33,7 @@ =20 #include #include +#include // for upper_32_bits() =20 /* Hardware constants */ #define QM_CHANNEL_SWPORTAL0 0 --=20 2.39.2 From nobody Sat Feb 7 22:06:45 2026 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (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 8523417BA6 for ; Thu, 15 Feb 2024 09:37:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707989823; cv=none; b=tCiZQn5YHzHOy63+b+dartyquc8zEOB4xkR2wkdV5tBg+HRZxucsXL6XwsIisrGFt9H8/C6k17ZXGNO63BFvoHC0RtbZq4XmFM3NmZV3XHAZ7xhydup3V8raT/SPaXfmynccc6sW6EnsyF6KkTXOYiCMVIi71irzMB/h/PY5g9U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707989823; c=relaxed/simple; bh=xUBeVNY5mqTWjVsqFsHwlt9icptll46YRyGdat/hD6s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QQUUlCHALk2Kx1GjCxTxNdYWdWW2O6oOPLec7kcgMI3GBWgZSwRlRg0DHQYxDT2jPQPNjw1vTo25TVVRr4CgDLDxqOjvbsL9g+PAY8cuYg5rM/uf4A2e7+T9BGdllJoUu45w8lDJM56hqhvigq1yOuShg7tlbswmDeQ7QpL6HEc= 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=TQG+iyxn; arc=none smtp.client-ip=209.85.218.53 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="TQG+iyxn" Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a30f7c9574eso82267666b.0 for ; Thu, 15 Feb 2024 01:37:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1707989819; x=1708594619; 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=GL6ddD5YKfOqRj2RNy6xNtOts5S4Jrg36FUNpDVDuuc=; b=TQG+iyxnc/h06yz/3oGbWd5uEICugybXWLY+DMR1HZM9OXiQOmAIVM/Mt5DSyaxZKA UT236ix3YDlFcspWvEMqo8PLTQX/5nJolB7Ga8pYCWb/KU5Twr7ILXTU4wdYtlbrB78p BKmPvKvWHSB4bMT4Ffq2pv8xhRG0lAp5bs2nCacyAoBt061MhDHOMQI7i9q+sbGEmgjW snuqUevNA3esDClhjSwTUrHUSZvuHihi41qFaq5bWfuYK8RvgeRoAC++81Amu9Q2Jh7s 10a8g9jHsRVJmgzftATFe9T5qSkLSyG2IMwm+WBSLhDlAvcbCfnmyhAJgS8+kd5dj05u ak1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707989819; x=1708594619; 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=GL6ddD5YKfOqRj2RNy6xNtOts5S4Jrg36FUNpDVDuuc=; b=S08FcO0oel/EOCeIlE5U1c7SjZndG7QC92HvAehvE+q8j3bVRZ3f/noYCZMj5D0+Uz GXOXZvS/GXGHqbzklwxPr0Gcq1vrgxJoRai8iVtjJuxZgfDQedQzCuKi/Cv2crXYKMoH jZFwD+zlyWPtFvgtXQd5uGv2j1GzKdXB22rHahVznD4TWVGIZ9HPoNPGwd4UiPdMBtl3 RIIUlD3pqtW2j9ieiT20QDE1dSHh2my+hkQUFdtWH11D1TxVODWj2iGGt60usmFaY3Rz +Gk+aOty+uF8XEDlgdStet/faXChdAh2ZwMURD+vqsHPKQyIoZcrD+ISsdj5fTciu1gf 7LYw== X-Gm-Message-State: AOJu0YyiiAccA958jgKLPWsb/5u84offjo5a84m8yfCLfawzaDGrXqYZ A6ckKz69jUxkTDszLcVdy8xCaSRybfntpf/9wKJcUTy8b9ZUT0BKcFqDt9HBv085Snj9NxH0qRn O X-Google-Smtp-Source: AGHT+IFKovbvRD4nM7jYJAm/c/6mKzcl/mhel0DkVeHVpthVNm9Y0BUq/Ofiw38jouZkypaeeI6laQ== X-Received: by 2002:a17:906:f9ca:b0:a3d:2cce:a8df with SMTP id lj10-20020a170906f9ca00b00a3d2ccea8dfmr758183ejb.36.1707989818839; Thu, 15 Feb 2024 01:36:58 -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.36.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 01:36:58 -0800 (PST) From: Max Kellermann To: linux-kernel@vger.kernel.org Cc: Max Kellermann Subject: [PATCH v1 4/8] linux/random.h: reduce dependencies on linux/kernel.h Date: Thu, 15 Feb 2024 10:36:42 +0100 Message-Id: <20240215093646.3265823-5-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: quoted-printable Content-Type: text/plain; charset="utf-8" This header doesn't need kernel.h at all, but if we remove it, the build breaks because kernel.h includes limits.h and log2.h, which random.h needs. list.h is also removed because it is not needed at all. Signed-off-by: Max Kellermann --- include/linux/random.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/random.h b/include/linux/random.h index b0a940af4fff..3183025ddda9 100644 --- a/include/linux/random.h +++ b/include/linux/random.h @@ -4,8 +4,8 @@ #define _LINUX_RANDOM_H =20 #include -#include -#include +#include // for U32_MAX +#include // for is_power_of_2() =20 #include =20 --=20 2.39.2 From nobody Sat Feb 7 22:06:45 2026 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (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 DF86B19BA2 for ; Thu, 15 Feb 2024 09:37:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707989825; cv=none; b=qoc/NlQpYnLNz7t1I2B1nErAG5Xa3kAiGHCNL+kmaYTXVMnPyyk4ig+6WaUXFJjt6CCCMBiYbaAkDbteVXbuUX76UfrI9nzTcJtoGEP+C4g6x87DGlcW2guYy8knhSET/1BP6xXszb167DvnYm4RygxC41d5E97eZ1P+uv8a2jQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707989825; c=relaxed/simple; bh=CdEuuuBkx27AhOlXJUVeX0lAXi7og7ZMYumDFcK6vwA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=OSuO9RoUIAHeohqSjuuZwKqNgJI/wJCaIZfgg5AKqnkugXH9yBt9W5PfhtitI/jph8U67Htox8wjCXlY7SqiwAIpPgYM1cyGehhQSJ0BUbEb8GYPIWy+nfUGzTbF5vq1u1y4Vb26U19wyhcEhqLlE+oBdNPI4llP/m7/5hw5XPs= 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=czqseyJv; arc=none smtp.client-ip=209.85.218.50 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="czqseyJv" Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a389ea940f1so80090166b.3 for ; Thu, 15 Feb 2024 01:37:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1707989820; x=1708594620; 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=LJvnBCQWBBDb6zNhkGV5El1e2yPo8rIgW0kOJAtMnfQ=; b=czqseyJvkJp6rC0dxUwnNYq15BUbDylSYhkZwRVuyxee7QAqQMaGLfGCN9Q3lBHIAu mNUHdcpPGAt+yYY5Tlx3HS1sTUJb4Xph78bTL87wMiZqLBahnwgsT0VV+lHIbHEG2Rlx olaTEmCkrsSpL+FXHfci5Jcg8oCQWVBKOX5d4Qk+E+VB9XPSumuL6k8GoI8geOuTvTfC kMgmiHCksIRH55VsCNYbtrJy0S+f3dI022l+4LUf//ZuVRMiOz8anECY33qIVR5K6GD1 Zxuoerkm2/j5sMnQu0/isHh1fWwUizD4DMM1qFEQPKi7P6WJxuk98+SSp+9qiHdk89Ow lnwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707989820; x=1708594620; 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=LJvnBCQWBBDb6zNhkGV5El1e2yPo8rIgW0kOJAtMnfQ=; b=kLqF4mqAAOpcUrMdqYNei6Aqz7vvWbaz1pD0uCX3ZtZjyv6Hi7gUQ9qvrWkgBEQ++b Ny05/KDSxuFeG7sSGY8fMhyrH/8MQAGEnDfnHXQ7oH8d7woAD0loiFyTLLWOA/g2KCVp ZaxjFQxJE9vxSJBMRGPZsdxFWBnYm4Digf1eM8O+7awA6w396+m+6LcVo0ho34ue9Wfr ugKipXiHAqzcbePWd3WSYBesnNJxsW0YgpxQy84ReTq8IjIB6TxrufUHdUwwCU0xn0ti OXVaf7v2USFVmscNtedHkoKSwptL3vSNgkplteSs33kcL7psSDVytIDCPWsVkLIsSkS1 LbgQ== X-Gm-Message-State: AOJu0YzfCKLo0bgMKAMnqdbLpCY9BefreZ7+arAGi7Z0b/stVR/Wlg2f 4tNI3B2D/kmhUZZ5EJF5UWiaHX8mXObiwqTFye9qiBskFqnsKhMTL6WIbhvnLu+9kE2LbOgv0LW H X-Google-Smtp-Source: AGHT+IFYtxVlr5GCb+SwzUl58JUMU+GfVqWXvAo8YhrYMfVlZQPjqvQH5d2FDoPJl5X2WJFmsWho1A== X-Received: by 2002:a17:906:138b:b0:a31:7dc1:c7c1 with SMTP id f11-20020a170906138b00b00a317dc1c7c1mr721493ejc.65.1707989820315; Thu, 15 Feb 2024 01:37:00 -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.36.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 01:36:59 -0800 (PST) From: Max Kellermann To: linux-kernel@vger.kernel.org Cc: Max Kellermann Subject: [PATCH v1 5/8] linux/kernel.h: move might_sleep(), ... to sched/debug_atomic_sleep.h Date: Thu, 15 Feb 2024 10:36:43 +0100 Message-Id: <20240215093646.3265823-6-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: quoted-printable Content-Type: text/plain; charset="utf-8" Reducing dependencies on the header linux/kernel.h. Signed-off-by: Max Kellermann --- include/linux/clk.h | 1 + include/linux/gpio/consumer.h | 2 +- include/linux/kernel.h | 106 --------------------- include/linux/mmu_notifier.h | 1 + include/linux/pwm.h | 2 + include/linux/rcutiny.h | 1 + include/linux/sched.h | 1 + include/linux/sched/debug_atomic_sleep.h | 114 +++++++++++++++++++++++ include/linux/sched/mm.h | 2 +- include/linux/uaccess.h | 1 + include/linux/wait.h | 1 + include/linux/wait_bit.h | 1 + security/landlock/object.c | 1 + security/landlock/ruleset.c | 1 + 14 files changed, 127 insertions(+), 108 deletions(-) create mode 100644 include/linux/sched/debug_atomic_sleep.h diff --git a/include/linux/clk.h b/include/linux/clk.h index 06f1b292f8a0..2fcae620703b 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -12,6 +12,7 @@ #include #include #include +#include // for might_sleep() =20 struct device; struct clk; diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h index db2dfbae8edb..a02927330429 100644 --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h @@ -184,7 +184,7 @@ struct gpio_desc *devm_fwnode_gpiod_get_index(struct de= vice *dev, #else /* CONFIG_GPIOLIB */ =20 #include -#include +#include // for might_sleep() =20 #include =20 diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 86dd8939c2cd..f6a978d51c1d 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -57,112 +57,6 @@ struct completion; struct user; =20 -#ifdef CONFIG_PREEMPT_VOLUNTARY_BUILD - -extern int __cond_resched(void); -# define might_resched() __cond_resched() - -#elif defined(CONFIG_PREEMPT_DYNAMIC) && defined(CONFIG_HAVE_PREEMPT_DYNAM= IC_CALL) - -extern int __cond_resched(void); - -DECLARE_STATIC_CALL(might_resched, __cond_resched); - -static __always_inline void might_resched(void) -{ - static_call_mod(might_resched)(); -} - -#elif defined(CONFIG_PREEMPT_DYNAMIC) && defined(CONFIG_HAVE_PREEMPT_DYNAM= IC_KEY) - -extern int dynamic_might_resched(void); -# define might_resched() dynamic_might_resched() - -#else - -# define might_resched() do { } while (0) - -#endif /* CONFIG_PREEMPT_* */ - -#ifdef CONFIG_DEBUG_ATOMIC_SLEEP -extern void __might_resched(const char *file, int line, unsigned int offse= ts); -extern void __might_sleep(const char *file, int line); -extern void __cant_sleep(const char *file, int line, int preempt_offset); -extern void __cant_migrate(const char *file, int line); - -/** - * might_sleep - annotation for functions that can sleep - * - * this macro will print a stack trace if it is executed in an atomic - * context (spinlock, irq-handler, ...). Additional sections where blockin= g is - * not allowed can be annotated with non_block_start() and non_block_end() - * pairs. - * - * This is a useful debugging help to be able to catch problems early and = not - * be bitten later when the calling function happens to sleep when it is n= ot - * supposed to. - */ -# define might_sleep() \ - do { __might_sleep(__FILE__, __LINE__); might_resched(); } while (0) -/** - * cant_sleep - annotation for functions that cannot sleep - * - * this macro will print a stack trace if it is executed with preemption e= nabled - */ -# define cant_sleep() \ - do { __cant_sleep(__FILE__, __LINE__, 0); } while (0) -# define sched_annotate_sleep() (current->task_state_change =3D 0) - -/** - * cant_migrate - annotation for functions that cannot migrate - * - * Will print a stack trace if executed in code which is migratable - */ -# define cant_migrate() \ - do { \ - if (IS_ENABLED(CONFIG_SMP)) \ - __cant_migrate(__FILE__, __LINE__); \ - } while (0) - -/** - * non_block_start - annotate the start of section where sleeping is prohi= bited - * - * This is on behalf of the oom reaper, specifically when it is calling th= e mmu - * notifiers. The problem is that if the notifier were to block on, for ex= ample, - * mutex_lock() and if the process which holds that mutex were to perform a - * sleeping memory allocation, the oom reaper is now blocked on completion= of - * that memory allocation. Other blocking calls like wait_event() pose sim= ilar - * issues. - */ -# define non_block_start() (current->non_block_count++) -/** - * non_block_end - annotate the end of section where sleeping is prohibited - * - * Closes a section opened by non_block_start(). - */ -# define non_block_end() WARN_ON(current->non_block_count-- =3D=3D 0) -#else - static inline void __might_resched(const char *file, int line, - unsigned int offsets) { } -static inline void __might_sleep(const char *file, int line) { } -# define might_sleep() do { might_resched(); } while (0) -# define cant_sleep() do { } while (0) -# define cant_migrate() do { } while (0) -# define sched_annotate_sleep() do { } while (0) -# define non_block_start() do { } while (0) -# define non_block_end() do { } while (0) -#endif - -#define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0) - -#if defined(CONFIG_MMU) && \ - (defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP)) -#define might_fault() __might_fault(__FILE__, __LINE__) -void __might_fault(const char *file, int line); -#else -static inline void might_fault(void) { } -#endif - void do_exit(long error_code) __noreturn; =20 extern int get_option(char **str, int *pint); diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h index f349e08a9dfe..ac6bca927257 100644 --- a/include/linux/mmu_notifier.h +++ b/include/linux/mmu_notifier.h @@ -6,6 +6,7 @@ #include #include #include +#include // for might_sleep() #include #include =20 diff --git a/include/linux/pwm.h b/include/linux/pwm.h index 8ffe9ae7a23a..334cacfcb74a 100644 --- a/include/linux/pwm.h +++ b/include/linux/pwm.h @@ -402,6 +402,8 @@ struct pwm_device *devm_fwnode_pwm_get(struct device *d= ev, struct fwnode_handle *fwnode, const char *con_id); #else +#include // for might_sleep() + static inline bool pwm_might_sleep(struct pwm_device *pwm) { return true; diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index d9ac7b136aea..e7b6acfbf054 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h @@ -12,6 +12,7 @@ #ifndef __LINUX_TINY_H #define __LINUX_TINY_H =20 +#include // for might_sleep() #include /* for HZ */ =20 struct rcu_gp_oldstate { diff --git a/include/linux/sched.h b/include/linux/sched.h index 3c2abbc587b4..74167388ca72 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -31,6 +31,7 @@ #include #include #include +#include // for __might_resched() #include #include #include diff --git a/include/linux/sched/debug_atomic_sleep.h b/include/linux/sched= /debug_atomic_sleep.h new file mode 100644 index 000000000000..018d4a421a80 --- /dev/null +++ b/include/linux/sched/debug_atomic_sleep.h @@ -0,0 +1,114 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_SCHED_DEBUG_ATOMIC_SLEEP_H +#define _LINUX_SCHED_DEBUG_ATOMIC_SLEEP_H + +#ifdef CONFIG_PREEMPT_VOLUNTARY_BUILD + +extern int __cond_resched(void); +# define might_resched() __cond_resched() + +#elif defined(CONFIG_PREEMPT_DYNAMIC) && defined(CONFIG_HAVE_PREEMPT_DYNAM= IC_CALL) + +#include + +extern int __cond_resched(void); + +DECLARE_STATIC_CALL(might_resched, __cond_resched); + +static __always_inline void might_resched(void) +{ + static_call_mod(might_resched)(); +} + +#elif defined(CONFIG_PREEMPT_DYNAMIC) && defined(CONFIG_HAVE_PREEMPT_DYNAM= IC_KEY) + +extern int dynamic_might_resched(void); +# define might_resched() dynamic_might_resched() + +#else + +# define might_resched() do { } while (0) + +#endif /* CONFIG_PREEMPT_* */ + +#ifdef CONFIG_DEBUG_ATOMIC_SLEEP +extern void __might_resched(const char *file, int line, unsigned int offse= ts); +extern void __might_sleep(const char *file, int line); +extern void __cant_sleep(const char *file, int line, int preempt_offset); +extern void __cant_migrate(const char *file, int line); + +/** + * might_sleep - annotation for functions that can sleep + * + * this macro will print a stack trace if it is executed in an atomic + * context (spinlock, irq-handler, ...). Additional sections where blockin= g is + * not allowed can be annotated with non_block_start() and non_block_end() + * pairs. + * + * This is a useful debugging help to be able to catch problems early and = not + * be bitten later when the calling function happens to sleep when it is n= ot + * supposed to. + */ +# define might_sleep() \ + do { __might_sleep(__FILE__, __LINE__); might_resched(); } while (0) +/** + * cant_sleep - annotation for functions that cannot sleep + * + * this macro will print a stack trace if it is executed with preemption e= nabled + */ +# define cant_sleep() \ + do { __cant_sleep(__FILE__, __LINE__, 0); } while (0) +# define sched_annotate_sleep() (current->task_state_change =3D 0) + +/** + * cant_migrate - annotation for functions that cannot migrate + * + * Will print a stack trace if executed in code which is migratable + */ +# define cant_migrate() \ + do { \ + if (IS_ENABLED(CONFIG_SMP)) \ + __cant_migrate(__FILE__, __LINE__); \ + } while (0) + +/** + * non_block_start - annotate the start of section where sleeping is prohi= bited + * + * This is on behalf of the oom reaper, specifically when it is calling th= e mmu + * notifiers. The problem is that if the notifier were to block on, for ex= ample, + * mutex_lock() and if the process which holds that mutex were to perform a + * sleeping memory allocation, the oom reaper is now blocked on completion= of + * that memory allocation. Other blocking calls like wait_event() pose sim= ilar + * issues. + */ +# define non_block_start() (current->non_block_count++) +/** + * non_block_end - annotate the end of section where sleeping is prohibited + * + * Closes a section opened by non_block_start(). + */ +# define non_block_end() WARN_ON(current->non_block_count-- =3D=3D 0) +#else + static inline void __might_resched(const char *file, int line, + unsigned int offsets) { } +static inline void __might_sleep(const char *file, int line) { } +# define might_sleep() do { might_resched(); } while (0) +# define cant_sleep() do { } while (0) +# define cant_migrate() do { } while (0) +# define sched_annotate_sleep() do { } while (0) +# define non_block_start() do { } while (0) +# define non_block_end() do { } while (0) +#endif + +#define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0) + +#if defined(CONFIG_MMU) && \ + (defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP)) +#define might_fault() __might_fault(__FILE__, __LINE__) +void __might_fault(const char *file, int line); +#else +static inline void might_fault(void) { } +#endif + + +#endif diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h index d6eb56934068..62ac412a5dae 100644 --- a/include/linux/sched/mm.h +++ b/include/linux/sched/mm.h @@ -2,9 +2,9 @@ #ifndef _LINUX_SCHED_MM_H #define _LINUX_SCHED_MM_H =20 -#include #include #include +#include // for might_sleep_if() #include #include #include diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h index 3064314f4832..8ea27d05f17e 100644 --- a/include/linux/uaccess.h +++ b/include/linux/uaccess.h @@ -6,6 +6,7 @@ #include #include #include +#include // for might_faul() #include =20 #include diff --git a/include/linux/wait.h b/include/linux/wait.h index 8aa3372f21a0..61e7f0d9f07e 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -5,6 +5,7 @@ * Linux wait queue related types and methods */ #include +#include // for might_sleep() #include #include =20 diff --git a/include/linux/wait_bit.h b/include/linux/wait_bit.h index 7725b7579b78..708d3b3534f6 100644 --- a/include/linux/wait_bit.h +++ b/include/linux/wait_bit.h @@ -6,6 +6,7 @@ * Linux wait-bit related types and methods: */ #include +#include // for might_sleep() =20 struct wait_bit_key { void *flags; diff --git a/security/landlock/object.c b/security/landlock/object.c index 1f50612f0185..feb2dec3d89a 100644 --- a/security/landlock/object.c +++ b/security/landlock/object.c @@ -12,6 +12,7 @@ #include #include #include +#include // for might_sleep() #include #include =20 diff --git a/security/landlock/ruleset.c b/security/landlock/ruleset.c index e0a5fbf9201a..36396959a0e9 100644 --- a/security/landlock/ruleset.c +++ b/security/landlock/ruleset.c @@ -16,6 +16,7 @@ #include #include #include +#include // for might_sleep_if() #include #include #include --=20 2.39.2 From nobody Sat Feb 7 22:06:45 2026 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (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 6E5E219BCA for ; Thu, 15 Feb 2024 09:37:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707989826; cv=none; b=JUVS8XTXWGMzW00ndY+t5DmzkymUen7gtY7MOByRoa9/DHPDBxHNyjhdSUXQLfnJUufUEIjylcZ8V+1wEB7rM2BfPOBy0Gvfv8u15hy8kVWImkspa8fZkblnZOsmaB/MCV04riWDLYz3zUf0ib0TQpJJ1i04iSFvluthqVL9qK4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707989826; c=relaxed/simple; bh=qa3ESH7vWTFVNhW4xY+/8wA/zae1Q18vWxlN7dbb6J0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FMp64NpAp9ZeOzvU4rA4xeuhF4Phc+qktEPbC0Dou90irESwlvL49qnEDntvLhfKPAvNCCsbySDqhVH7YUqyArgmNngyQ9pI68NsiUa2n+O14cC9jitgon3M5qjpqcQqcbGnJ649BjwCqX4ufuxbYBMOyScKjYIzUiphM94d9K0= 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=NSzFrQ5u; arc=none smtp.client-ip=209.85.218.51 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="NSzFrQ5u" Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a3d62da9d25so74449466b.3 for ; Thu, 15 Feb 2024 01:37:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1707989821; x=1708594621; 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=+h1IEdtpwE+MgefySz12julwicOiuPFac8ie3+0rpxY=; b=NSzFrQ5u5Yt7t+fK0EdOlsh3Ei1hAx0oLDkWkymLfXQuTs+1oZr7kqZo8txNXBL1Pa Bwak8aEb6slBPPUA3idYNvHHrBcSrJD8zTb9hqSt4ebYueUORvwodNmuoWdtj7sd7r1j +xFRri3nIxlXOWtghW7EdoTlCPsABBMoihyMb9e2jRz+RmRtfHve7NfykCd9YjrEAppb X6wv2ffgoYHxopkHICfVRGHG1EuiF9wlGMhFcZ/MsIo55O3I4Wtf0jv/qbviPWSvfVK0 N32OS7Z4COufhtSj2Cz8LJ7qrtbKLqHjrladGCwSTm9SKjYRIDQBHAc8qfAofAEuesux nSMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707989821; x=1708594621; 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=+h1IEdtpwE+MgefySz12julwicOiuPFac8ie3+0rpxY=; b=DFs/UCN0DFvaISBatHiviSb7WjcLuAOY7lHJUXAaV6k3XzeI2EzSZf2g6I/j7/yGz6 pCdwblPcaziEVgUX+Req0FxwtILKkPmXZV8PW1tSgwvF6LPOvKv8jHb+Ro5R8BAzbTRN vvbxVyUot0eR1U8mQqY4AyttguC7Q1sp+VoG/eNzUOZ0NcA5qp6+cZ2JzRWv/ohlCm/N ZN+hP/mCd36/hnVtww6NLexMu4sqb/GlhUBkUU7pdVkR06eVQKJCXHjMV22mECEAbpx8 T2FdE+RB2AwRkrf5n8Ya0kNwh5mNETLhd46VlOhO0wgMeFH7jutO56FpAxLgJxoSJSFM 7Nag== X-Gm-Message-State: AOJu0Yw2hwmCuEnC9ZygIAm/98qx8PmXjKLaoWjWU/ChrAhcP+tFzsf6 KCbjwO3sdywVSOB3qYoLDdEbRgXJf8QMl6lNOA4cBKkY3gL3JsLM9SgT9ff3eCtcTGIr6COsF+h x X-Google-Smtp-Source: AGHT+IEUQzhbJGuDHy3NZszYofnMmzmppTOLEzLxDW4Z+z34IcFGwZfKaQbb0RuKLXrx148oDnt7RQ== X-Received: by 2002:a17:906:2c55:b0:a3c:770:1752 with SMTP id f21-20020a1709062c5500b00a3c07701752mr794174ejh.68.1707989820789; Thu, 15 Feb 2024 01:37:00 -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.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 01:37:00 -0800 (PST) From: Max Kellermann To: linux-kernel@vger.kernel.org Cc: Max Kellermann Subject: [PATCH v1 6/8] linux/kernel.h: move READ and WRITE to direction.h Date: Thu, 15 Feb 2024 10:36:44 +0100 Message-Id: <20240215093646.3265823-7-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: quoted-printable Content-Type: text/plain; charset="utf-8" Reducing dependencies on the header linux/kernel.h. Signed-off-by: Max Kellermann --- drivers/input/misc/iqs7222.c | 1 + drivers/memstick/core/memstick.c | 1 + drivers/memstick/host/jmb38x_ms.c | 1 + drivers/memstick/host/r592.c | 1 + drivers/memstick/host/rtsx_pci_ms.c | 1 + drivers/memstick/host/rtsx_usb_ms.c | 1 + drivers/memstick/host/tifm_ms.c | 1 + fs/overlayfs/copy_up.c | 1 + include/linux/direction.h | 9 +++++++++ include/linux/kernel.h | 4 ---- include/linux/nd.h | 1 + include/linux/uio.h | 2 +- 12 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 include/linux/direction.h diff --git a/drivers/input/misc/iqs7222.c b/drivers/input/misc/iqs7222.c index 36aeeae77611..622cec9bcfe8 100644 --- a/drivers/input/misc/iqs7222.c +++ b/drivers/input/misc/iqs7222.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/memstick/core/memstick.c b/drivers/memstick/core/memst= ick.c index 23fea51ecbdd..fcc28853d588 100644 --- a/drivers/memstick/core/memstick.c +++ b/drivers/memstick/core/memstick.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/memstick/host/jmb38x_ms.c b/drivers/memstick/host/jmb3= 8x_ms.c index e77eb8b0eb12..dc8e4f6a01df 100644 --- a/drivers/memstick/host/jmb38x_ms.c +++ b/drivers/memstick/host/jmb38x_ms.c @@ -6,6 +6,7 @@ */ =20 #include +#include #include #include #include diff --git a/drivers/memstick/host/r592.c b/drivers/memstick/host/r592.c index 461f5ffd02bc..9ab3a7a15674 100644 --- a/drivers/memstick/host/r592.c +++ b/drivers/memstick/host/r592.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/memstick/host/rtsx_pci_ms.c b/drivers/memstick/host/rt= sx_pci_ms.c index 15720a4afac2..4bd00d69a9b6 100644 --- a/drivers/memstick/host/rtsx_pci_ms.c +++ b/drivers/memstick/host/rtsx_pci_ms.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/memstick/host/rtsx_usb_ms.c b/drivers/memstick/host/rt= sx_usb_ms.c index 29271ad4728a..eeebdde571e6 100644 --- a/drivers/memstick/host/rtsx_usb_ms.c +++ b/drivers/memstick/host/rtsx_usb_ms.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/memstick/host/tifm_ms.c b/drivers/memstick/host/tifm_m= s.c index c272453670be..c46b6157aa25 100644 --- a/drivers/memstick/host/tifm_ms.c +++ b/drivers/memstick/host/tifm_ms.c @@ -10,6 +10,7 @@ =20 #include #include +#include #include #include #include diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c index 8586e2f5d243..465a7822b5dd 100644 --- a/fs/overlayfs/copy_up.c +++ b/fs/overlayfs/copy_up.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/include/linux/direction.h b/include/linux/direction.h new file mode 100644 index 000000000000..78d70701579d --- /dev/null +++ b/include/linux/direction.h @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_DIRECTION_H +#define _LINUX_DIRECTION_H + +/* generic data direction definitions */ +#define READ 0 +#define WRITE 1 + +#endif diff --git a/include/linux/kernel.h b/include/linux/kernel.h index f6a978d51c1d..55af40e63b92 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -41,10 +41,6 @@ =20 #define STACK_MAGIC 0xdeadbeef =20 -/* generic data direction definitions */ -#define READ 0 -#define WRITE 1 - #define PTR_IF(cond, ptr) ((cond) ? (ptr) : NULL) =20 #define u64_to_user_ptr(x) ( \ diff --git a/include/linux/nd.h b/include/linux/nd.h index b9771ba1ef87..ef344119214b 100644 --- a/include/linux/nd.h +++ b/include/linux/nd.h @@ -7,6 +7,7 @@ #include #include #include +#include #include #include =20 diff --git a/include/linux/uio.h b/include/linux/uio.h index bea9c89922d9..77a3e462d8c4 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h @@ -5,7 +5,7 @@ #ifndef __LINUX_UIO_H #define __LINUX_UIO_H =20 -#include +#include #include #include #include --=20 2.39.2 From nobody Sat Feb 7 22:06:45 2026 Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (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 927841B964 for ; Thu, 15 Feb 2024 09:37:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707989826; cv=none; b=H539IscBeNHjHBmZGNlTfBANXlIuvpKyQWfERvAF7SFdhHjD2/rRnFpaO4U7RL8IfdRCJlNzLnlp1Mzatzez8HLypsLJ3+n8S4yLHvjG3r89/WpLtlArog69nCrW0Tydvu5drCPKhKdFC29J8N3ieXn4offCRGFokeeZnw3TZXY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707989826; c=relaxed/simple; bh=HcFHWZ0EaqKsC33i0AWS0HwuM+WXczm8p8HubB1WEWY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BQvL1wWLqBUiepctqrY3TsKSj12Gf+baoyER3qV3THCvwgNZeG7rPXpKaewMIDHtRl2gVFiqZYJC+Y2bbTfAfCs55ih+PkFD/D8cyLvi9eA1E7Wz4P2giL1p+ihQRrXh97XnmoARpVeIUBmwU4BHwX1pvruByqYvpFjqpCDUCwU= 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=gb5Xu22i; arc=none smtp.client-ip=209.85.208.53 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="gb5Xu22i" Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-5639b00a25cso815670a12.0 for ; Thu, 15 Feb 2024 01:37:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1707989822; x=1708594622; 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=WG3uh9svReSzuApEUrRcGc5NvxynYpsbZWpwvFuM0Vg=; b=gb5Xu22iJUyr/wF/QQyR8jJKD/jFyZufYw81sV7LsopGs/AW4kw52FV8v3RObMbVy6 KuEi2znC4FfzBklivhfrO5od81rF5NR89yd0yrz/hiSR12YV2/aLpVzpU2nnuv/cHSO9 K5qKq+4Z2rPRXZmyXwn5YgoWOefj+Sukr1lqOfEz+HOxzRgvkvAuB4ibMZWCjkzGGKD3 5Hj0YqWaY9ge/cDXCkPaZKb9R9GcQdLeGM3isKocG+cWry4VKIrbS3GFydkg0eWODAKq nF7efj3aoV1nkVCpVRrUKDf9PVh6q2r2NbK4s5whCJSo6jfHzUe5TqoLvafkm3L2VOxy vSOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707989822; x=1708594622; 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=WG3uh9svReSzuApEUrRcGc5NvxynYpsbZWpwvFuM0Vg=; b=DgkhkHl4pEaWiSvzhiwzFsvcSWn/2UlZp7oobAcZH54Uas27LZMEVBfBo0fuWGf/RA JaDkJKOHIenutWPANYI86WvrpfANiB8SAobhG68qMHycTcm9qFnuR7mLvEpmvY9A2gUb uiAg7lkE9UXcQX4rS8rhYgXItCcugLisVUGK5CF7ovFziO0i/Pjp8gxkQwxtAzejVJt7 0Jff+G4SHnnnVvxeDmdyC2aBy9OgdmzfKS/1buUloMC2VjHCcrx29EWMITCqCA8LiPiS BnomG0J+2g9QqFPdFyphmYvce5S18WGbV3PrnATYdr8FIzhGmf/1oPOeYbuDDJ/3RGM5 Y4qA== X-Gm-Message-State: AOJu0YxOoCehpjf/QeHF3pmWFMXe45+izoYtSARjxtp75jFQJNHJH3ip qNmwC920R7HWyIcWRgkS8ajShc6Fu8qOUHKErFtz3usgaQJIjlQKk2yq8sBPb95fddkM3myg5RG 1 X-Google-Smtp-Source: AGHT+IGLycJ/gzVix+qrPLsaBiefLT1tvGk0NgR0j4dqqlu59uThDmg0idASybnBwwTHPukMsTttlg== X-Received: by 2002:a17:906:3c1b:b0:a3d:87f1:3339 with SMTP id h27-20020a1709063c1b00b00a3d87f13339mr867546ejg.10.1707989822276; Thu, 15 Feb 2024 01:37:02 -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.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 01:37:01 -0800 (PST) From: Max Kellermann To: linux-kernel@vger.kernel.org Cc: Max Kellermann Subject: [PATCH v1 7/8] linux/kernel.h: move VERIFY_OCTAL_PERMISSIONS() to octal_permissions.h Date: Thu, 15 Feb 2024 10:36:45 +0100 Message-Id: <20240215093646.3265823-8-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: quoted-printable Content-Type: text/plain; charset="utf-8" Reducing dependencies on the header linux/kernel.h. Signed-off-by: Max Kellermann --- arch/arc/kernel/perf_event.c | 1 + drivers/edac/thunderx_edac.c | 1 + drivers/hwmon/occ/common.c | 1 + drivers/media/platform/amphion/vpu_dbg.c | 1 + drivers/soc/aspeed/aspeed-uart-routing.c | 1 + fs/xfs/xfs_error.c | 1 + include/linux/kernel.h | 13 ------------- include/linux/moduleparam.h | 2 +- include/linux/octal_permissions.h | 20 ++++++++++++++++++++ include/linux/sysfs.h | 1 + 10 files changed, 28 insertions(+), 14 deletions(-) create mode 100644 include/linux/octal_permissions.h diff --git a/arch/arc/kernel/perf_event.c b/arch/arc/kernel/perf_event.c index adff957962da..48bc5c25842e 100644 --- a/arch/arc/kernel/perf_event.c +++ b/arch/arc/kernel/perf_event.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/edac/thunderx_edac.c b/drivers/edac/thunderx_edac.c index 90d46e5c4ff0..603f71fcdf44 100644 --- a/drivers/edac/thunderx_edac.c +++ b/drivers/edac/thunderx_edac.c @@ -20,6 +20,7 @@ #include #include #include +#include =20 #include =20 diff --git a/drivers/hwmon/occ/common.c b/drivers/hwmon/occ/common.c index dd690f700d49..fc328aa417b2 100644 --- a/drivers/hwmon/occ/common.c +++ b/drivers/hwmon/occ/common.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/media/platform/amphion/vpu_dbg.c b/drivers/media/platf= orm/amphion/vpu_dbg.c index 940e5bda5fa3..0f64dce90f9d 100644 --- a/drivers/media/platform/amphion/vpu_dbg.c +++ b/drivers/media/platform/amphion/vpu_dbg.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/soc/aspeed/aspeed-uart-routing.c b/drivers/soc/aspeed/= aspeed-uart-routing.c index a2195f062e01..6b091df7775a 100644 --- a/drivers/soc/aspeed/aspeed-uart-routing.c +++ b/drivers/soc/aspeed/aspeed-uart-routing.c @@ -5,6 +5,7 @@ */ #include #include +#include #include #include #include diff --git a/fs/xfs/xfs_error.c b/fs/xfs/xfs_error.c index 7ad0e92c6b5b..90075bd7dbe3 100644 --- a/fs/xfs/xfs_error.c +++ b/fs/xfs/xfs_error.c @@ -14,6 +14,7 @@ #include "xfs_error.h" #include "xfs_sysfs.h" #include "xfs_inode.h" +#include =20 #ifdef DEBUG =20 diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 55af40e63b92..01a0cc0a0776 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -285,16 +284,4 @@ static inline void ftrace_dump(enum ftrace_dump_mode o= ops_dump_mode) { } # define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD #endif =20 -/* Permissions on a sysfs file: you didn't miss the 0 prefix did you? */ -#define VERIFY_OCTAL_PERMISSIONS(perms) \ - (BUILD_BUG_ON_ZERO((perms) < 0) + \ - BUILD_BUG_ON_ZERO((perms) > 0777) + \ - /* USER_READABLE >=3D GROUP_READABLE >=3D OTHER_READABLE */ \ - BUILD_BUG_ON_ZERO((((perms) >> 6) & 4) < (((perms) >> 3) & 4)) + \ - BUILD_BUG_ON_ZERO((((perms) >> 3) & 4) < ((perms) & 4)) + \ - /* USER_WRITABLE >=3D GROUP_WRITABLE */ \ - BUILD_BUG_ON_ZERO((((perms) >> 6) & 2) < (((perms) >> 3) & 2)) + \ - /* OTHER_WRITABLE? Generally considered a bad idea. */ \ - BUILD_BUG_ON_ZERO((perms) & 2) + \ - (perms)) #endif diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index bfb85fd13e1f..860b0ea1f3b3 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h @@ -4,7 +4,7 @@ /* (C) Copyright 2001, 2002 Rusty Russell IBM Corporation */ #include #include -#include +#include =20 /* You can override this manually, but generally this should match the module name. */ diff --git a/include/linux/octal_permissions.h b/include/linux/octal_permis= sions.h new file mode 100644 index 000000000000..57d4d6a5b66d --- /dev/null +++ b/include/linux/octal_permissions.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_OCTAL_PERMISSIONS_H +#define _LINUX_OCTAL_PERMISSIONS_H + +#include + +/* Permissions on a sysfs file: you didn't miss the 0 prefix did you? */ +#define VERIFY_OCTAL_PERMISSIONS(perms) \ + (BUILD_BUG_ON_ZERO((perms) < 0) + \ + BUILD_BUG_ON_ZERO((perms) > 0777) + \ + /* USER_READABLE >=3D GROUP_READABLE >=3D OTHER_READABLE */ \ + BUILD_BUG_ON_ZERO((((perms) >> 6) & 4) < (((perms) >> 3) & 4)) + \ + BUILD_BUG_ON_ZERO((((perms) >> 3) & 4) < ((perms) & 4)) + \ + /* USER_WRITABLE >=3D GROUP_WRITABLE */ \ + BUILD_BUG_ON_ZERO((((perms) >> 6) & 2) < (((perms) >> 3) & 2)) + \ + /* OTHER_WRITABLE? Generally considered a bad idea. */ \ + BUILD_BUG_ON_ZERO((perms) & 2) + \ + (perms)) + +#endif diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index b717a70219f6..d584184db8c2 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h @@ -21,6 +21,7 @@ #include #include #include +#include =20 struct kobject; struct module; --=20 2.39.2 From nobody Sat Feb 7 22:06:45 2026 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="FDbUrGDJ" 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-Google-Smtp-Source: AGHT+IGi6owf0/kjoDqwYB495frezFp8I5t8MQXTn+rnraVsdwBeBAiLgULZnWPXNUb+/5WuZFMXqg== 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: quoted-printable Content-Type: text/plain; charset="utf-8" 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-in= genic.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 @@ =20 #define STACK_MAGIC 0xdeadbeef =20 -#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 =20 #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_ =20 #include +#include // for PTR_IF() #include #include #include --=20 2.39.2