From nobody Tue Feb 25 04:04:26 2025 X-Original-To: dev-commits-src-main@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 4Z23rp5sMZz5pNSb; Tue, 25 Feb 2025 04:04:26 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z23rp5Jbxz41tw; Tue, 25 Feb 2025 04:04:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740456266; 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=mDSDM/V/wO3EsZLMPOWz4giiaK1VXI6ZEFeKjBpnIx8=; b=U9zelaQ7i3XLwK4JXLtEjoiCIW6ttgiu/q4gl0F5iN0oP71kjNGpUytg1bTOS5+sOsFLFt RNEBOaSF9WCWE8zaTncF+fD6JY7sSlVYiQfupo+IT2Kens/drMhjrCIz0D10Y3+T03PGuA U9N8/3yXgTotSIpP+v1MbWMAKO89V94iARAx1+wQG6VtU3IkmVMSoTJsbjNQxk3jLKFSBe rQv5bVRwVXObbhB7DYueFcSwj3v9TEsOfQuKdiOrxQkaCEcZ01D+2A4e/MJVqzL77ZjMVM AAoxwx6F7e2b+mwULe47MU9lTQzD8ERoU/Yi4eEbFcNW3uPTfChBBbG3uO52Nw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740456266; a=rsa-sha256; cv=none; b=jV+LoeYMRDOG1giJ4kX3vXXOBLchw6GSD1uIPAvwS+MrSEnm3wZ4As7VHLKMJ27cd93QRb LKd5LQ0k7bxHRhNGQ4VXfyFPhOf3Uj+59N3hxwm9DGy7ZFuLYtq5Qy+Hk6cjDhvbbISDlY OFqYoJxXweT00ASo3uknlNaFbIVzvucRMvt8bopfECnMp9A9FfSMR1cQ4YpzskC45vEOqE 9pGKxGwGscG+bcyAJ0tUo2rCM//6WOuGetOpAO0g469AqzedD5QHk6cf5NKovENX9dQ9iH BEgI2bWDCxU+Zqqey0UItvpQ/IJ5khBtwxuQ2FLG7dqWVva84E6K9Eug7hFQnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740456266; 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=mDSDM/V/wO3EsZLMPOWz4giiaK1VXI6ZEFeKjBpnIx8=; b=cBxvEGpHve1yR6/ejLqab9npmcR+45SU2sgSBYN4Uj1Hzb+OW7ruvdHwxiLyFPly90M+jg +YZLS7GebbVJ0TUIqVsbUdnG2DPCglHwNqfFd4CaPPouHw9uZSEU9CjiWm6s8EghnnHC6s kxGjqN6NwdQyTqXnJFfhiVVJgEFJJOII/fSh9yxddPm3+gN5khgV/rZeIsuvXZdIICqBvp KKcMHd7VoaPVnm94EvxJEK/J9GdcblbqMebVarbjGBI0m5QpT+hAPwJfWXbIr+83kJNnde RiKuYBSO3hfkEGClQPbU+NkMFl8KF/P5/4yo5YOIafm+Q2sPuEXI/BH/b71P+g== 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 4Z23rp4mWrz18r6; Tue, 25 Feb 2025 04:04:26 +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 51P44QeU091677; Tue, 25 Feb 2025 04:04:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51P44Qdi091674; Tue, 25 Feb 2025 04:04:26 GMT (envelope-from git) Date: Tue, 25 Feb 2025 04:04:26 GMT Message-Id: <202502250404.51P44Qdi091674@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: b3de60980210 - main - style: Recomend SPDX licenses List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: b3de609802104234dca7449fc2b4f4106098d41b Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=b3de609802104234dca7449fc2b4f4106098d41b commit b3de609802104234dca7449fc2b4f4106098d41b Author: Alexander Ziaee AuthorDate: 2025-02-25 03:48:12 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-25 03:48:24 +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 --- 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 0e766840c9ee..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 3, 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