From patchwork Thu Feb 15 09:36:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 201310 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp277983dyb; Thu, 15 Feb 2024 01:37:31 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUQ1x8DJnrcyvzzlGXrCYR72qLst+DOnSYl3a8CGQ3XMrZ6b0O0tWLvvSaIEH5wrXSH28orH8PcOMW0AT/oq8xLgKKWDQ== X-Google-Smtp-Source: AGHT+IGACFo0hb+Y6abn+/LdNWFV2Xy44pvBW5ymgVMbatcrNX+Fx0lIaUNmFXafj7B6wkhqPiTn X-Received: by 2002:a17:902:e882:b0:1d9:11dd:1443 with SMTP id w2-20020a170902e88200b001d911dd1443mr1382972plg.56.1707989851601; Thu, 15 Feb 2024 01:37:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707989851; cv=pass; d=google.com; s=arc-20160816; b=C5SUKIlfhIJifgTaQjReyBGSyoGiogo+3+ZyuT5f/TU4/7CVW+OFFmNoyVXTcEKuN0 3TpeqgkZ0X/yS/wzxVGSgMeRQ7Otchma5eTOEEySFztkxe5uVwMYmHCgp4fuFTWe1Qcc FRhe8dk+kj0zdsubahYe3ZNh0ZWITdcX+78t5W84P9Wvtba7hEfh5Ba2HLwa+N7hWNlL fmFp+SuJzbVr4i5tdU0/5vf3WLAxOOjdfBQEw4js2F67LKYQH+JyKFBGcYzwm6kie6Cc QhFUV4aU6lHqi8/9W+YOHR/SxkHTx3sKHEnQFbes8uH+Jv3VLz/dvsYrsGuqHItkKxv2 msMw== 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=OlOv7BRUYrcRJiYDdqOKsBmYsp7bUKSz0hes5xiUYu0=; fh=KdkJjeZw/67bsxRSoO8Cj8OsbWp5WsCKsMMy5B3Phrs=; b=fcPqZWKiZLn9MeVZji5rZSXgiqEqKzmP31m3bokUWVUZcWRT3062hCdwxq5tiQkHna aLMERHlEJfGduGFhV84uKn6v+R8b3J9hpG89RNlXsdklJkGOpOQx1D8HWBWEEzq5KLqW 36RCfJLBmIxoYOnw67n/7nFMSmoF2OAthoEi+VeD+7vdzN2ELxFwtSfpToCKGwywSbxe Q6l7mFYjrFmeWBNVd8c3dEcLgvJ40YOaa5oTAqU+4BbWVqw6sPoil3rkJGZ7fy99TfPm +oQ6x/wpa9cdeFk6eESbbXCao0Ao7gFziexE5sjVoLIQ1XeoefNtYpofrSsMldh30nv+ qa6Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=eprXqSW7; 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-66555-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66555-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id z16-20020a170902ccd000b001db8eb9eddasi466555ple.528.2024.02.15.01.37.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 01:37:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66555-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=eprXqSW7; 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-66555-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66555-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5C2E8280A78 for ; Thu, 15 Feb 2024 09:37:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4C3F61B807; Thu, 15 Feb 2024 09:37:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="eprXqSW7" 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 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-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790957166663132815 X-GMAIL-MSGID: 1790957166663132815 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 -#include +#include // for lower_32_bits(), upper_32_bits() #include #include From patchwork Thu Feb 15 09:36:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 201312 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp278076dyb; Thu, 15 Feb 2024 01:37:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWVBeRZyFSpuFd4a9AiieUO+BbXvfVxZ8khAicPDspnOD79zZ6e51ABNVypAUVAuHDJjJRyM5Cux2SEzL1VoHGp1McGrg== X-Google-Smtp-Source: AGHT+IFFSFnCA1c6Urq4ymKs3Y1wEbCpzxR7un209S+84EMa6upFQxVufqiLb/GoYzviBk4JhmJs X-Received: by 2002:a05:6808:1693:b0:3c1:1395:c704 with SMTP id bb19-20020a056808169300b003c11395c704mr1599730oib.32.1707989866242; Thu, 15 Feb 2024 01:37:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707989866; cv=pass; d=google.com; s=arc-20160816; b=c38GlEddd3LzmM5/SgykdqGHeZNBVSUKBtcLE0lESSwUem+oWryQCiPh9BQQRwaDIn C+N1o4Aena68yoSTpiD3C8TYWEbB36KGCwNy91TFQXJm8B/K3VAu2SnFo7k0otRYH2+9 effgLvCw2PxpMV9PA59YDI6zZF31MjguxczLrzSSQ4LR0Du+/z1h7IxTO0SiNhZn7Rd3 D+OGMkuOGQmGKQ0X2H8jGCkllRQbwIQ7t2VtXF78YGSKbptruitZiAT4pPg6Mjva8pas FCXl7zTnTxRMhjI04s+7SKEINCv9unT2p5xwtXDKeA9zaAcwrkPYhRRaoEkx0821RkJe Nthw== 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=r0xEyIIS/tv0UXDMyOsQAyxi6COhgq9kYeUYOeDXc8c=; fh=KdkJjeZw/67bsxRSoO8Cj8OsbWp5WsCKsMMy5B3Phrs=; b=qrG+cFDgKR4RsHgbddimsFiEWppvlGfhkMSm1lSP1uY0Bk1pfDoryx7VCE+nONyirW R7hGUqLL2Q7mlIXnWuXinMty0NDqlmEj9yJjzFNQXN/O3d6DMVlzUr2qRwSM0Zzt5/IW dMGqELHNqGK6NS6HI+aTBmNiMfdopx1w8+/SbHfPKA+VKoCDakhT8VsJPPac2aP/TOnX 1w+uYgYydr3xZLiZZ7nQVYsA4ug0jbBGi/or6utPfTMkXNF4fG/ayqCvVX5b6eDuMM9Y 4+qug3OIIJV5VySvsJPrA6mEgaTbAoNd2JVUROsn2pfgLVjWbpGv8SgcvLucV5PKSL5R zHUg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=MFFOGtBB; 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-66556-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66556-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id g20-20020a633754000000b005dc47dd5dd2si821189pgn.791.2024.02.15.01.37.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 01:37:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66556-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=MFFOGtBB; 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-66556-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66556-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 04864281943 for ; Thu, 15 Feb 2024 09:37:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7607F1B962; Thu, 15 Feb 2024 09:37:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="MFFOGtBB" 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 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-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790957181717437579 X-GMAIL-MSGID: 1790957181717437579 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 -#include +#include // for lower_32_bits() #include typedef union dfixed { From patchwork Thu Feb 15 09:36:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 201313 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp278267dyb; Thu, 15 Feb 2024 01:38:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUKSOHS4j47yBfY+1+awQ6alfgU9LKfCRiYnMZsCCZVESmqLW2NG/Dcxy278dpT1XnfXOucgYfQec6vkQKh5kBcOm7Plw== X-Google-Smtp-Source: AGHT+IHUR3l3DWRjnY1YPE1jioLliuF5RcqU/qJQqVOTyii0w1xWL4qgaHnaMASyhxW5BXW9n+UY X-Received: by 2002:ac8:59cf:0:b0:42d:b6f5:9fb3 with SMTP id f15-20020ac859cf000000b0042db6f59fb3mr1475491qtf.51.1707989890632; Thu, 15 Feb 2024 01:38:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707989890; cv=pass; d=google.com; s=arc-20160816; b=ju/13dWTAW1upRgkEqenSXYhTA/4okBHZ3Iz4knrXJMP7s0irPvdF0mcXonMInrtdK xbW+WTIDEkEQrrGvoYhiRUx4TCvH1eL4bqKQVNjKrkAGCxKYNzevYIeNLMHDwDK8vF/O gc7OAuGSEKWEQ1ruMtNWUhbjtx05+TXqfwdH03BVdoq/zuNVbzsjH0i0nkiXAtihJLQq 8wjx3dl6vO58hGZlhg1dSLKVoCr/itOknVIIowfZDvCffA5oZkdhba0yab3X/tyOKA2s T2WNejCess7x2Vz+GyYit9agUztWkQn3U1+zYDUaCchy7QuCnBwrmamNTlO6CSXN4yng upjQ== 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=m7dUZOBLu7d+3R+DKHO2TzD/GDIM7CR+ZFQySZN2YdQ=; fh=KdkJjeZw/67bsxRSoO8Cj8OsbWp5WsCKsMMy5B3Phrs=; b=OrAmZSvYa4EPB7+07gwoZfvAFN15EDqVAiTmpxnMTNQBngOiLjSLrZr+ulFt6q7CSf ZUk9UZv9o0kDDcstXKp2adF03pZtfvpr8BHzaRGAu8DBdxx0m516CGEDp9etjd0pzMzf 0fO72YL5dgTyL83Qa5hjWZUe0rsE19wSt6NZaQVb4e0wsJMhLFlI3/gt1yOGNC0ztK/o 815+Jo5uZzzhY/AMeiKHeXglkbIEp0cet2GFEKjIQ8fWF1cymyziORQweC2ApUv6cBDN w9cPYsqObshNJox0kZvkZPy9P+dIuahxfHu1pK1SmVz5yxUf7SB6LghIKLfLYAqn1jg6 bdcg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=RG4slG63; 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-66557-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66557-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c15-20020ac853cf000000b0042dc8e24706si890014qtq.791.2024.02.15.01.38.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 01:38:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66557-ouuuleilei=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=RG4slG63; 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-66557-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66557-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 471ED1C225D0 for ; Thu, 15 Feb 2024 09:38:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CFD321BDCE; Thu, 15 Feb 2024 09:37:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="RG4slG63" 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 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-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790957207632519226 X-GMAIL-MSGID: 1790957207632519226 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/syscall.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() typedef long (*syscall_fn_t)(const struct pt_regs *regs); 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 @@ #include #include +#include // for lower_32_bits(), upper_32_bits() #include #include diff --git a/drivers/bus/uniphier-system-bus.c b/drivers/bus/uniphier-system-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() /* 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() #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() #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 #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" #define DBG_BNODE_REFS 0x00000001 diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_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() #include 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() #include "internal.h" 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 @@ #include #include +#include // for lower_32_bits() #include "swab.h" /* 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() 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() /* 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. */ 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 +#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 @@ #include #include +#include // for upper_32_bits() /* Hardware constants */ #define QM_CHANNEL_SWPORTAL0 0 From patchwork Thu Feb 15 09:36:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 201325 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp286360dyb; Thu, 15 Feb 2024 01:59:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVPTgQNKlm6qu0vHuIhlQjFC+kOP+DFHPwROnUc4P2bUFfPuCw5W05UoAJI2wwsmNwXwihUgpSPr26Vzj0vCXkr0ZEK/w== X-Google-Smtp-Source: AGHT+IF0LnNaKxnbX+AyAg89DDtGlzoZr7EvCcB4WjTROMNPhXl9kvTnt1Q744RpzGYxxcFuB60m X-Received: by 2002:a05:6e02:d0f:b0:363:8df1:c52a with SMTP id g15-20020a056e020d0f00b003638df1c52amr1094398ilj.8.1707991176897; Thu, 15 Feb 2024 01:59:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707991176; cv=pass; d=google.com; s=arc-20160816; b=hiNgaN/Yynr5uH10DzlohfazENprwo3kqdbWP/FnTD9ipv3hjQ40HDn7f1QNFR9QJr 6CrjP05X5p+R9EGWwNQZV1r14xOFAg768srizihG3wCekCS0wm/FGOtzTnOmiLKkV7J4 8jRN2L0nKJyWrGDSSFdrUgw9YivuPErzDf/IwqlbSEEy4nInld0xqmN8cO8kNgRbHTpL yjjM+s+rw0v6x1WlcLjR4NhBe1mTDF3yshYIHJf6V+G4Rb/t3KUWeCVl3dwu23qDzoFU QDVriq22Xz1rPX1t6H+0qk1/i46N/IIje+y2tdBi0mLMYm/M2IGtbqqOpurQWBgbeeml ID8Q== 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=GL6ddD5YKfOqRj2RNy6xNtOts5S4Jrg36FUNpDVDuuc=; fh=KdkJjeZw/67bsxRSoO8Cj8OsbWp5WsCKsMMy5B3Phrs=; b=Vzab0/mCa/cc+wa+2bMlJ0CYA4vqwcHVqGB18dHmApQ/xu26wMC6T13n0Ggr6xp0OD pGV6YzCA4++BoWRgAyyx8tg2P0Gvl65nkymEfnF49gKz616r/FUzt9aEYOO/2UzV8O6S 1Wqhvd7cIcYo6+ncn7kMQfTeJ+zFU1chZJJ52+/fv1ZYVl2IJB6SezoDzamA68FudiIK uPoTKX/ELLNlerDKfykcwNfs1+xVmx4Uvi6KeOp8BitmPTpEnTSAeN9dQVhsoIMIwbeo jGOFykX2mSqj/RoglpW0mxhmeE5UMM9yjTaNqA5+Tus+yFti8WoOHFHaZE90+6yix97P 8fFQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=TQG+iyxn; 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-66558-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66558-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id b26-20020a65669a000000b005dcbb6ae5b0si192704pgw.248.2024.02.15.01.59.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 01:59:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66558-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=TQG+iyxn; 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-66558-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66558-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id E8C69B2CBD9 for ; Thu, 15 Feb 2024 09:38:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0C80A1BC4B; Thu, 15 Feb 2024 09:37:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="TQG+iyxn" 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 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-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790958556608705999 X-GMAIL-MSGID: 1790958556608705999 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 #include -#include -#include +#include // for U32_MAX +#include // for is_power_of_2() #include From patchwork Thu Feb 15 09:36:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 201326 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp286577dyb; Thu, 15 Feb 2024 02:00:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXHz5SjFsDSlahfHGVV13OlAwm4sGuQNcQwwtpJWVRVO+5G3OYdw1bMR0X/q6IxCbd9THAahCwXTgtrAVJ9vXkAaYLTiw== X-Google-Smtp-Source: AGHT+IHzD/FD8G/v/TAhfMWMTQstfsv6QyOBjeHCIL3PrCcrg/m8aBfBkpPFB3b0cksP+pLDHnra X-Received: by 2002:a17:90a:6407:b0:298:ab02:466f with SMTP id g7-20020a17090a640700b00298ab02466fmr1206106pjj.37.1707991209908; Thu, 15 Feb 2024 02:00:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707991209; cv=pass; d=google.com; s=arc-20160816; b=NtVBsBTdsG0QBRCYhcR/HmS6UqfHAPgpf6wrulnKsAFLTKD8f8/Vjan0oyxFX6kJPN IJUMacVn5nOvyTMrw5YkTwnYSLmJmYtqbJZuHLcbU9oExW5nkB2sK7Q4ChR9ixYBuYNX 3Spnas2rleh0ZSfgECp59YxmMmIW7Ippe2ilZBRH6iChMSJGm4HHPIOWBiwiuW5jSrc+ mKH64ywgxz3Tx6Ykoz/wE7nmEDgWLccKaiGUEk0SG9RAT9BHXjroD3otmJtJ+1h+GJRW yzvoutKeHHdC7ix2vtTGVBkOlP7cOXTaZyREKbCX6ZtsAJy6/83+TRgBwBrzXVehd+fQ lHaw== 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=LJvnBCQWBBDb6zNhkGV5El1e2yPo8rIgW0kOJAtMnfQ=; fh=KdkJjeZw/67bsxRSoO8Cj8OsbWp5WsCKsMMy5B3Phrs=; b=qSrYBOeDOuN6q3jAlt13Z1xkGUesrItmZOMXLnsV1MAl6KLKrkYpvrzRcngtwsCS+z UgB+FxVbdzE5KglcHks3hcOsXHLw461ROaVXTIa3ce+3+fhoT32eQUb2DMYKySgeEaKN 6cC1aFxPByVi+jqQyXqpZ6/V6HB5ksWKZJ/Ax1Y+hcKkMi9WAj1zCeIAJVzClN9JlFgK WZv9eqAxjtWMpcsZ2Jx95Ev9W/s0zwjNHFcrMzuCuVfP/dXhBbAArxYuBDTXIE4fmAA5 Soi0oIwo+h9q49bbIxADoHPaKyWWGvEymJrvMv4DNadfxQzYyXt5ZJVBfoTKWDeepk/b nhmw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=czqseyJv; 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-66559-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66559-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id h21-20020a17090aea9500b00298c3984d41si2696482pjz.127.2024.02.15.02.00.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 02:00:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66559-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=czqseyJv; 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-66559-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66559-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 4BC3DB303A2 for ; Thu, 15 Feb 2024 09:38:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A5A21C69C; Thu, 15 Feb 2024 09:37:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="czqseyJv" 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 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-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790958590473625232 X-GMAIL-MSGID: 1790958590473625232 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() 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 device *dev, #else /* CONFIG_GPIOLIB */ #include -#include +#include // for might_sleep() #include 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; -#ifdef CONFIG_PREEMPT_VOLUNTARY_BUILD - -extern int __cond_resched(void); -# define might_resched() __cond_resched() - -#elif defined(CONFIG_PREEMPT_DYNAMIC) && defined(CONFIG_HAVE_PREEMPT_DYNAMIC_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_DYNAMIC_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 offsets); -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 blocking 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 not - * 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 enabled - */ -# define cant_sleep() \ - do { __cant_sleep(__FILE__, __LINE__, 0); } while (0) -# define sched_annotate_sleep() (current->task_state_change = 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 prohibited - * - * This is on behalf of the oom reaper, specifically when it is calling the mmu - * notifiers. The problem is that if the notifier were to block on, for example, - * 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 similar - * 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-- == 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; 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 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 *dev, 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 +#include // for might_sleep() #include /* for HZ */ 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_DYNAMIC_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_DYNAMIC_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 offsets); +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 blocking 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 not + * 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 enabled + */ +# define cant_sleep() \ + do { __cant_sleep(__FILE__, __LINE__, 0); } while (0) +# define sched_annotate_sleep() (current->task_state_change = 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 prohibited + * + * This is on behalf of the oom reaper, specifically when it is calling the mmu + * notifiers. The problem is that if the notifier were to block on, for example, + * 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 similar + * 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-- == 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 -#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 #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 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() 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 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 From patchwork Thu Feb 15 09:36:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 201328 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp288024dyb; Thu, 15 Feb 2024 02:02:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXGHD7aowTmrJcJiAp7Suwt6B5xR8kf3NZOVROs+ow+Jt/1RIiT71YcwXTsZcedk8qS7QocpEe4cXPhUx7EyqR8i3HIRg== X-Google-Smtp-Source: AGHT+IGVpSZJb0yWNV3eiKJgEg47l9wiCVl0MIRYRu0LQUKfo26kcxXKF1ON4h9itsAqM2rznTTv X-Received: by 2002:a17:902:d349:b0:1d8:fafa:f923 with SMTP id l9-20020a170902d34900b001d8fafaf923mr1194855plk.10.1707991346036; Thu, 15 Feb 2024 02:02:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707991346; cv=pass; d=google.com; s=arc-20160816; b=uf6j6YyBS3xrZn9LeGlHrjTX2lR9e2rNriJF+Plh5tkPiuMTd59K21C5EzHRkHxiBz MU++hxGUfj+cl5rfWV709hv/PboocVi/EC00z3bRKWmjsmmp36kt5qjceishF9ORN6EA UwIO1YnII7D5TaTNOIHDuCQ9wlx+1SYlRQiI+xojdDCaRUBr96TGf67DL9AtAvMmTnA0 umv5OTky0r/WzJKw5Jn4GBBL4otBDGaSwhT4B3Rwh1lu3QG0gzG2anuMK6kDX5r5ZJbU 98KJ069Rbge665oJkffi/85aqWM2SwDQZNYEJ0bkpSB2LdC1xpTflfFH/OkgN9dsDcw4 16HA== 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=+h1IEdtpwE+MgefySz12julwicOiuPFac8ie3+0rpxY=; fh=KdkJjeZw/67bsxRSoO8Cj8OsbWp5WsCKsMMy5B3Phrs=; b=0vMAc/eeBwpoLzOXil272NMGTZWoreZ288ynGOg+OPuL5wjWYjrkXi6kjGFrU7gOWy 2TdhAieIhON0sn11e83O9mBdThak8U65GrtvbXyX9ttVdkBIhju28w3JBaUG8ttJoSTG sfLmdBgRnL5aaTZsWYdnu7q4tGgdzpyXpqq9QOkPavxz/eZhVIyZQh4iN9LJYwxC7p0V vIZdK5+EuBHanxgeHctTftW6FhVU331AiJQ3xQAOWwilp8S5XOqQzJELLYJlnEcqQIdj a1yQgVeCa8VUf06f89iCkW54nGqm8hNKR3sApeOsjrrjX6ATt9a+rs+rNWLGcR4sg0L5 uFCw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=NSzFrQ5u; 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-66560-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66560-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id w15-20020a1709027b8f00b001d8fc816118si849322pll.189.2024.02.15.02.02.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 02:02:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66560-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=NSzFrQ5u; 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-66560-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66560-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id CC644B24CF2 for ; Thu, 15 Feb 2024 09:38:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D035E17741; Thu, 15 Feb 2024 09:37:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="NSzFrQ5u" 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 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-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790958733434591450 X-GMAIL-MSGID: 1790958733434591450 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/memstick.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/jmb38x_ms.c index e77eb8b0eb12..dc8e4f6a01df 100644 --- a/drivers/memstick/host/jmb38x_ms.c +++ b/drivers/memstick/host/jmb38x_ms.c @@ -6,6 +6,7 @@ */ #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/rtsx_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/rtsx_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_ms.c index c272453670be..c46b6157aa25 100644 --- a/drivers/memstick/host/tifm_ms.c +++ b/drivers/memstick/host/tifm_ms.c @@ -10,6 +10,7 @@ #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 @@ #define STACK_MAGIC 0xdeadbeef -/* generic data direction definitions */ -#define READ 0 -#define WRITE 1 - #define PTR_IF(cond, ptr) ((cond) ? (ptr) : NULL) #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 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 -#include +#include #include #include #include From patchwork Thu Feb 15 09:36:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 201314 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp278506dyb; Thu, 15 Feb 2024 01:38:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVVqmgRNN6DMf6E1ywNTobIdWbVdxeECqvZS7A+F1kxOr7qZDT/tO7Tap4v8K4g7okFNItIdXlboySKnDGQBmexXFBGfQ== X-Google-Smtp-Source: AGHT+IFq8b8at14J7d7E+Y561XTgVwlIlXRZESgPwFfxKWuI9hl81rfxbWuAm2854gB7LiiOI3JC X-Received: by 2002:aca:1201:0:b0:3bf:bc65:2425 with SMTP id 1-20020aca1201000000b003bfbc652425mr1422124ois.51.1707989932968; Thu, 15 Feb 2024 01:38:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707989932; cv=pass; d=google.com; s=arc-20160816; b=EAHG0RtUT70AM/rwZXjlrJT6hed9CzSUTeLxAtFzpcC4asHIJONKWakZdHkTCGXr5s iAiPDe/UJre0TpRlAqmuQ/QSRXZhoS7V9JW370aqK8rJpOVS0X2Up/Dzntgz2MGMRvTM H7z6o5/sUNlrC8shEo15niufb0yrlaMX2SQ0RxRyDK8DusMbipSQ7tfSzI8+9CQ0Hy8R lm5dK/0n9rHn5JE/YK32nj57c+M5oOFKMKn41xUvWSdYX/4UuSqao1D/e5uVoBtVjns+ 4bci1yJHdRtlhgLTthJBMHmA937uUdQWSIliOlSMhw4m2EAWRR7yly1TZO5nSXU0FXN+ IhzA== 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=WG3uh9svReSzuApEUrRcGc5NvxynYpsbZWpwvFuM0Vg=; fh=KdkJjeZw/67bsxRSoO8Cj8OsbWp5WsCKsMMy5B3Phrs=; b=T2ZAhOW8WzqHTjslvEEU3i5pqzNEGbeYbnwawx08o9ntI4evuNs1yyv/Lg301WSFHP m3yFyifjuKd4+FwUkvQgLTIdjCB/yrlxFLMh6awNVSQRylgAM0mznsX0H51iG2QlUii0 hUHQnGmv9mkgTRh6CVAR61FEmulk8fiGImIQh46RoDPgzj29gxxlo32U3VeQrHJPXfDm 0yyUXisZ09CXPbaYVmKj3uNGzglPEdnUJq0cN+jZMun7yib20MPrnlRJ3m/oFwQFQSvp RJcVvhpWCfAKDBV9zewBd8pp/QQz1EYYoV1Wc6TG5YM/SFxYfol74yA+S06PjqJBUY0H eZEw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=gb5Xu22i; 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-66561-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66561-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ay31-20020a056a00301f00b006ddd07da17csi869540pfb.309.2024.02.15.01.38.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 01:38:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66561-ouuuleilei=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=gb5Xu22i; 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-66561-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66561-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B0DA928119A for ; Thu, 15 Feb 2024 09:38:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 39C981C68F; Thu, 15 Feb 2024 09:37:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="gb5Xu22i" 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 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-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790957251896675002 X-GMAIL-MSGID: 1790957251896675002 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 #include 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/platform/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 #ifdef DEBUG 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 oops_dump_mode) { } # define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD #endif -/* 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 >= GROUP_READABLE >= OTHER_READABLE */ \ - BUILD_BUG_ON_ZERO((((perms) >> 6) & 4) < (((perms) >> 3) & 4)) + \ - BUILD_BUG_ON_ZERO((((perms) >> 3) & 4) < ((perms) & 4)) + \ - /* USER_WRITABLE >= 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 /* 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_permissions.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 >= GROUP_READABLE >= OTHER_READABLE */ \ + BUILD_BUG_ON_ZERO((((perms) >> 6) & 4) < (((perms) >> 3) & 4)) + \ + BUILD_BUG_ON_ZERO((((perms) >> 3) & 4) < ((perms) & 4)) + \ + /* USER_WRITABLE >= 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 struct kobject; struct module; From patchwork Thu Feb 15 09:36:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 201315 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp278537dyb; Thu, 15 Feb 2024 01:38:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXYJr6MsAybTd1np+50aV1LNutze+Z0P+yzv90DFkOuP2CBSSStwql0WCfqe+YT5d6meGm+sCjboIU4fTwm1pEEv6FFcA== X-Google-Smtp-Source: AGHT+IEb1LWukaU4IuwflHa0TwW6eQodl4zl65mu6bVulrol2V1ISSyaFwJxKmLojVtfAzf2vuwx X-Received: by 2002:a05:6870:440e:b0:21a:2944:5e68 with SMTP id u14-20020a056870440e00b0021a29445e68mr1121330oah.48.1707989937294; Thu, 15 Feb 2024 01:38:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707989937; cv=pass; d=google.com; s=arc-20160816; b=Z8xm03/yxbQlPV+kojRJFuqxBXSe2qAfMnVeoDiyVpsjsbC5jq571d6TzpDZGkwhkw SweGqMw00LcZKWalJtXRQh5o/i550RMwPABiY1RHOyfmqFjAyR64qBBL5yqqelxmOx9u v8TU75S5ucuhVoECY/CIyYE5E9KNUPdYCYfA4fMZeDxOtPoTANUIQMkQw0A7haFpenhy 1moaspOG6jU8juf/6dXGz1z6BSQMQ4Z8H276J9FK1KSEp6c4udxAgM/huL8LgLU3sUAF FqgtGZzdzHLDgF5+qvgdees6XKWmMRCef0XDrQCQh0/6nMLIZQvh26vGzWl+fHypX2MG TVvg== 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66562-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id dr8-20020a056a020fc800b005dc42fd8c43si828888pgb.267.2024.02.15.01.38.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 01:38:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66562-ouuuleilei=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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66562-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0912228119A for ; Thu, 15 Feb 2024 09:38:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 93E851C69A; Thu, 15 Feb 2024 09:37:10 +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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790957256778888914 X-GMAIL-MSGID: 1790957256778888914 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