From nobody Sat May 17 01:47:21 2025 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ZzmzG2FkYz5wh1S; Sat, 17 May 2025 01:47:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZzmzF6qCXz3HRD; Sat, 17 May 2025 01:47:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747446442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mMgJE5fTxizs1hVf4xrPIx1hQ5L7GONveJ0EGLAB84U=; b=R+/JCClp2UCOhqSIziWYs9JaoUsuOketAs1EWLDbowuMFmkBSC92zPHy37tY1gstgfWsS8 KzNtlevrfZlwQxAgDVudOeej5QRZ3eG2wCtqLw7t0iR0ZlaAI4lzWNqYWESFULALTm2rAv Aa+cjrrusXgQHg6NL3Wdq8VAuUPBhGq89YUMeoTsQ08vMW8TbxdPJJ/+ZxAaoZxFBBbn5k Plq66yuXTDtnTklmd25AUl6xeTRi738MwgUbGJcDKXgHNNkBYaa6sXsJce7mdW5OUuYSMr g6bD+ctduoureq3i8u9OPH1gYn6n2ezcanSZwWBA1gIRnCPNxbvUn1n6MTrJLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747446442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mMgJE5fTxizs1hVf4xrPIx1hQ5L7GONveJ0EGLAB84U=; b=TBwJ0vG7xqY6iFStrIdu+YPKbtzjFahDm2sBXAE2K+HAOxZYmB8VxlIIyUHPG7t8oFR0yo OuMxu7aWrO4Qzg/KNd30oGtMGNz1g8xNEaopsOtVkuHpAm3L5rSjTLsjqA4IX3lzLQqMJ7 NqyvL0XhzLaBv4w/IibkIpfbmElsA8Jlnk1QEIdD0LlOwTmMOsPP9VHluOAROWNtyr/QQd JAqM8NneD+/qE6U4cdtrlMX/EC3F1dyuMgzknv8p/ThbxfNDmf91BXy93WlgfJdO8Xz8UW aVYE3XI1ZbVHZ/vu5J3B/BgiGGms6mluSDTnDIeAFAEBCJ3TfASCUuMWljQ7OQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1747446442; a=rsa-sha256; cv=none; b=W2S2xVPanavuefbSDnBQgN2nSi0+j7t4/d3Qyed0545QguunKLbnd4v+QtACGeB3TRPdXk 2r4fkOI2N6bVzwQuzhzC1YkmDMTXSFjRMcSojK6+ux4u04euxXWeetORlYR8iSuVdFzU/X XZYYn1g6+eYzrtQqhLiN+qmorTwp1t9H6KzvFdaX/pnWVbU73scRDywmxOPnn4bECsAmlo UTNtVMbcaNLIWmW+0EgxHWhp0dY21k0J6QcOSS3dmZlsHn2NXgXe7TONhoqp6QKq8EWTD4 fOAnb24bKq0H1TT3ROwjWHZlFrqhdQM7dGlNXKa1N7vn6iiKB0UEOS/LyXqYFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ZzmzF6Lb1zCcS; Sat, 17 May 2025 01:47:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 54H1lLir034417; Sat, 17 May 2025 01:47:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 54H1lLId034414; Sat, 17 May 2025 01:47:21 GMT (envelope-from git) Date: Sat, 17 May 2025 01:47:21 GMT Message-Id: <202505170147.54H1lLId034414@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Ziaee Subject: git: 64a8c1930b8b - stable/14 - style: Recomend SPDX licenses List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 64a8c1930b8b74d05736bd9c022d5943343efd43 Auto-Submitted: auto-generated The branch stable/14 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=64a8c1930b8b74d05736bd9c022d5943343efd43 commit 64a8c1930b8b74d05736bd9c022d5943343efd43 Author: Alexander Ziaee AuthorDate: 2025-02-25 03:48:12 +0000 Commit: Alexander Ziaee CommitDate: 2025-05-17 01:45:56 +0000 style: Recomend SPDX licenses While here, take this opportunity to update the copyright and clean some mdoc errors. MFC after: 3 days Reviewed by: carlavilla, mhorne, imp Approved by: imp (srcmgr) Approved by: carlavilla, mhorne (mentors) Differential Revision: https://reviews.freebsd.org/D49051 (cherry picked from commit b3de609802104234dca7449fc2b4f4106098d41b) --- share/man/man9/style.9 | 41 ++++++++++++++++------------------------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index 59f0ff8b5c88..5542a9685c46 100644 --- a/share/man/man9/style.9 +++ b/share/man/man9/style.9 @@ -1,5 +1,5 @@ -.\"- -.\" Copyright (c) 1995-2022 The FreeBSD Project +.\" +.\" Copyright (c) 1995-2025 The FreeBSD Project .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -22,12 +22,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 13, 2024 +.Dd February 18, 2025 .Dt STYLE 9 .Os .Sh NAME .Nm style -.Nd "kernel source file style guide" +.Nd kernel source file style guide .Sh DESCRIPTION This file specifies the preferred style for kernel source files in the .Fx @@ -59,34 +59,24 @@ is silent on an issue. * them so they look like real paragraphs. */ .Ed +.Pp C++ comments may be used in C and C++ code. Single-line comments should be consistently either C or C++ within a file. Multi-line comments should also be consistently either C or C++, but may differ from single-line comments. .Pp -The copyright header should be a multi-line comment, with the first -line of the comment having a dash after the star like so: +The copyright header should be a multi-line comment like so: .Bd -literal -/*- - * SPDX-License-Identifier: BSD-2-Clause - * +/* * Copyright (c) 1984-2025 John Q. Public * - * Long, boring license goes here, but trimmed for brevity + * SPDX-License-Identifier: BSD-2-Clause */ .Ed .Pp -An automatic script collects license information from the tree for -all comments that start in the first column with -.Dq Li "/*-" . -If you desire to flag -.Xr indent 1 -to not reformat a comment that starts in the first column which is not a -license or copyright notice, change the dash to a star for those -comments. Comments starting in columns other than the first are never considered license statements. -Use the appropriate SPDX-License-Identifier line before the copyright. +Write the copyright lines before the appropriate SPDX-License-Identifier. If the copyright assertion contains the phrase .Dq Li "All Rights Reserved" that should be on the same line as the word @@ -132,11 +122,11 @@ Only add in front of foreign VCS IDs if the file is renamed. Add .Dq Li "From: " -and FreeBSD git hash with full path name if the file was derived -from another FreeBSD file and include relevant copyright info -from the original file. -.Bd -literal -.Ed +and the +.Fx +git hash with full path name if the file was derived from another +.Fx +file and include relevant copyright info from the original file. .Pp Leave one blank line before the header files. .Pp @@ -923,7 +913,8 @@ When using branch prediction hints, atypical error conditions should use (document the exceptions). Operations that almost always succeed use .Fn __predict_true . -Only use the annotation for the entire if statement, rather than individual clauses. +Only use the annotation for the entire if statement, +rather than individual clauses. Do not add these annotations without empirical evidence of the likelihood of the branch. .Sh FILES