From nobody Sat Feb 7 09:46:44 2026 Received: from mail-yw1-f174.google.com (mail-yw1-f174.google.com [209.85.128.174]) (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 213901ADC83 for ; Thu, 25 Dec 2025 17:09:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766682576; cv=none; b=W5k20kx46gPBxiobm+hTeo0jJ9DOBkDQEsnC5XhfEOohf+Fcmy9jiYPf6G/qltYWqxHkFLu0jp2ScBgMLYmgRMFPEsa15Jl1NoxIJW1+DpQQLAZ3yPa+LbLgsvXPX1gPJApK9i+Cu0Wq0mKYmyABzzyzuQCrlUpzzo6JIPVDVzg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766682576; c=relaxed/simple; bh=83f1PmfWzI1WjUX/Z+ePAovTV+WhzN6hT02XuFuHSRc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YZHd3RWx0PwbxyCZxrwgypzkJX6KX2f1b73mK1XaZw0mMAjTTdDFGWwlmC8j0RAsyMWRSIFnXnMKTmydBOmvE+f0OytaOz/5gZ/uUC3nS1qTo4/P1vBMaIY5xho1r1GkzHS8Yk3fjULOol6vnx5HYhooxOJ9fYgKhSO8n8yURaE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fXMUnk+v; arc=none smtp.client-ip=209.85.128.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fXMUnk+v" Received: by mail-yw1-f174.google.com with SMTP id 00721157ae682-78fb5764382so47509397b3.0 for ; Thu, 25 Dec 2025 09:09:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766682574; x=1767287374; 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=qJnvW0A6SgbXQs1NHQABSopMa/fuZliTPpr4o45JmhI=; b=fXMUnk+vblykz5k/Qjx0Cv+TicrsEuewTAzLDmrrg6csQdZJJ3NmfAl/8FmTGUV5PU vCoi6sG1vV5qpe+/k1d1Pk8EgPFR6tkjfYBJ8Yv7mTa1EIPJTI07wiezdbJdZtukpAiV +aijoPhiA8XscSUWZg84Du1LCPTxjAvh6gCIUYcryxSWyivItAafL6EIlA0Sl2e2OP8S tLu56J71c2s/b2TpxI5CzdChUwqKCpeEs+WAmeTocnyVmLmi32sLrDfllaOFKtfIlt13 YtU2MFpUY8aDVB8tFX3Tu6aZf3G4ASOWDTlIUon7wdwqcbOxBmoY9bjsJdIrzJhtOe5w XRDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766682574; x=1767287374; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=qJnvW0A6SgbXQs1NHQABSopMa/fuZliTPpr4o45JmhI=; b=Yu6V181PV/J47Rya5vAm1swn5aHHO5LvbFUOne9QWtbV7ESb2+PNqfVZEwSs2u7Nw+ YHGWcRDYv8E49nHsnjQyOL8H5dWiFe5F83UdAyfXE/0Nh0MxCEqKFPyKSKV9FI7ICNfR bi+5E2wL364WAYi2PoEIWm/BM8Sla65xg72+XnZVeHJm6lIuuHr5Dn7uP4TA+M1C/8BV 7W7qBVy0mo/u4dmss6rOInx4IrJxHTYGkfriP5WjH3N6L1XYHCk0FKZ6If+1adUSabbp UuF15smbJUaoPRfK/ztAEOtZRLa69edF9gckNZMHcK86R8nonRvjr+mBpzgbGK0uEKAF ROwQ== X-Forwarded-Encrypted: i=1; AJvYcCXZwDkRrm87EC7MkvcO+WVrQ4KPf68tb1Lhog9a67scVJi6ZfaQyRN9aFxkqkx5QLS61NAW9HtChOzrq0c=@vger.kernel.org X-Gm-Message-State: AOJu0Yy3WJcR2LTJskXBvAvJIY1ItEzteIv/9dtGXV9CsrPgnCxnJwvP RCdEZ3a+g7BDV76ic06+ezsaXNteGZ8q60KrnlbbVq1ZTl7quo2D6mkw X-Gm-Gg: AY/fxX7CbNu2uGtUCRgqn7mApIyWdRVuNoDx/KEDuBgrXelCs36IxBTSukmfQi9nuoZ Ykz99piAorZiu07bJOWoaxJFwDDvmc4W9ckToAbUeZ935TDTKpEKLgE1uEtTXZp1+/V7Ua3rtr1 qo93E0JbmJOghN1H63C7s6H2de7FrIhOCnO2I9d7MVmdXCGJGGWM7apGLrMsPr2Rxs5j1NdF1f+ UtzSonSP6iCgyUSCwbJInRGGwFqJsKy0JzJm5EQ8YARGXmvh/YRsMXDbLsp0kMnoX/DxmehpBag onK9qEZiAKlBGr5iq3fIvEwzJtrLluNv/DnJ99KW5IsK1tQBT7tDPyTwDuTWRHqu3RZ2ZWeIXzf zSy4Yyf+dzmqpMd6DJA6zBHgfE4paESFqR/K+KVmpOz/n+TKlciZ1fgdZ44E6cPLINAgqrm6ari sfAw6SmYk= X-Google-Smtp-Source: AGHT+IEOI5N8F1QPJkwKkoNFoaHrbTb32hBNxWVW0/bhknzb+bHcnaSpekV7BEM78upWGjfs7XzINw== X-Received: by 2002:a05:690c:670a:b0:78e:3dcf:7aaa with SMTP id 00721157ae682-78fb40294eemr168823547b3.39.1766682574047; Thu, 25 Dec 2025 09:09:34 -0800 (PST) Received: from localhost ([2601:346:0:79bd:5a70:118b:3656:4527]) by smtp.gmail.com with ESMTPSA id 00721157ae682-78fb452c441sm76158037b3.46.2025.12.25.09.09.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Dec 2025 09:09:33 -0800 (PST) From: "Yury Norov (NVIDIA)" To: Steven Rostedt , Andrew Morton , Masami Hiramatsu , Mathieu Desnoyers , Andy Shevchenko , Christophe Leroy , Randy Dunlap , Ingo Molnar , Jani Nikula , Joonas Lahtinen , David Laight , Petr Pavlu , Andi Shyti , Rodrigo Vivi , Tvrtko Ursulin , Daniel Gomez , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-modules@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: "Yury Norov (NVIDIA)" , Jani Nikula , Aaron Tomlin , Andi Shyti Subject: [PATCH v4 1/7] kernel.h: drop STACK_MAGIC macro Date: Thu, 25 Dec 2025 12:09:23 -0500 Message-ID: <20251225170930.1151781-2-yury.norov@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251225170930.1151781-1-yury.norov@gmail.com> References: <20251225170930.1151781-1-yury.norov@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The macro was introduced in 1994, v1.0.4, for stacks protection. Since that, people found better ways to protect stacks, and now the macro is only used by i915 selftests. Move it to a local header and drop from the kernel.h. Reviewed-by: Andy Shevchenko Acked-by: Randy Dunlap Acked-by: Jani Nikula Reviewed-by: Christophe Leroy (CS GROUP) Reviewed-by: Aaron Tomlin Reviewed-by: Andi Shyti Signed-off-by: Yury Norov (NVIDIA) --- drivers/gpu/drm/i915/gt/selftest_ring_submission.c | 1 + drivers/gpu/drm/i915/i915_selftest.h | 2 ++ include/linux/kernel.h | 2 -- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/selftest_ring_submission.c b/drivers/g= pu/drm/i915/gt/selftest_ring_submission.c index 87ceb0f374b6..600333ae6c8c 100644 --- a/drivers/gpu/drm/i915/gt/selftest_ring_submission.c +++ b/drivers/gpu/drm/i915/gt/selftest_ring_submission.c @@ -3,6 +3,7 @@ * Copyright =C2=A9 2020 Intel Corporation */ =20 +#include "i915_selftest.h" #include "intel_engine_pm.h" #include "selftests/igt_flush_test.h" =20 diff --git a/drivers/gpu/drm/i915/i915_selftest.h b/drivers/gpu/drm/i915/i9= 15_selftest.h index bdf3e22c0a34..72922028f4ba 100644 --- a/drivers/gpu/drm/i915/i915_selftest.h +++ b/drivers/gpu/drm/i915/i915_selftest.h @@ -26,6 +26,8 @@ =20 #include =20 +#define STACK_MAGIC 0xdeadbeef + struct pci_dev; struct drm_i915_private; =20 diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 5b46924fdff5..61d63c57bc2d 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -40,8 +40,6 @@ =20 #include =20 -#define STACK_MAGIC 0xdeadbeef - struct completion; struct user; =20 --=20 2.43.0 From nobody Sat Feb 7 09:46:44 2026 Received: from mail-yx1-f68.google.com (mail-yx1-f68.google.com [74.125.224.68]) (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 341B2239E81 for ; Thu, 25 Dec 2025 17:09:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.68 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766682579; cv=none; b=Do3T/5wfzKoNA7tWV4uoyzKTWfkb62BWUmdfuyBvVj1YIQBNDs4S3Emvvs4Fuc4vWtEeZvkp7Iyqmg8MpIuUvA2+P7HNqaw/gRYz19hZlLV0Fx+XV8PeaJKvCNR+bk5gwNK32YBHASBh1Iw2TePib1r8xib8EpT2kjeDglranxE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766682579; c=relaxed/simple; bh=w1WDwaBscjboIEZwjP8FVxLHs8ZbsMOX2p1cP0lc8Vk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mfBrChwO/0Rz5TBRafK3xaFJuzvitbVkyvS6A5MPSUdqPE15GbWGlW5Vtci5Uc1E7U8HWNY9RHYjL3kxCWW1ohtwrGZPqYMfkuW9bCwFl/HV21+mVULfsLbHfDsNJXyeB4jncLNv2fSB4xZOyKmcipDpDHC8ku93ke1rAVaJZMY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BbLNGWcD; arc=none smtp.client-ip=74.125.224.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BbLNGWcD" Received: by mail-yx1-f68.google.com with SMTP id 956f58d0204a3-644795bf5feso5902642d50.2 for ; Thu, 25 Dec 2025 09:09:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766682575; x=1767287375; 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=RyNbxONE5FjE3NQ/ds0QsvOq9j9R5HrwQHi/I2IB5ps=; b=BbLNGWcDuXOLMIXhQ1/9iubWvEpPPTPlW7qQwhxiiiBQ0vSpdhsKlX1UNv1YC6viLw GYmzqiLeGFMoYB+/OPTK5tW+0zI7cUXRmlqO2yPRcRVUWfHoRYaptLMRHrOZsgrAe+87 fe4jRAvVhgrQtHnr61DMXlropQ27Ol92FgSUsN6nN/HmHZxqxMIJ8syhHudTm32EVM4L u38l40Dscikos78qasw5G1+7khplvDNemfkmHsnc5iemYoywfN2BI4D1JiLnJHB3DxNO TUV2CGhXjRvDn18JpTxQb2FEKfTI84TZlyH7h41lrUHU2RvaBaC2+ii1fX1heyVopEGA 8U7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766682575; x=1767287375; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=RyNbxONE5FjE3NQ/ds0QsvOq9j9R5HrwQHi/I2IB5ps=; b=P3oCf7AwLVHqhbE0F1OSQvEWmfvOk01roI/bL5Tpvy0wRAZvq5/eYsk41tdBhxasv5 nPfCqg/g61H8RET1Trz3/8nmWl9MNDJBdaGxBDJFORtmBftXjjC+eW4vmuB1Y9dIL+d8 0qWV+t9LQ9NFREXJNxH2jZXBoW3JU+ioteLU3mOX1OFjHY0VUNFvlr11E4VQMZzVrX5K /8drxtjnKV5Q1G5YecMpEeo4jEi8yO/41rxqs99uIswj7qYUoXnpQ7HgTiEvhB7CJ6+8 vKA8Wz6R7TdTBE6URUB3o+Tqf69Ub6ThKCwTqfZvaj54168W0NPuSi5cA0Ux0KFQyrEz 07IA== X-Forwarded-Encrypted: i=1; AJvYcCV/vXBIW/kYvYrTuzqevSsUleEZgE6wy2z93E1oixPIfY61chq2kHV7PQVEILD27gfaTCyDMhnRZFqdjRk=@vger.kernel.org X-Gm-Message-State: AOJu0Yw4fST3neJojLG+qmGbtrd1BmFGmQphpACRSQoNe0mOco+mHzXD DdCeWlmwaXbJk+ITFYiKXPTC0HeWPW/4NIx5G+IBGHpjtI/jv1AdZHs2 X-Gm-Gg: AY/fxX4yv23nbyA9MZHsikWTrF9+LRxgfq8Y8OecO5kbFTGl+Wbmiua+laH4FHJPByM DNv1UPAeiOOY+EsUrR5r5sdre7d9x5DIn+mBcUtV34aHz3BVzlT7x5+nP0Vr6LACvUZm8b3Logr LP+L+YZLuI1KdN7qxt3qr4XTmvE3xr1W4feUiAgPLxzlc+CoXbXBvQdC6QlSiL1zP2fPBvJmRBu fWCVRQ5zjSHJRiSsyj3g5PAb0ZLtEZLxr3MIrS8nWSZGK1LYMoLsK+bVFN8bDn+Hm1/6mfgbPEn Ggj2OR6HRXm6gBheCOUdSbb+OVVJyBG1zedTs/+oMeJKiTfJLE+Tfdn7LPjA+T3HVLDrUxiLrxM fbQDFXLzCTXw2Suu3/BakNateXRColZJP44uECJ7vPvKyLpdX1iEjby3HgGqksLXQRFqWnHiDIW sdZ1FnwVcqMa/fXGiHOg== X-Google-Smtp-Source: AGHT+IFE8h6DvR/wQ+jE4yfmtCWCvhxSn9K0kIAiE1b9fgSbqcan4jtnrPelALLy8Mk/xvjxVHggUw== X-Received: by 2002:a53:c5ca:0:b0:645:5467:29e7 with SMTP id 956f58d0204a3-6466a8b4e26mr13238687d50.24.1766682575137; Thu, 25 Dec 2025 09:09:35 -0800 (PST) Received: from localhost ([2601:346:0:79bd:5a70:118b:3656:4527]) by smtp.gmail.com with ESMTPSA id 00721157ae682-78fb44f3f64sm75744107b3.27.2025.12.25.09.09.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Dec 2025 09:09:34 -0800 (PST) From: "Yury Norov (NVIDIA)" To: Steven Rostedt , Andrew Morton , Masami Hiramatsu , Mathieu Desnoyers , Andy Shevchenko , Christophe Leroy , Randy Dunlap , Ingo Molnar , Jani Nikula , Joonas Lahtinen , David Laight , Petr Pavlu , Andi Shyti , Rodrigo Vivi , Tvrtko Ursulin , Daniel Gomez , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-modules@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: "Yury Norov (NVIDIA)" Subject: [PATCH v4 2/7] moduleparam: include required headers explicitly Date: Thu, 25 Dec 2025 12:09:24 -0500 Message-ID: <20251225170930.1151781-3-yury.norov@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251225170930.1151781-1-yury.norov@gmail.com> References: <20251225170930.1151781-1-yury.norov@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The following patch drops moduleparam.h dependency on kernel.h. In preparation to it, list all the required headers explicitly. Suggested-by: Petr Pavlu Reviewed-by: Petr Pavlu Reviewed-by: Andy Shevchenko Signed-off-by: Yury Norov (NVIDIA) --- include/linux/moduleparam.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index 915f32f7d888..03a977168c52 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h @@ -2,9 +2,14 @@ #ifndef _LINUX_MODULE_PARAMS_H #define _LINUX_MODULE_PARAMS_H /* (C) Copyright 2001, 2002 Rusty Russell IBM Corporation */ + +#include +#include +#include #include #include #include +#include =20 /* * The maximum module name length, including the NUL byte. --=20 2.43.0 From nobody Sat Feb 7 09:46:44 2026 Received: from mail-yw1-f176.google.com (mail-yw1-f176.google.com [209.85.128.176]) (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 3D715274B30 for ; Thu, 25 Dec 2025 17:09:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766682579; cv=none; b=YpiLGsXG5u/JopFX8/UFnXSclJ24wFO3LnWvG0gKpZVij6CLcpIPDkeix6EsCE5Nlc/9h5bxfsH1Pw8x7oENPMbteSJm2OBT6L3/Djjo9wv1GrCcwRzE6y2UTfKowzP0emIQfnpWiFW2a7t83DzGJYGt0oaaPeDc2wGsDTPv4bc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766682579; c=relaxed/simple; bh=StpIGDCYbsALR3Ba5LOgwHS3EyBzqwjbuM5PV4Ik6eQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BHro3dhKDSYRLTq/Hh8NlHknui6MxQbtTA7TYWb5wcumVjrU0hIrBEnO8M8Rh1g62i2K5J2IH8Ehz8FjoHrm9kYhxzUiaP4zGOsWOf5CrtxFWT8jfE9grchwb8DBt1BXmIRiJfzx33YQfJY2Wgxi7Up8TTq1VuAjqvTCaiEHxXU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hQJphvVU; arc=none smtp.client-ip=209.85.128.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hQJphvVU" Received: by mail-yw1-f176.google.com with SMTP id 00721157ae682-78fb5764382so47509497b3.0 for ; Thu, 25 Dec 2025 09:09:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766682576; x=1767287376; 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=NNd78aAqU5EbrtjfwRe6vlIJ1RKc0HFvUVEnBy0vIWA=; b=hQJphvVUfAdwnxTi9K2gpheLbqAND07XlpvGPpLlLUdZrIEmMF2AXsA8gF4+pkqhye 8oA4dGg9SC0DdMb6no9afhZ30HOFcPcvGQO9b4rQHCjF7EzfemTj3kCPnjK+QHlDXe4T UqsHFlp4QyBYN4YXwTIFkkDECwD2wgWk+kVxDb7pcRHibPa52pr9T5A5f1oiHP9JN2mF Z1jGmJgvNm8W1kmSlE2gwh1Sqo5UYok03LzVdG/yt7kHzgR5dGBDY3p7QaH7ESWgRI/v GxibTQMmj5XD3KKG+/JoxOz7TSLNX860K1UfgSC6RDwCNZdhtzCSezyZa8iZrAd7FHK7 f1+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766682576; x=1767287376; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=NNd78aAqU5EbrtjfwRe6vlIJ1RKc0HFvUVEnBy0vIWA=; b=k7sHP8uwFCow7YLoV46nPpbq5m/ys5N/QfvN9QAJeWm6s4+GnoT8TyHBli4FOtaB6O RMOhYrX0JDOjdEI+WAV7/zMc1Rpq75hqfazpUoVL82r+o+tcO4ooXKgcZ0ZofgPvfYJy TuG9NNp8FGAvnQ/bpDRXNr8m7qo0QeBwLZnK7cAYS5E4obs2zT3jz0LOBgOJIEPsT/Ni cisKOdEjT9rMgiQ1CZGlrGNNsw5oeCx7t991ngO4HiVdVZ7aXMd+PYBPYtXzXNJHDSoM y+BkHI1GPivJ672/NWt7gwg3X42T6+Ud+pv0qfnFJBOPui2mztZuqf8jOVmL8MC9oaD/ hfuA== X-Forwarded-Encrypted: i=1; AJvYcCWN78A8I8hmCzZeFirLXhIN6xyZRa3zxYkdltZQ/ksswEnzR9p2FVmj7qGsCrPKAnZYe1cN16ccUEb3nRs=@vger.kernel.org X-Gm-Message-State: AOJu0YzYZVo52d+VV8fDhYOyXTop1bJ/V35cIW6JgFX5Y/pH+WePbSIF ThP4Acmet64HUmJApu1nfaIGPcn3V7hE/oOArMns7SYOByEPgg58py82 X-Gm-Gg: AY/fxX4H1T2RBwBrS9RIAyQ6daT6bA+M4Uf6fQu0myvJ6yCrZ1V6GO9MQbw+xB/CUMe WwpZDGcjboRffR/OO8kzMubhc3xKiXPd/HGS3SF/SgPJUD9qP1nT20NfHs81s0YzVGUftvBzQlK jueRXKJkrwBOTx79K8oUQc96sveJaxjhFO8pzaiIpOYqh2R4EyOwZtMzl23MxuAVGgJ27sLh7mw /i3QwXICr30sIwlFEetAIoefnZphGF7r3MMWbo7V6mO/nLvJk7MYIabmpiSpO0DO/asfgrT/JVY HLLA64iH0ixJ+B2XAixgEdxA+rR9SiUL3xnt/dyuINHPaYOVA45sHHzwNw36aK3VPjvOp9DNpKY 2eL8eUGx69U0qD0vQEh4Jn4TXtmVx7TpIZ6ZTcLJdk/muKByRMroqTpRpo2WFPqH3FUgmUnQJxx R8hd+P+c0= X-Google-Smtp-Source: AGHT+IEiizqa7gXB/ACCt9JE7Q6rU9XXmV2EFcojqYXAdUzX6FLa2edp+vH8KkFhKHQ2zor39oLYCg== X-Received: by 2002:a05:690c:4989:b0:78c:2c09:4748 with SMTP id 00721157ae682-78fb3f7e542mr153887627b3.30.1766682576087; Thu, 25 Dec 2025 09:09:36 -0800 (PST) Received: from localhost ([2601:346:0:79bd:5a70:118b:3656:4527]) by smtp.gmail.com with ESMTPSA id 00721157ae682-78fb439b8acsm76287267b3.13.2025.12.25.09.09.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Dec 2025 09:09:35 -0800 (PST) From: "Yury Norov (NVIDIA)" To: Steven Rostedt , Andrew Morton , Masami Hiramatsu , Mathieu Desnoyers , Andy Shevchenko , Christophe Leroy , Randy Dunlap , Ingo Molnar , Jani Nikula , Joonas Lahtinen , David Laight , Petr Pavlu , Andi Shyti , Rodrigo Vivi , Tvrtko Ursulin , Daniel Gomez , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-modules@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: "Yury Norov (NVIDIA)" Subject: [PATCH v4 3/7] kernel.h: move VERIFY_OCTAL_PERMISSIONS() to sysfs.h Date: Thu, 25 Dec 2025 12:09:25 -0500 Message-ID: <20251225170930.1151781-4-yury.norov@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251225170930.1151781-1-yury.norov@gmail.com> References: <20251225170930.1151781-1-yury.norov@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The macro is related to sysfs, but is defined in kernel.h. Move it to the proper header, and unload the generic kernel.h. Now that the macro is removed from kernel.h, linux/moduleparam.h is decoupled, and kernel.h inclusion can be removed. Acked-by: Randy Dunlap Tested-by: Randy Dunlap Reviewed-by: Andy Shevchenko Reviewed-by: Petr Pavlu Signed-off-by: Yury Norov (NVIDIA) --- Documentation/filesystems/sysfs.rst | 2 +- include/linux/kernel.h | 12 ------------ include/linux/moduleparam.h | 2 +- include/linux/sysfs.h | 13 +++++++++++++ 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Documentation/filesystems/sysfs.rst b/Documentation/filesystem= s/sysfs.rst index 2703c04af7d0..ffcef4d6bc8d 100644 --- a/Documentation/filesystems/sysfs.rst +++ b/Documentation/filesystems/sysfs.rst @@ -120,7 +120,7 @@ is equivalent to doing:: .store =3D store_foo, }; =20 -Note as stated in include/linux/kernel.h "OTHER_WRITABLE? Generally +Note as stated in include/linux/sysfs.h "OTHER_WRITABLE? Generally considered a bad idea." so trying to set a sysfs file writable for everyone will fail reverting to RO mode for "Others". =20 diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 61d63c57bc2d..5b879bfea948 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -389,16 +389,4 @@ static inline void ftrace_dump(enum ftrace_dump_mode o= ops_dump_mode) { } # define REBUILD_DUE_TO_DYNAMIC_FTRACE #endif =20 -/* Permissions on a sysfs file: you didn't miss the 0 prefix did you? */ -#define VERIFY_OCTAL_PERMISSIONS(perms) \ - (BUILD_BUG_ON_ZERO((perms) < 0) + \ - BUILD_BUG_ON_ZERO((perms) > 0777) + \ - /* USER_READABLE >=3D GROUP_READABLE >=3D OTHER_READABLE */ \ - BUILD_BUG_ON_ZERO((((perms) >> 6) & 4) < (((perms) >> 3) & 4)) + \ - BUILD_BUG_ON_ZERO((((perms) >> 3) & 4) < ((perms) & 4)) + \ - /* USER_WRITABLE >=3D GROUP_WRITABLE */ \ - BUILD_BUG_ON_ZERO((((perms) >> 6) & 2) < (((perms) >> 3) & 2)) + \ - /* OTHER_WRITABLE? Generally considered a bad idea. */ \ - BUILD_BUG_ON_ZERO((perms) & 2) + \ - (perms)) #endif diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index 03a977168c52..281a006dc284 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include =20 /* diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index c33a96b7391a..99b775f3ff46 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h @@ -808,4 +808,17 @@ static inline void sysfs_put(struct kernfs_node *kn) kernfs_put(kn); } =20 +/* Permissions on a sysfs file: you didn't miss the 0 prefix did you? */ +#define VERIFY_OCTAL_PERMISSIONS(perms) \ + (BUILD_BUG_ON_ZERO((perms) < 0) + \ + BUILD_BUG_ON_ZERO((perms) > 0777) + \ + /* USER_READABLE >=3D GROUP_READABLE >=3D OTHER_READABLE */ \ + BUILD_BUG_ON_ZERO((((perms) >> 6) & 4) < (((perms) >> 3) & 4)) + \ + BUILD_BUG_ON_ZERO((((perms) >> 3) & 4) < ((perms) & 4)) + \ + /* USER_WRITABLE >=3D GROUP_WRITABLE */ \ + BUILD_BUG_ON_ZERO((((perms) >> 6) & 2) < (((perms) >> 3) & 2)) + \ + /* OTHER_WRITABLE? Generally considered a bad idea. */ \ + BUILD_BUG_ON_ZERO((perms) & 2) + \ + (perms)) + #endif /* _SYSFS_H_ */ --=20 2.43.0 From nobody Sat Feb 7 09:46:44 2026 Received: from mail-yx1-f54.google.com (mail-yx1-f54.google.com [74.125.224.54]) (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 2B3B223183C for ; Thu, 25 Dec 2025 17:09:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766682580; cv=none; b=pM0Yj7upqzlY7ZxQwBerBW+Tr8lhglesHiD0YONmLnV/fKRetIXNVKp3fZ0DzhMNNUlFU2LjePfjmB/rtSKDnAS5oe16uQBmMUb118o1i97CYo/Vo77Ye0rPRhpjeo7Ok/qDcA4dLLkoSpIcNQWDXNi5WjnCQjy5NphfOY+GKa0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766682580; c=relaxed/simple; bh=Y9lHrE5F2aj8aas4pRDKLNMxJ8UQSSadDNHEiSkndcQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HwQrRM/ZazeXmVVTW9W9slkaFv3MPrSN73tX6/EAFiXglOojveCIceoo/YK5iCCqMRu42wT+ZJROJbLpBUutTF8bhI6//xddtvlxV8UhsGiw09beYhughVzST0aaApZJboEQr1qfh4GUA9w3bV6EvFMpeIlQY6aXXtSANMQF/JM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=icCFm5ez; arc=none smtp.client-ip=74.125.224.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="icCFm5ez" Received: by mail-yx1-f54.google.com with SMTP id 956f58d0204a3-6467b7c3853so3220298d50.0 for ; Thu, 25 Dec 2025 09:09:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766682577; x=1767287377; 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=Dc5Me+mE1rk9t6TSSnoEi9o5UAq5H187I9GSo5hasb4=; b=icCFm5ezjqUJhtLQ3/yCvN9eESfX1JiER7BVXnZeHGpDu/eCBb9e9op0B7+xWUVx43 FUBMIOab++qyLGS/Ou3WF5dziCEhImhogCzgvEXQQixCbMQTR+OdE1tiWLMeqZtdEt7b /dtudqsZxcvZta2IYWQDvx+knx4AJerqDWT0Dn1QclH61zZAQutBsmg/Y0ZZzmel6nQb HPllx/XnlBzir/H5OvdiVGRSfPHXIlzgDVBZdyoZ/7awguytpU/OoyC8+IXiop+NiOSR 90UZgq7vSrOY5GNruxSqTit0CNiiH6tY3gvdPvALCtL2wGJ2DCd6ihwkEmJ33RmEsD+h qH8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766682577; x=1767287377; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Dc5Me+mE1rk9t6TSSnoEi9o5UAq5H187I9GSo5hasb4=; b=Lg1IZ3Wy2W2FDCXTc8h1GJT0LMR2mJZwxZcqf+zBldvUKvbzgGcuyvpxPlXiQXEOuv iC23CM1JMLuzci/EiMfjecSvioTXmqj2LGp8vxEfGwzEZ6iJaWibptVuMKiJCcb1oBCh 0/gffUJ+j4kRUQ/FZAm5zet5P8kM8O5NZzLd98KW5OA+dhrT9RIdGptVqcDXzcRz/TUE s520wlpC1I2gCSP7jl78zWkr/6JJoq1mn5pVIRaJu+FuYYQhuhDEXrfCib32NRsNpaEu XR4lr8grlmlmAX/w8MO6q2rVrA9T9QHHEdojtGXxsYuK1tj00MRVLTko4o/2A5DjBFmX JiOw== X-Forwarded-Encrypted: i=1; AJvYcCX9c7xIlLnmwWO9kmuYCZ9hh/58UQhPzyvBuoaWVt74W4RY0JcC2jd1oje2dd3A98r1rBUtLVycav75KEI=@vger.kernel.org X-Gm-Message-State: AOJu0YyDOwYPHpHE2KgiimQUvDm3uJWELw+iaEkr0b7GCH58iAefYPNH 0nD5QJY5AvQGe8KYFMqmwWRaZ6UQFOZU2RYBSl5WxsvkYgJvRms6olj/ X-Gm-Gg: AY/fxX6sLPdK8s93wh9uTTxDkdJnF1+Z+dAoGjp6SDAN2117eKtjrL9rSbbqghLQ1NP yJIAL8ZoGxVCVajXFpw7gwinurASAE7GtCzpRhUcMRdiTmOzbDa6X2JLaB7cUCDuOYlJd5yeatQ 9z+H7FVcgD2BkgLaKWlrWEc/IW4WnzY2DPHM+bPBMFn0hFR0oTu8OQ9GNAUmjjJwoFOsN9KA9oZ h60kCol8ajy7zEZ7BPwDD88ZWbceyc/TEeb5EGQ4TDBWl/nB2uuWbI3mZ6CgEXHx4eAzpFfa2Fm PMwraUAfs7UKHxMc2XHV2Dq54O6GOPRK7BVOHQ++qM6s4FU4dD1vUrb9pMbU5+CvWWAEQxv9AyU FnlnUI/gZXg0WLmBW1THNtqjOPo9wBq67J0koACY4aLzK1ObNV4NO1naN3Q9Ca8xr6NbQJ30efk jTfzEB0+E= X-Google-Smtp-Source: AGHT+IF3pn2lAHgaG+6TAPCfe6GjTjYcrsSqlU3VOVIzxXfAGamdgIbuGhSoSIuBjHiFa2I0R1eJBQ== X-Received: by 2002:a05:690e:1502:b0:644:60d9:866b with SMTP id 956f58d0204a3-6466a9265a2mr13857881d50.92.1766682577038; Thu, 25 Dec 2025 09:09:37 -0800 (PST) Received: from localhost ([2601:346:0:79bd:5a70:118b:3656:4527]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-6466a92186bsm9734975d50.12.2025.12.25.09.09.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Dec 2025 09:09:36 -0800 (PST) From: "Yury Norov (NVIDIA)" To: Steven Rostedt , Andrew Morton , Masami Hiramatsu , Mathieu Desnoyers , Andy Shevchenko , Christophe Leroy , Randy Dunlap , Ingo Molnar , Jani Nikula , Joonas Lahtinen , David Laight , Petr Pavlu , Andi Shyti , Rodrigo Vivi , Tvrtko Ursulin , Daniel Gomez , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-modules@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: "Yury Norov (NVIDIA)" Subject: [PATCH v4 4/7] kernel.h: include linux/instruction_pointer.h explicitly Date: Thu, 25 Dec 2025 12:09:26 -0500 Message-ID: <20251225170930.1151781-5-yury.norov@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251225170930.1151781-1-yury.norov@gmail.com> References: <20251225170930.1151781-1-yury.norov@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In preparation for decoupling linux/instruction_pointer.h and linux/kernel.h, include instruction_pointer.h explicitly where needed. Signed-off-by: Yury Norov (NVIDIA) --- arch/s390/include/asm/processor.h | 1 + include/linux/ww_mutex.h | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/proc= essor.h index 3affba95845b..cc187afa07b3 100644 --- a/arch/s390/include/asm/processor.h +++ b/arch/s390/include/asm/processor.h @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/include/linux/ww_mutex.h b/include/linux/ww_mutex.h index 45ff6f7a872b..9b30fa2ec508 100644 --- a/include/linux/ww_mutex.h +++ b/include/linux/ww_mutex.h @@ -17,6 +17,7 @@ #ifndef __LINUX_WW_MUTEX_H #define __LINUX_WW_MUTEX_H =20 +#include #include #include =20 --=20 2.43.0 From nobody Sat Feb 7 09:46:44 2026 Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (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 83ED6F50F for ; Thu, 25 Dec 2025 18:48:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766688526; cv=none; b=eZfTCLDkkQLG0UvXhWnbGA7NSc42AdqD/FSaL6YXjDayOWYv1nIKwfq964o6WIvAgnvbEN442giDEdIwprLnxb4kL4uR7eapEDuk623HErvSdrXoutj9BEkYUhuHc6OH0XFW2MdcCRi7pCSprE1S7pqXTbaPdXG0SsLJT7VURlU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766688526; c=relaxed/simple; bh=Sp3BBI7rqWS/x5u5n95rHXBvTYUWZEdDT2uy0cYwMU4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FmrlLJCm8s5E9OH597kzPVr904BR4MCH0MqJOjOMytAec8JKQRpsE2M0Kk4v192z7xnHY7QFJjOerKOIgnFf5EgQtCmGvfwETwYsjweB4g4dGja9apzpDLmVnoh0mKAjT5nFPNREOKatKeFn/V+YFlCd6WeV7pRLQ212e/ZZGTA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UGGhnEr4; arc=none smtp.client-ip=209.85.222.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UGGhnEr4" Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-8c0f15e8247so638389585a.3 for ; Thu, 25 Dec 2025 10:48:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766688523; x=1767293323; 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=hauBx7stO8fgVv7cwKU+lRmpmOfl414DpJwGxBenCpM=; b=UGGhnEr4i2Pmq5Yl9P7ukh855oZswexJeZdsIR9XLQhG/wWCn6iR8kzwNJ2BP0ZfyQ DBU16PD5+ZsBLP1VetyGXpGtSri21ZZYuzzHdP0msvTaDSbJuSleY5J5W0GjuA2KYLo0 6W79Wj8SlHSe57Gc0dr+Km8WnRlU03Ndq/8qAUklZynipIyxGKAxyxsv2kvonvzPfeQB vwXYZ8BjDdisppNEPbW4OsKtoQRmrYUm51ifY8Ea3QBD2mfbtrtP7+CJRohdgrMq8h7m nom7dVAvrPxj9iBCVVxs/Mr2Tr2MVu5sitta/Q1eNhEbEMC7cW/SgqBM+cuQnYVitQRw ErtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766688523; x=1767293323; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=hauBx7stO8fgVv7cwKU+lRmpmOfl414DpJwGxBenCpM=; b=PLCexlG+L3/Qe7aYU9lbIXcnM5N1Y+uuZLU17HasWYwheFb+eLMbToYEys/ja34ecd PT7+yGo0jBEYzDKLnLuSzwLhJ+t/8fZJHzOtHNR+inaDnuH+4r3OYQIlVDQAla1IZtWx HEPmM07LmovkeMr9u5ojolbVLsBPbVhHIIU626L8APFAvIl/qsNtSHCBI+wjsUJQqbXn 0SYChUqNjOsZ2jQnaw7pB6SeYduoduMEuNRUvc0teHYkoXCGtQkoV3B8Q0LZz4t/ePpQ 8D/qBgTZaQbjaeXuf2N/q3kl5Sj3yyLWoVJUsUAIW3mjRLC7DQ7E8+FCgd/A6sRfgRnk h7Ww== X-Forwarded-Encrypted: i=1; AJvYcCWh3B18iszkuK2yA79lV24X9JJAiweZ3g27shtkGX80IwiBZ3dlcCuDlr6TzLQpuqx9Bi/Qq6LPEqsCojQ=@vger.kernel.org X-Gm-Message-State: AOJu0Ywlw6Yyk3t1xY6S2E/n1jRXtMXSQy+eiqsy4F7eU4nqGKFuewIw m+EVmNSD+scQN5SrPmEBHUvus2CLyXEG4A20LX9iwWsf5bVWm7QgtRSJa7kR3g== X-Gm-Gg: AY/fxX4UvDNncutunbWufh4YTv055L0Vy5oeijYI3r8CavtorKzfmmMlYfrtCKK7GgM wwAwFkeJ7uuR5gsv6uEvIvO71y9zUwLozGpWjziSIVzyxt8XPZ2LLivSfkqukroLkQjxmp7jKDm DKpP5Ppmr+a0d16M7pipzA6UeQYceOzsjWvljh/z6ibVv7eCDNMJGmWyun1Anci8mPqu59Rw02N F+MJeiULedyL0goACZDRwnhh/CKZEcvC+tE4O3zRqZSaf18Sd/59XFOkT2w1o8WFi2fqzRSDPpy pcTzL6Qto2ow/p4ZUfy/FtI/+l4PlPDcMCYT2HBiW9ARAmFjtZhc1ZiVLb4werD1Zcv+UQgNPwT sXXm2rCDfOZRkpXK2lb19E5N0dPsaC/JcHbKdNwtrIimFnWgVcBJdKBGopT6iU9317wpa98LnMV G3FmyxLYg= X-Google-Smtp-Source: AGHT+IFOC5KnXE7Y/86OXEfn0VfROKTdlo6cIy7sSNHG4HuRQ93qgtI5LmuQjuxLc/KbIiLosqGOQg== X-Received: by 2002:a53:8592:0:b0:63f:ad6d:cbd5 with SMTP id 956f58d0204a3-6466a900e02mr12636421d50.60.1766682577930; Thu, 25 Dec 2025 09:09:37 -0800 (PST) Received: from localhost ([2601:346:0:79bd:5a70:118b:3656:4527]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-6466a8bd6ffsm9803141d50.9.2025.12.25.09.09.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Dec 2025 09:09:37 -0800 (PST) From: "Yury Norov (NVIDIA)" To: Steven Rostedt , Andrew Morton , Masami Hiramatsu , Mathieu Desnoyers , Andy Shevchenko , Christophe Leroy , Randy Dunlap , Ingo Molnar , Jani Nikula , Joonas Lahtinen , David Laight , Petr Pavlu , Andi Shyti , Rodrigo Vivi , Tvrtko Ursulin , Daniel Gomez , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-modules@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: "Yury Norov (NVIDIA)" Subject: [PATCH v4 5/7] tracing: Remove size parameter in __trace_puts() Date: Thu, 25 Dec 2025 12:09:27 -0500 Message-ID: <20251225170930.1151781-6-yury.norov@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251225170930.1151781-1-yury.norov@gmail.com> References: <20251225170930.1151781-1-yury.norov@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Steven Rostedt The __trace_puts() function takes a string pointer and the size of the string itself. All users currently simply pass in the strlen() of the string it is also passing in. There's no reason to pass in the size. Instead have the __trace_puts() function do the strlen() within the function itself. This fixes a header recursion issue where using strlen() in the macro calling __trace_puts() requires adding #include in order to use strlen(). Removing the use of strlen() from the header fixes the recursion issue. Link: https://lore.kernel.org/all/aUN8Hm377C5A0ILX@yury/ Signed-off-by: Steven Rostedt (Google) Signed-off-by: Yury Norov (NVIDIA) --- include/linux/kernel.h | 4 ++-- kernel/trace/trace.c | 7 +++---- kernel/trace/trace.h | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 5b879bfea948..4ee48fb10dec 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -329,10 +329,10 @@ int __trace_printk(unsigned long ip, const char *fmt,= ...); if (__builtin_constant_p(str)) \ __trace_bputs(_THIS_IP_, trace_printk_fmt); \ else \ - __trace_puts(_THIS_IP_, str, strlen(str)); \ + __trace_puts(_THIS_IP_, str); \ }) extern int __trace_bputs(unsigned long ip, const char *str); -extern int __trace_puts(unsigned long ip, const char *str, int size); +extern int __trace_puts(unsigned long ip, const char *str); =20 extern void trace_dump_stack(int skip); =20 diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 6f2148df14d9..57f24e2cd19c 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -1178,11 +1178,10 @@ EXPORT_SYMBOL_GPL(__trace_array_puts); * __trace_puts - write a constant string into the trace buffer. * @ip: The address of the caller * @str: The constant string to write - * @size: The size of the string. */ -int __trace_puts(unsigned long ip, const char *str, int size) +int __trace_puts(unsigned long ip, const char *str) { - return __trace_array_puts(printk_trace, ip, str, size); + return __trace_array_puts(printk_trace, ip, str, strlen(str)); } EXPORT_SYMBOL_GPL(__trace_puts); =20 @@ -1201,7 +1200,7 @@ int __trace_bputs(unsigned long ip, const char *str) int size =3D sizeof(struct bputs_entry); =20 if (!printk_binsafe(tr)) - return __trace_puts(ip, str, strlen(str)); + return __trace_puts(ip, str); =20 if (!(tr->trace_flags & TRACE_ITER(PRINTK))) return 0; diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index b6d42fe06115..de4e6713b84e 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -2116,7 +2116,7 @@ extern void tracing_log_err(struct trace_array *tr, * about performance). The internal_trace_puts() is for such * a purpose. */ -#define internal_trace_puts(str) __trace_puts(_THIS_IP_, str, strlen(str)) +#define internal_trace_puts(str) __trace_puts(_THIS_IP_, str) =20 #undef FTRACE_ENTRY #define FTRACE_ENTRY(call, struct_name, id, tstruct, print) \ --=20 2.43.0 From nobody Sat Feb 7 09:46:44 2026 Received: from mail-yx1-f53.google.com (mail-yx1-f53.google.com [74.125.224.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 10B7127815D for ; Thu, 25 Dec 2025 17:09:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766682582; cv=none; b=bYIlrLNOc453gMhWc9IWk9MXUUT0VaGijMbB6MHVVdPgtur+xuEUCNFp+HI2DQntnB42b3mtU3ODeHY92Rzv+w6X9VRZwSUjnj2tuy2AXsb3ov7dtRJiUHtOAcxTeciED/PIFFlCHHPhOZjVJQjsXdDYVoA7+UNddcl7ZRF/ZKM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766682582; c=relaxed/simple; bh=30uearnwXqCcGy3WHaZHF+x60hO7LBuBi5Ytc68DIK0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fHx91os2KjR4DYd/okj5NBN/QM+9WrfrGInubxaadtEaTOSL4t/lXgmnwc4GnObFfpDr7C4E6occaaR93abY/Piuw6LQQGpiu1H1OKIiaAAvhOgMhO9FKVXPH+kVT6OeWvZI/ztkz9n5YkXylFDkhygKOYIHq7NUhW2j3uwh2L4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HCKuWljj; arc=none smtp.client-ip=74.125.224.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HCKuWljj" Received: by mail-yx1-f53.google.com with SMTP id 956f58d0204a3-6420c08f886so8482740d50.3 for ; Thu, 25 Dec 2025 09:09:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766682579; x=1767287379; 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=K4tmN2HYqytbG2z1YqUvyseyPfGFcRHLkpM5+ZItkRA=; b=HCKuWljjDPAmZT2lSFEXwKbqLNsWvBXqiUUefog5+xOgAGjl0LwtLq54eMJMhMrbum EVeWdL/2soysWRZSl7b38wE/uLTPqLwtu7cQJFGW/jdWPGNzw22zimcvWeUDbvHlS/OC LYk1GGyBfVXl+lo3sruGXwmCK1qtzBn4TSg+cooVvU2/GiBPFSRUr3x09GmGjZeEdfnU yWa0A+7lBkHzAjkG83S34a/B7Ux9SnKWjOsTLIUlZ/a/knhb+i73wO0nhM6ql/IGtzwa ZzHJxGkSAy1Sz/RmpQogh5UZLborUiFOGPUvyw/7GlwnXyUIgvCaIHAnGX8MI7OBrsar nz6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766682579; x=1767287379; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=K4tmN2HYqytbG2z1YqUvyseyPfGFcRHLkpM5+ZItkRA=; b=auWPNHvCphieZMjHYQKYHUFQkxhHDEn9IcofQUYb3sh0XdEsiCEQ9pjREA8pYiNXAj uLYE7QJuIvmjMdK4ie0Ncchk31gSU243GFyt/PdasZdkXOIFiwM90OJeSSPSU0STrtxo PQW13mgva+coiE4mUp49RnJnYhKnw3UOnhY1nEqHnFBi5lPbT4bM8ySsytq/lwq2D9gX ueXxfkNTICb7nY1EXypskAH6em6vZNLS7FPmTh5EKjuTMyRC5PbTxMD4if7ol2flYLZA vK+2hTQi9qslntKOY5/WxvhDaBftLtS4kVrLWXcx/AHtNMjgQD7lxGVJOQcwABsB7uAb G1Ng== X-Forwarded-Encrypted: i=1; AJvYcCWDsZuyvKqSHgTg2ie9HVKnyKqdBnI7LXcPYzKc7t8tpJoZ56x4BpqrH2vnthSaJde1BTIsXM5K1y/36X8=@vger.kernel.org X-Gm-Message-State: AOJu0YwgKUemnqubkiEe3A7CYwnZnenEo+QkhSJx5nWO16LCbiU00zpY PRwuvnRdwW/LLlEmjoFlFgWzaS79nI8OXPIBXEiVwnT6mlEaFfighJcK X-Gm-Gg: AY/fxX5jKOCCX0ZsKp6dD8F+ZQROwJfjwAh7l7N0Giu+YXSt9FRhiPz5bfpY4rQg5Xt dwmSuqfwcKXPKniTLmVsuuzAZ+7glWwGVNzV0Yln8yTAWkaf6fjdwHcNFuq/bhpFF1Ar2c7BxHi 8XEe5IiwfGrGRFmz9h1hBJqBEn71/ApgeZvR9OADKudfyWPg/ugPcFqivirLOBc3JuqS7TLebv8 AGyNI/CcBQbAPR9EBtFUCj0SEKxfTCpebO/5r0KIuBTr5f0GIHvbwn2AVked+AxbD5ByMs0Um08 mDq/0SaLpbzHV4cifLNTgPZN8XbLi88OcDs4ktxpaU+YwEeNp1l0BZWyxgttoXWIZXnf4mvvknv uQm73FeKTRMKGXw7SnlHbHBKbHClmNjyAKIHsHzLPO3vK7A0iKjO9qDeumy9Ruh+875eNKNHqZ6 fSzMQjwLQ= X-Google-Smtp-Source: AGHT+IEHt241P7yMnFUw7MWZH25jfPi2EpOi6/Ex4aSS0XDog5eWv7lNbl6UcIDzztXWn4JBSQB6iQ== X-Received: by 2002:a05:690e:214c:b0:644:60d9:7534 with SMTP id 956f58d0204a3-6466a8e0f79mr12124129d50.90.1766682578862; Thu, 25 Dec 2025 09:09:38 -0800 (PST) Received: from localhost ([2601:346:0:79bd:5a70:118b:3656:4527]) by smtp.gmail.com with ESMTPSA id 00721157ae682-78fb44f0e3csm76211247b3.28.2025.12.25.09.09.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Dec 2025 09:09:38 -0800 (PST) From: "Yury Norov (NVIDIA)" To: Steven Rostedt , Andrew Morton , Masami Hiramatsu , Mathieu Desnoyers , Andy Shevchenko , Christophe Leroy , Randy Dunlap , Ingo Molnar , Jani Nikula , Joonas Lahtinen , David Laight , Petr Pavlu , Andi Shyti , Rodrigo Vivi , Tvrtko Ursulin , Daniel Gomez , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-modules@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: "Yury Norov (NVIDIA)" Subject: [PATCH v4 6/7] tracing: move tracing declarations from kernel.h to a dedicated header Date: Thu, 25 Dec 2025 12:09:28 -0500 Message-ID: <20251225170930.1151781-7-yury.norov@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251225170930.1151781-1-yury.norov@gmail.com> References: <20251225170930.1151781-1-yury.norov@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Tracing is a half of the kernel.h in terms of LOCs, although it's a self-consistent part. It is intended for quick debugging purposes and isn't used by the normal tracing utilities. Move it to a separate header. If someone needs to just throw a trace_printk() in their driver, they will not have to pull all the heavy tracing machinery. This is a pure move. Acked-by: Steven Rostedt Reviewed-by: Andy Shevchenko Signed-off-by: Yury Norov (NVIDIA) --- include/linux/kernel.h | 196 +-------------------------------- include/linux/trace_printk.h | 204 +++++++++++++++++++++++++++++++++++ 2 files changed, 205 insertions(+), 195 deletions(-) create mode 100644 include/linux/trace_printk.h diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 4ee48fb10dec..a377335e01da 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include =20 @@ -190,200 +190,6 @@ enum system_states { }; extern enum system_states system_state; =20 -/* - * General tracing related utility functions - trace_printk(), - * tracing_on/tracing_off and tracing_start()/tracing_stop - * - * Use tracing_on/tracing_off when you want to quickly turn on or off - * tracing. It simply enables or disables the recording of the trace event= s. - * This also corresponds to the user space /sys/kernel/tracing/tracing_on - * file, which gives a means for the kernel and userspace to interact. - * Place a tracing_off() in the kernel where you want tracing to end. - * From user space, examine the trace, and then echo 1 > tracing_on - * to continue tracing. - * - * tracing_stop/tracing_start has slightly more overhead. It is used - * by things like suspend to ram where disabling the recording of the - * trace is not enough, but tracing must actually stop because things - * like calling smp_processor_id() may crash the system. - * - * Most likely, you want to use tracing_on/tracing_off. - */ - -enum ftrace_dump_mode { - DUMP_NONE, - DUMP_ALL, - DUMP_ORIG, - DUMP_PARAM, -}; - -#ifdef CONFIG_TRACING -void tracing_on(void); -void tracing_off(void); -int tracing_is_on(void); -void tracing_snapshot(void); -void tracing_snapshot_alloc(void); - -extern void tracing_start(void); -extern void tracing_stop(void); - -static inline __printf(1, 2) -void ____trace_printk_check_format(const char *fmt, ...) -{ -} -#define __trace_printk_check_format(fmt, args...) \ -do { \ - if (0) \ - ____trace_printk_check_format(fmt, ##args); \ -} while (0) - -/** - * trace_printk - printf formatting in the ftrace buffer - * @fmt: the printf format for printing - * - * Note: __trace_printk is an internal function for trace_printk() and - * the @ip is passed in via the trace_printk() macro. - * - * This function allows a kernel developer to debug fast path sections - * that printk is not appropriate for. By scattering in various - * printk like tracing in the code, a developer can quickly see - * where problems are occurring. - * - * This is intended as a debugging tool for the developer only. - * Please refrain from leaving trace_printks scattered around in - * your code. (Extra memory is used for special buffers that are - * allocated when trace_printk() is used.) - * - * A little optimization trick is done here. If there's only one - * argument, there's no need to scan the string for printf formats. - * The trace_puts() will suffice. But how can we take advantage of - * using trace_puts() when trace_printk() has only one argument? - * By stringifying the args and checking the size we can tell - * whether or not there are args. __stringify((__VA_ARGS__)) will - * turn into "()\0" with a size of 3 when there are no args, anything - * else will be bigger. All we need to do is define a string to this, - * and then take its size and compare to 3. If it's bigger, use - * do_trace_printk() otherwise, optimize it to trace_puts(). Then just - * let gcc optimize the rest. - */ - -#define trace_printk(fmt, ...) \ -do { \ - char _______STR[] =3D __stringify((__VA_ARGS__)); \ - if (sizeof(_______STR) > 3) \ - do_trace_printk(fmt, ##__VA_ARGS__); \ - else \ - trace_puts(fmt); \ -} while (0) - -#define do_trace_printk(fmt, args...) \ -do { \ - static const char *trace_printk_fmt __used \ - __section("__trace_printk_fmt") =3D \ - __builtin_constant_p(fmt) ? fmt : NULL; \ - \ - __trace_printk_check_format(fmt, ##args); \ - \ - if (__builtin_constant_p(fmt)) \ - __trace_bprintk(_THIS_IP_, trace_printk_fmt, ##args); \ - else \ - __trace_printk(_THIS_IP_, fmt, ##args); \ -} while (0) - -extern __printf(2, 3) -int __trace_bprintk(unsigned long ip, const char *fmt, ...); - -extern __printf(2, 3) -int __trace_printk(unsigned long ip, const char *fmt, ...); - -/** - * trace_puts - write a string into the ftrace buffer - * @str: the string to record - * - * Note: __trace_bputs is an internal function for trace_puts and - * the @ip is passed in via the trace_puts macro. - * - * This is similar to trace_printk() but is made for those really fast - * paths that a developer wants the least amount of "Heisenbug" effects, - * where the processing of the print format is still too much. - * - * This function allows a kernel developer to debug fast path sections - * that printk is not appropriate for. By scattering in various - * printk like tracing in the code, a developer can quickly see - * where problems are occurring. - * - * This is intended as a debugging tool for the developer only. - * Please refrain from leaving trace_puts scattered around in - * your code. (Extra memory is used for special buffers that are - * allocated when trace_puts() is used.) - * - * Returns: 0 if nothing was written, positive # if string was. - * (1 when __trace_bputs is used, strlen(str) when __trace_puts is used) - */ - -#define trace_puts(str) ({ \ - static const char *trace_printk_fmt __used \ - __section("__trace_printk_fmt") =3D \ - __builtin_constant_p(str) ? str : NULL; \ - \ - if (__builtin_constant_p(str)) \ - __trace_bputs(_THIS_IP_, trace_printk_fmt); \ - else \ - __trace_puts(_THIS_IP_, str); \ -}) -extern int __trace_bputs(unsigned long ip, const char *str); -extern int __trace_puts(unsigned long ip, const char *str); - -extern void trace_dump_stack(int skip); - -/* - * The double __builtin_constant_p is because gcc will give us an error - * if we try to allocate the static variable to fmt if it is not a - * constant. Even with the outer if statement. - */ -#define ftrace_vprintk(fmt, vargs) \ -do { \ - if (__builtin_constant_p(fmt)) { \ - static const char *trace_printk_fmt __used \ - __section("__trace_printk_fmt") =3D \ - __builtin_constant_p(fmt) ? fmt : NULL; \ - \ - __ftrace_vbprintk(_THIS_IP_, trace_printk_fmt, vargs); \ - } else \ - __ftrace_vprintk(_THIS_IP_, fmt, vargs); \ -} while (0) - -extern __printf(2, 0) int -__ftrace_vbprintk(unsigned long ip, const char *fmt, va_list ap); - -extern __printf(2, 0) int -__ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap); - -extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode); -#else -static inline void tracing_start(void) { } -static inline void tracing_stop(void) { } -static inline void trace_dump_stack(int skip) { } - -static inline void tracing_on(void) { } -static inline void tracing_off(void) { } -static inline int tracing_is_on(void) { return 0; } -static inline void tracing_snapshot(void) { } -static inline void tracing_snapshot_alloc(void) { } - -static inline __printf(1, 2) -int trace_printk(const char *fmt, ...) -{ - return 0; -} -static __printf(1, 0) inline int -ftrace_vprintk(const char *fmt, va_list ap) -{ - return 0; -} -static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { } -#endif /* CONFIG_TRACING */ - /* Rebuild everything on CONFIG_DYNAMIC_FTRACE */ #ifdef CONFIG_DYNAMIC_FTRACE # define REBUILD_DUE_TO_DYNAMIC_FTRACE diff --git a/include/linux/trace_printk.h b/include/linux/trace_printk.h new file mode 100644 index 000000000000..bb5874097f24 --- /dev/null +++ b/include/linux/trace_printk.h @@ -0,0 +1,204 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_TRACE_PRINTK_H +#define _LINUX_TRACE_PRINTK_H + +#include +#include +#include +#include + +/* + * General tracing related utility functions - trace_printk(), + * tracing_on/tracing_off and tracing_start()/tracing_stop + * + * Use tracing_on/tracing_off when you want to quickly turn on or off + * tracing. It simply enables or disables the recording of the trace event= s. + * This also corresponds to the user space /sys/kernel/tracing/tracing_on + * file, which gives a means for the kernel and userspace to interact. + * Place a tracing_off() in the kernel where you want tracing to end. + * From user space, examine the trace, and then echo 1 > tracing_on + * to continue tracing. + * + * tracing_stop/tracing_start has slightly more overhead. It is used + * by things like suspend to ram where disabling the recording of the + * trace is not enough, but tracing must actually stop because things + * like calling smp_processor_id() may crash the system. + * + * Most likely, you want to use tracing_on/tracing_off. + */ + +enum ftrace_dump_mode { + DUMP_NONE, + DUMP_ALL, + DUMP_ORIG, + DUMP_PARAM, +}; + +#ifdef CONFIG_TRACING +void tracing_on(void); +void tracing_off(void); +int tracing_is_on(void); +void tracing_snapshot(void); +void tracing_snapshot_alloc(void); + +extern void tracing_start(void); +extern void tracing_stop(void); + +static inline __printf(1, 2) +void ____trace_printk_check_format(const char *fmt, ...) +{ +} +#define __trace_printk_check_format(fmt, args...) \ +do { \ + if (0) \ + ____trace_printk_check_format(fmt, ##args); \ +} while (0) + +/** + * trace_printk - printf formatting in the ftrace buffer + * @fmt: the printf format for printing + * + * Note: __trace_printk is an internal function for trace_printk() and + * the @ip is passed in via the trace_printk() macro. + * + * This function allows a kernel developer to debug fast path sections + * that printk is not appropriate for. By scattering in various + * printk like tracing in the code, a developer can quickly see + * where problems are occurring. + * + * This is intended as a debugging tool for the developer only. + * Please refrain from leaving trace_printks scattered around in + * your code. (Extra memory is used for special buffers that are + * allocated when trace_printk() is used.) + * + * A little optimization trick is done here. If there's only one + * argument, there's no need to scan the string for printf formats. + * The trace_puts() will suffice. But how can we take advantage of + * using trace_puts() when trace_printk() has only one argument? + * By stringifying the args and checking the size we can tell + * whether or not there are args. __stringify((__VA_ARGS__)) will + * turn into "()\0" with a size of 3 when there are no args, anything + * else will be bigger. All we need to do is define a string to this, + * and then take its size and compare to 3. If it's bigger, use + * do_trace_printk() otherwise, optimize it to trace_puts(). Then just + * let gcc optimize the rest. + */ + +#define trace_printk(fmt, ...) \ +do { \ + char _______STR[] =3D __stringify((__VA_ARGS__)); \ + if (sizeof(_______STR) > 3) \ + do_trace_printk(fmt, ##__VA_ARGS__); \ + else \ + trace_puts(fmt); \ +} while (0) + +#define do_trace_printk(fmt, args...) \ +do { \ + static const char *trace_printk_fmt __used \ + __section("__trace_printk_fmt") =3D \ + __builtin_constant_p(fmt) ? fmt : NULL; \ + \ + __trace_printk_check_format(fmt, ##args); \ + \ + if (__builtin_constant_p(fmt)) \ + __trace_bprintk(_THIS_IP_, trace_printk_fmt, ##args); \ + else \ + __trace_printk(_THIS_IP_, fmt, ##args); \ +} while (0) + +extern __printf(2, 3) +int __trace_bprintk(unsigned long ip, const char *fmt, ...); + +extern __printf(2, 3) +int __trace_printk(unsigned long ip, const char *fmt, ...); + +/** + * trace_puts - write a string into the ftrace buffer + * @str: the string to record + * + * Note: __trace_bputs is an internal function for trace_puts and + * the @ip is passed in via the trace_puts macro. + * + * This is similar to trace_printk() but is made for those really fast + * paths that a developer wants the least amount of "Heisenbug" effects, + * where the processing of the print format is still too much. + * + * This function allows a kernel developer to debug fast path sections + * that printk is not appropriate for. By scattering in various + * printk like tracing in the code, a developer can quickly see + * where problems are occurring. + * + * This is intended as a debugging tool for the developer only. + * Please refrain from leaving trace_puts scattered around in + * your code. (Extra memory is used for special buffers that are + * allocated when trace_puts() is used.) + * + * Returns: 0 if nothing was written, positive # if string was. + * (1 when __trace_bputs is used, strlen(str) when __trace_puts is used) + */ + +#define trace_puts(str) ({ \ + static const char *trace_printk_fmt __used \ + __section("__trace_printk_fmt") =3D \ + __builtin_constant_p(str) ? str : NULL; \ + \ + if (__builtin_constant_p(str)) \ + __trace_bputs(_THIS_IP_, trace_printk_fmt); \ + else \ + __trace_puts(_THIS_IP_, str); \ +}) +extern int __trace_bputs(unsigned long ip, const char *str); +extern int __trace_puts(unsigned long ip, const char *str); + +extern void trace_dump_stack(int skip); + +/* + * The double __builtin_constant_p is because gcc will give us an error + * if we try to allocate the static variable to fmt if it is not a + * constant. Even with the outer if statement. + */ +#define ftrace_vprintk(fmt, vargs) \ +do { \ + if (__builtin_constant_p(fmt)) { \ + static const char *trace_printk_fmt __used \ + __section("__trace_printk_fmt") =3D \ + __builtin_constant_p(fmt) ? fmt : NULL; \ + \ + __ftrace_vbprintk(_THIS_IP_, trace_printk_fmt, vargs); \ + } else \ + __ftrace_vprintk(_THIS_IP_, fmt, vargs); \ +} while (0) + +extern __printf(2, 0) int +__ftrace_vbprintk(unsigned long ip, const char *fmt, va_list ap); + +extern __printf(2, 0) int +__ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap); + +extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode); +#else +static inline void tracing_start(void) { } +static inline void tracing_stop(void) { } +static inline void trace_dump_stack(int skip) { } + +static inline void tracing_on(void) { } +static inline void tracing_off(void) { } +static inline int tracing_is_on(void) { return 0; } +static inline void tracing_snapshot(void) { } +static inline void tracing_snapshot_alloc(void) { } + +static inline __printf(1, 2) +int trace_printk(const char *fmt, ...) +{ + return 0; +} +static __printf(1, 0) inline int +ftrace_vprintk(const char *fmt, va_list ap) +{ + return 0; +} +static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { } +#endif /* CONFIG_TRACING */ + +#endif --=20 2.43.0 From nobody Sat Feb 7 09:46:44 2026 Received: from mail-yw1-f174.google.com (mail-yw1-f174.google.com [209.85.128.174]) (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 28EC8279DAD for ; Thu, 25 Dec 2025 17:09:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766682584; cv=none; b=KP5y+1G+pRvkqUaj+IXiyHkBF8w5Feh0lIaQ2GeXr8yiDaPSnNN9Tqh6M1i4bVd5txePgoknOdInzZfeG4MAtyUUOtNhdeDGU/s+lkIDj1Uzm2h2TlltzHwU388xTIy5HuW2WnkKQO5gEqzwxMQyf7Xpa7JEP8MCNZ4ZeFymSSM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766682584; c=relaxed/simple; bh=CIfmlGwzCZIirY0nQrbTWhHiOTEhqkYiVt4nX91mNpk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=k6IhVCiiwACrPKYdp8yJJ1pphsL8quNDSQkl6T2NJ8hA4vEOLZalfrrwimBofxKDW8b39uqZ6e3CfU9dqysaqmiIM4OxHd76UXEZtINmAYpUaZ472LXEXF6y1b8BYYsVk6T9I63T0B3f9V6qPSrhrYBBbLfIn/eOIdOzQrgluoA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=deFHmnPY; arc=none smtp.client-ip=209.85.128.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="deFHmnPY" Received: by mail-yw1-f174.google.com with SMTP id 00721157ae682-78fc0f33998so40488227b3.0 for ; Thu, 25 Dec 2025 09:09:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766682580; x=1767287380; 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=o1XAl+rNLsSK7t9KsTmmNijZZcWjhCWFfFy06zE8YV0=; b=deFHmnPYQ2bmNAVehv0B3x+dJtiGULUc5aUF9cWB/TZ82UgbneG8d+z3z2HKxY+x9n fl5bh6FuipurtA+Rmztf513uhho8FSS7a5dwg4vvu7D6j0trCWpmqKbx1LmuOqnks2MI Q16WtYugEBDvE+69GkkZPVpgYsTuExtsalCVAWUvt+/8+1w0Y77E+YG8URDB6tFXayDZ /2qVrpFnhhbTKmWaPT6kuPbR/cnHD1onFjUwRRHTKGj8Aj6WVya7mQOCZI5zXmm/zkl2 bd+DU44ZLmbpEdySN9pgoT3Uf1YFN51/2wTMzTeQBHmVwN3EJJbrtSjgwUPF+SDSoBM1 tzyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766682580; x=1767287380; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=o1XAl+rNLsSK7t9KsTmmNijZZcWjhCWFfFy06zE8YV0=; b=e8rNAXlZgc0awlAoBQtjZzRAjjg+dHEmd/jbze/xorXD2b/oqVqJiMl+iue80PMsLV c94cJmrltZlLf8pULze8myCudpF0AQ0X2BJagRKLNonQazyokdg7bt0jxGz6003HExg2 baDH6mJyWzFGmz3XQdv/aXO2Q+L+DThPJ9BxhHVPuUpJzyUEw4HwUGVAGp95DnAHDOUi Am6WjzIQvkuDKyeD5TIF/Wc4kYVkk6OfnBSR3XwBxrBqW7IMVXcBjZ5gCp3zKtmBfG8p UQtICJDS/mH30t5d+c6wB1CoH03JyIGBJtEZ4XS7hnixO8TsIASJ0j4u7ZEIJdd+0Pbr yfJw== X-Forwarded-Encrypted: i=1; AJvYcCVZQWP3c9UYL4KGrRRy5+aGC/EjCOLKYoG94zwNfqa5Bz3MJcRm7EK/xxPOSQ7nh75pn8KCiM4uRSLRwZ4=@vger.kernel.org X-Gm-Message-State: AOJu0Yyrz214b/lEHI7o/NA8q/UmIFpNbGqCDKLuXRfvblHr2bY+nbdy jj/LvxCMAiJVHANQ/WJUmr/6zPtVwyYQfxSXD/okB4OtGPS8QMxSuP9p X-Gm-Gg: AY/fxX4P94x0oLJkseHU7udNfHpB9rFusIKda0rlTVjKB4tM7a/YWIOc6M67ro91oIV cFRfWqQbgVwFCnYaPBWLIinlfzbIJFw4tPdt/WpC3MvVM64EPka11Ril40XARFAcan9gWprFRMl kphM6Jp7To1vnuH13vD70TNF7v4vKp2BfypAjPvB3NgQYFiJUPyfzjKY3TQtSe9JbecbZXCVtva nDQDDb4hpbAFsnpMX2c40QXw3Nz5q+NVj7JMx/UyjvJywAL51hZwnY5mfjN3eOd1n7emM8X9TAw Fq8vQP/Of2sD12olIgDhAsygxqMoSmHKabByVHecysY6gWNIvTzv4T6+TV9KKYu5V+Tf6Tqbn1D Wh3w0b4AspLNmlDYP9obCEY+ppQdOjKNJ0p4CkQ+W9vHhvSytWe+yKY2KZtfVE3SgZzl0efVlf7 9+p0KEMcs= X-Google-Smtp-Source: AGHT+IF5dw6Hn/h74MWwA/S32fJlIZPljCF5eWLqPxwzMP1ymLvblq4azH8quaPTvyBsylujcP8/wA== X-Received: by 2002:a05:690c:6084:b0:787:badd:4c with SMTP id 00721157ae682-78fb3f520c6mr336407217b3.27.1766682579920; Thu, 25 Dec 2025 09:09:39 -0800 (PST) Received: from localhost ([2601:346:0:79bd:5a70:118b:3656:4527]) by smtp.gmail.com with ESMTPSA id 00721157ae682-78fb4373819sm76520067b3.7.2025.12.25.09.09.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Dec 2025 09:09:39 -0800 (PST) From: "Yury Norov (NVIDIA)" To: Steven Rostedt , Andrew Morton , Masami Hiramatsu , Mathieu Desnoyers , Andy Shevchenko , Christophe Leroy , Randy Dunlap , Ingo Molnar , Jani Nikula , Joonas Lahtinen , David Laight , Petr Pavlu , Andi Shyti , Rodrigo Vivi , Tvrtko Ursulin , Daniel Gomez , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-modules@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: "Yury Norov (NVIDIA)" Subject: [PATCH v4 7/7] kernel.h: drop trace_printk.h Date: Thu, 25 Dec 2025 12:09:29 -0500 Message-ID: <20251225170930.1151781-8-yury.norov@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251225170930.1151781-1-yury.norov@gmail.com> References: <20251225170930.1151781-1-yury.norov@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The trace_printk.h header is debugging-only by nature, but now it's included by almost every compilation unit via kernel.h. Removing trace_printk.h saves 1.5-2% of compilation time on my Ubuntu-derived x86_64/localyesconfig. There's ~30 files in the codebase, requiring trace_printk.h for non-debugging reasons: mostly to disable tracing on panic or under similar conditions. Include the header for those explicitly. This implicitly decouples linux/kernel.h and linux/instruction_pointer.h as well, because it has been isolated to trace_printk.h early in the series. Signed-off-by: Yury Norov (NVIDIA) --- arch/powerpc/kvm/book3s_xics.c | 1 + arch/powerpc/xmon/xmon.c | 1 + arch/s390/kernel/ipl.c | 1 + arch/s390/kernel/machine_kexec.c | 1 + drivers/gpu/drm/i915/gt/intel_gtt.h | 1 + drivers/gpu/drm/i915/i915_gem.h | 1 + drivers/hwtracing/stm/dummy_stm.c | 1 + drivers/infiniband/hw/hfi1/trace_dbg.h | 1 + drivers/tty/sysrq.c | 1 + drivers/usb/early/xhci-dbc.c | 1 + fs/ext4/inline.c | 1 + include/linux/kernel.h | 1 - include/linux/sunrpc/debug.h | 1 + kernel/debug/debug_core.c | 1 + kernel/panic.c | 1 + kernel/rcu/rcu.h | 1 + kernel/rcu/rcutorture.c | 1 + kernel/trace/error_report-traces.c | 1 + kernel/trace/ring_buffer_benchmark.c | 1 + kernel/trace/trace.c | 1 + kernel/trace/trace_benchmark.c | 1 + kernel/trace/trace_events_trigger.c | 1 + kernel/trace/trace_functions.c | 1 + kernel/trace/trace_printk.c | 1 + kernel/trace/trace_selftest.c | 1 + lib/sys_info.c | 1 + samples/fprobe/fprobe_example.c | 1 + samples/ftrace/ftrace-direct-modify.c | 1 + samples/ftrace/ftrace-direct-multi-modify.c | 1 + samples/ftrace/ftrace-direct-multi.c | 1 + samples/ftrace/ftrace-direct-too.c | 1 + samples/ftrace/ftrace-direct.c | 1 + samples/trace_printk/trace-printk.c | 1 + sound/hda/common/sysfs.c | 1 + 34 files changed, 33 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/book3s_xics.c b/arch/powerpc/kvm/book3s_xics.c index 589a8f257120..8f8cfc8648c6 100644 --- a/arch/powerpc/kvm/book3s_xics.c +++ b/arch/powerpc/kvm/book3s_xics.c @@ -20,6 +20,7 @@ #include =20 #include +#include =20 #include "book3s_xics.h" =20 diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index cb3a3244ae6f..f5cf6d807aeb 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -27,6 +27,7 @@ #include #include #include +#include =20 #include #include diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c index dcdc7e274848..55ac9c9eeb36 100644 --- a/arch/s390/kernel/ipl.c +++ b/arch/s390/kernel/ipl.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/s390/kernel/machine_kexec.c b/arch/s390/kernel/machine_ke= xec.c index baeb3dcfc1c8..668d8444b02b 100644 --- a/arch/s390/kernel/machine_kexec.c +++ b/arch/s390/kernel/machine_kexec.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/gpu/drm/i915/gt/intel_gtt.h b/drivers/gpu/drm/i915/gt/= intel_gtt.h index 9d3a3ad567a0..3f6d78a7ccea 100644 --- a/drivers/gpu/drm/i915/gt/intel_gtt.h +++ b/drivers/gpu/drm/i915/gt/intel_gtt.h @@ -22,6 +22,7 @@ #include #include #include +#include =20 #include =20 diff --git a/drivers/gpu/drm/i915/i915_gem.h b/drivers/gpu/drm/i915/i915_ge= m.h index 20b3cb29cfff..549fdeaf4508 100644 --- a/drivers/gpu/drm/i915/i915_gem.h +++ b/drivers/gpu/drm/i915/i915_gem.h @@ -27,6 +27,7 @@ =20 #include #include +#include =20 #include =20 diff --git a/drivers/hwtracing/stm/dummy_stm.c b/drivers/hwtracing/stm/dumm= y_stm.c index 38528ffdc0b3..8464401756f3 100644 --- a/drivers/hwtracing/stm/dummy_stm.c +++ b/drivers/hwtracing/stm/dummy_stm.c @@ -12,6 +12,7 @@ #include #include #include +#include #include =20 static ssize_t notrace diff --git a/drivers/infiniband/hw/hfi1/trace_dbg.h b/drivers/infiniband/hw= /hfi1/trace_dbg.h index 58304b91380f..d7c08190d816 100644 --- a/drivers/infiniband/hw/hfi1/trace_dbg.h +++ b/drivers/infiniband/hw/hfi1/trace_dbg.h @@ -8,6 +8,7 @@ =20 #include #include +#include =20 #include "hfi.h" =20 diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c index 1f78b0db3b25..72b2555c2bb8 100644 --- a/drivers/tty/sysrq.c +++ b/drivers/tty/sysrq.c @@ -51,6 +51,7 @@ #include #include #include +#include =20 #include #include diff --git a/drivers/usb/early/xhci-dbc.c b/drivers/usb/early/xhci-dbc.c index 41118bba9197..dce1e2a3e180 100644 --- a/drivers/usb/early/xhci-dbc.c +++ b/drivers/usb/early/xhci-dbc.c @@ -22,6 +22,7 @@ #include #include #include +#include =20 #include "../host/xhci.h" #include "xhci-dbc.h" diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index 1f6bc05593df..d15faa78eb07 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -9,6 +9,7 @@ #include #include #include +#include =20 #include "ext4_jbd2.h" #include "ext4.h" diff --git a/include/linux/kernel.h b/include/linux/kernel.h index a377335e01da..c48f7109bb2a 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -32,7 +32,6 @@ #include #include #include -#include #include #include =20 diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h index 891f6173c951..db2b572505f5 100644 --- a/include/linux/sunrpc/debug.h +++ b/include/linux/sunrpc/debug.h @@ -9,6 +9,7 @@ #ifndef _LINUX_SUNRPC_DEBUG_H_ #define _LINUX_SUNRPC_DEBUG_H_ =20 +#include #include =20 /* diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c index 0b9495187fba..e9209afc78aa 100644 --- a/kernel/debug/debug_core.c +++ b/kernel/debug/debug_core.c @@ -53,6 +53,7 @@ #include #include #include +#include =20 #include #include diff --git a/kernel/panic.c b/kernel/panic.c index 0d52210a9e2b..b9e1ff90c637 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include =20 diff --git a/kernel/rcu/rcu.h b/kernel/rcu/rcu.h index 9cf01832a6c3..1c8f5765ba8b 100644 --- a/kernel/rcu/rcu.h +++ b/kernel/rcu/rcu.h @@ -12,6 +12,7 @@ =20 #include #include +#include =20 /* * Grace-period counter management. diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 07e51974b06b..c2f859c20ca7 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -48,6 +48,7 @@ #include #include #include +#include =20 #include "rcu.h" =20 diff --git a/kernel/trace/error_report-traces.c b/kernel/trace/error_report= -traces.c index f89792c25b11..6a3c59f39ea2 100644 --- a/kernel/trace/error_report-traces.c +++ b/kernel/trace/error_report-traces.c @@ -7,5 +7,6 @@ =20 #define CREATE_TRACE_POINTS #include +#include =20 EXPORT_TRACEPOINT_SYMBOL_GPL(error_report_end); diff --git a/kernel/trace/ring_buffer_benchmark.c b/kernel/trace/ring_buffe= r_benchmark.c index 593e3b59e42e..b977ee0879c1 100644 --- a/kernel/trace/ring_buffer_benchmark.c +++ b/kernel/trace/ring_buffer_benchmark.c @@ -10,6 +10,7 @@ #include #include #include +#include #include =20 struct rb_page { diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 57f24e2cd19c..0684cc6b17c5 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -53,6 +53,7 @@ #include #include /* vmap_page_range() */ #include +#include =20 #include /* COMMAND_LINE_SIZE */ =20 diff --git a/kernel/trace/trace_benchmark.c b/kernel/trace/trace_benchmark.c index e19c32f2a938..740b49c493db 100644 --- a/kernel/trace/trace_benchmark.c +++ b/kernel/trace/trace_benchmark.c @@ -3,6 +3,7 @@ #include #include #include +#include =20 #define CREATE_TRACE_POINTS #include "trace_benchmark.h" diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_event= s_trigger.c index 06b75bcfc7b8..1c1420a4c429 100644 --- a/kernel/trace/trace_events_trigger.c +++ b/kernel/trace/trace_events_trigger.c @@ -12,6 +12,7 @@ #include #include #include +#include =20 #include "trace.h" =20 diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c index c12795c2fb39..ec725f8b2343 100644 --- a/kernel/trace/trace_functions.c +++ b/kernel/trace/trace_functions.c @@ -16,6 +16,7 @@ #include #include #include +#include =20 #include "trace.h" =20 diff --git a/kernel/trace/trace_printk.c b/kernel/trace/trace_printk.c index 29f6e95439b6..e49609c97496 100644 --- a/kernel/trace/trace_printk.c +++ b/kernel/trace/trace_printk.c @@ -16,6 +16,7 @@ #include #include #include +#include =20 #include "trace.h" =20 diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c index d88c44f1dfa5..b6aa5c92f079 100644 --- a/kernel/trace/trace_selftest.c +++ b/kernel/trace/trace_selftest.c @@ -6,6 +6,7 @@ #include #include #include +#include =20 static inline int trace_valid_entry(struct trace_entry *entry) { diff --git a/lib/sys_info.c b/lib/sys_info.c index f32a06ec9ed4..7ded4e7f3671 100644 --- a/lib/sys_info.c +++ b/lib/sys_info.c @@ -10,6 +10,7 @@ #include #include #include +#include =20 #include =20 diff --git a/samples/fprobe/fprobe_example.c b/samples/fprobe/fprobe_exampl= e.c index bfe98ce826f3..dfebb1cefb2c 100644 --- a/samples/fprobe/fprobe_example.c +++ b/samples/fprobe/fprobe_example.c @@ -17,6 +17,7 @@ #include #include #include +#include =20 #define BACKTRACE_DEPTH 16 #define MAX_SYMBOL_LEN 4096 diff --git a/samples/ftrace/ftrace-direct-modify.c b/samples/ftrace/ftrace-= direct-modify.c index da3a9f2091f5..cb6989f52167 100644 --- a/samples/ftrace/ftrace-direct-modify.c +++ b/samples/ftrace/ftrace-direct-modify.c @@ -2,6 +2,7 @@ #include #include #include +#include #if !defined(CONFIG_ARM64) && !defined(CONFIG_PPC32) #include #endif diff --git a/samples/ftrace/ftrace-direct-multi-modify.c b/samples/ftrace/f= trace-direct-multi-modify.c index 8f7986d698d8..1b24d53c34c2 100644 --- a/samples/ftrace/ftrace-direct-multi-modify.c +++ b/samples/ftrace/ftrace-direct-multi-modify.c @@ -2,6 +2,7 @@ #include #include #include +#include #if !defined(CONFIG_ARM64) && !defined(CONFIG_PPC32) #include #endif diff --git a/samples/ftrace/ftrace-direct-multi.c b/samples/ftrace/ftrace-d= irect-multi.c index db326c81a27d..3c94ecdaf3d5 100644 --- a/samples/ftrace/ftrace-direct-multi.c +++ b/samples/ftrace/ftrace-direct-multi.c @@ -4,6 +4,7 @@ #include /* for handle_mm_fault() */ #include #include +#include #if !defined(CONFIG_ARM64) && !defined(CONFIG_PPC32) #include #endif diff --git a/samples/ftrace/ftrace-direct-too.c b/samples/ftrace/ftrace-dir= ect-too.c index 3d0fa260332d..e4c26db202ce 100644 --- a/samples/ftrace/ftrace-direct-too.c +++ b/samples/ftrace/ftrace-direct-too.c @@ -3,6 +3,7 @@ =20 #include /* for handle_mm_fault() */ #include +#include #if !defined(CONFIG_ARM64) && !defined(CONFIG_PPC32) #include #endif diff --git a/samples/ftrace/ftrace-direct.c b/samples/ftrace/ftrace-direct.c index 956834b0d19a..01f3512aec50 100644 --- a/samples/ftrace/ftrace-direct.c +++ b/samples/ftrace/ftrace-direct.c @@ -3,6 +3,7 @@ =20 #include /* for wake_up_process() */ #include +#include #if !defined(CONFIG_ARM64) && !defined(CONFIG_PPC32) #include #endif diff --git a/samples/trace_printk/trace-printk.c b/samples/trace_printk/tra= ce-printk.c index cfc159580263..4fc58844aff1 100644 --- a/samples/trace_printk/trace-printk.c +++ b/samples/trace_printk/trace-printk.c @@ -2,6 +2,7 @@ #include #include #include +#include =20 /* Must not be static to force gcc to consider these non constant */ char *trace_printk_test_global_str =3D diff --git a/sound/hda/common/sysfs.c b/sound/hda/common/sysfs.c index f8c8483fd5e5..ac382f7063dc 100644 --- a/sound/hda/common/sysfs.c +++ b/sound/hda/common/sysfs.c @@ -19,6 +19,7 @@ #include "hda_local.h" #include #include +#include =20 /* hint string pair */ struct hda_hint { --=20 2.43.0