From patchwork Tue Feb 13 14:30:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 200445 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp575319dyb; Tue, 13 Feb 2024 06:31:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IHTdtneRskyBfdyOYFhrfT5r7yoFGjPg3Rk7b7EbBRpo+OzLUGJcr0Qa1bCOsm+FMdT7QAa X-Received: by 2002:a17:906:f2cb:b0:a35:42e0:b96d with SMTP id gz11-20020a170906f2cb00b00a3542e0b96dmr8986826ejb.57.1707834673033; Tue, 13 Feb 2024 06:31:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707834673; cv=pass; d=google.com; s=arc-20160816; b=k30HSynfunTNOp2K7FpIHwJaHMXaha736UQ+72jBM6gd8KjR6fFnXYAlL3r3NrErPT C3jfBbEDJOR3UTwDQQ2cAzsszKSnXOo5EWx8a3U1hvPbLVk7kiio6DFBQYtDCn5AosZF GUYsm2k838ZRuEtNlGbNVqTPQyHWRdUGF1uPkQoynBtMh8nPR8tVWlQ89fIZDpKB705H BRrel8W18XrbqDR1KAaj6XgpnUdV4GxulCv6n6JXNOGVKAdUspMUoxT8VU3aRp/6j8XY MtlVRyQVg26isOisw4szVa+UdOLQrZ/aKtwY1fcQ3eCG+F0nY9h77Utr7sBwgBKBU6Fr AE6Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=g07uhJRgsO8dhPnSV6zio+HFjoQMa4U7iOiNbyMNWYg=; fh=ZMo/KInoM8IxIQEMAW/IluKwIBdO8V2yVsZcUBXXvm0=; b=KO2STzpHhvxtswBYkZoNWhWfOkNi8odWO7rpDL7Nr5QiT1p9xXAaAMha1ls1VPWBNX NiiHbHHWP1z2bWG4EXbcis2Gn5+C73BHSRX7pkEudc2fcRLrkKTR7mos3IBpEEa385pj /7UfasjnIq4G7lC8p1aEH3qD3Onfiax95SaWOFRnIPMTa6Z+quDxWxEOP7fRTLec9Shp J9YDdOO9Va+HqXd4M533jheL4N5PBSv5i4uPyzdcjsIz0K1BS/IaEOU1IpegkBQ0vONo CCRpVViyp2+okIpykwxXWaw/micognptlyUO7Y6xqGwxiPxKf2aygilKvd6JK6nI0WEJ ciJQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ZNSeHLKk; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=66robOIf; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-63680-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63680-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de X-Forwarded-Encrypted: i=2; AJvYcCXZZK6JG6BGCWOpKjV6A9P40Rdk1KAS7KKXNUrcM7ar7aP5nY/6uCxSaAgMeZqMGZnKdStzgZAdyEDGbVbxgRvlaLE7FQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id hd20-20020a170907969400b00a3843b05d16si1389979ejc.596.2024.02.13.06.31.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 06:31:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63680-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ZNSeHLKk; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=66robOIf; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-63680-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63680-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 am.mirrors.kernel.org (Postfix) with ESMTPS id A0C541F25CD3 for ; Tue, 13 Feb 2024 14:31:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1DF6657884; Tue, 13 Feb 2024 14:30:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ZNSeHLKk"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="66robOIf" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8050865F; Tue, 13 Feb 2024 14:30:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707834650; cv=none; b=OUvDSnrxWd15MdlNa3biPWBGYYmEx4wsiUZkX7vk0hyRGnjCB90dllWlV8bZLEwPzb1wUg9jIlJeejJjdc/1EA8zDjxz5yZz3w20iac8gxVM5fsxdTmvodlQj3AASwRjXWaNuGnzEwtEI82S8BJ3jI2kHt0GMO1HrvA1Sfr3/3Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707834650; c=relaxed/simple; bh=c9rRowDIABkZ6H4WTk42Hcfmhnp+h138c7zkGcSRjiM=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=jb8dBQC4bvwnWKEf7labjaXFvJDXeMzVnhirLyVQppMw3qio/fHGc0vQ17fJ+iCEZmpmKrrzx28ZW5yswHqxiOX/TZXHrcf290QuK8yoqGhLdDBnJHKUub3TsFr0aG9wQ0slR60EJlY/vA3wIkjMkQyrUVqgkEQSyphW9ntOVME= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ZNSeHLKk; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=66robOIf; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Tue, 13 Feb 2024 14:30:45 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1707834646; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g07uhJRgsO8dhPnSV6zio+HFjoQMa4U7iOiNbyMNWYg=; b=ZNSeHLKkXPH7O7g/qYuw4CTjxqSmysbGaiGJ+e8Lt5+TZOg/9wE1PPe4NLTplvfp0JXvze 9/gidJwRC9nV80eD8iLYgNVLFuiQJjR76WK2nAgJd9u5zqIy/HOH8I8vaOo0h7Kw2G00lm Rz7X0FHef6Ce9pYsZ9LOthlZ18FfSRObBUeY8KQqQzF9NDDZb5dNUyEllREg+BDZWcojx9 loFvRMVXY4oqyRAftwPMfFeQYC6x+gxbKnCw08cgf9rnDm4u8Gxj5UgjSsRN1iMTlnZFjI GhMiWZNdtfR4fj10DSrh2G0ZciO+5gFJIlVahsTV9wsj2u33QMT8qechOK1Y7Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1707834646; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g07uhJRgsO8dhPnSV6zio+HFjoQMa4U7iOiNbyMNWYg=; b=66robOIfivDYq6Loc4ftjAt2jjC7AV1tFED5PgmPr2UaZiyJNEF6/gbtWA1STU48bOU/a0 sOVpJbb1hAvOcVAg== From: "tip-bot2 for Borislav Petkov (AMD)" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/misc] Documentation/maintainer-tip: Add C++ tail comments exception Cc: "Borislav Petkov (AMD)" , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240130193102.GEZblOdor_bzoVhT0f@fat_crate.local> References: <20240130193102.GEZblOdor_bzoVhT0f@fat_crate.local> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170783464515.398.17242273988924436595.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790794449769126168 X-GMAIL-MSGID: 1790794449769126168 The following commit has been merged into the x86/misc branch of tip: Commit-ID: 7dd0a21ccb5a937ca9f798afad34de4ba030f8d4 Gitweb: https://git.kernel.org/tip/7dd0a21ccb5a937ca9f798afad34de4ba030f8d4 Author: Borislav Petkov (AMD) AuthorDate: Mon, 12 Feb 2024 16:41:42 +01:00 Committer: Borislav Petkov (AMD) CommitterDate: Tue, 13 Feb 2024 13:19:40 +01:00 Documentation/maintainer-tip: Add C++ tail comments exception Document when C++-style, tail comments should be used. Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Thomas Gleixner Link: https://lore.kernel.org/r/20240130193102.GEZblOdor_bzoVhT0f@fat_crate.local --- Documentation/process/maintainer-tip.rst | 30 ++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/Documentation/process/maintainer-tip.rst b/Documentation/process/maintainer-tip.rst index 7993592..497bb39 100644 --- a/Documentation/process/maintainer-tip.rst +++ b/Documentation/process/maintainer-tip.rst @@ -480,7 +480,7 @@ Multi-line comments:: * Larger multi-line comments should be split into paragraphs. */ -No tail comments: +No tail comments (see below): Please refrain from using tail comments. Tail comments disturb the reading flow in almost all contexts, but especially in code:: @@ -501,6 +501,34 @@ No tail comments: /* This magic initialization needs a comment. Maybe not? */ seed = MAGIC_CONSTANT; + Use C++ style, tail comments when documenting structs in headers to + achieve a more compact layout and better readability:: + + // eax + u32 x2apic_shift : 5, // Number of bits to shift APIC ID right + // for the topology ID at the next level + : 27; // Reserved + // ebx + u32 num_processors : 16, // Number of processors at current level + : 16; // Reserved + + versus:: + + /* eax */ + /* + * Number of bits to shift APIC ID right for the topology ID + * at the next level + */ + u32 x2apic_shift : 5, + /* Reserved */ + : 27; + + /* ebx */ + /* Number of processors at current level */ + u32 num_processors : 16, + /* Reserved */ + : 16; + Comment the important things: Comments should be added where the operation is not obvious. Documenting