From patchwork Sat Jan 6 05:01:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 185581 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp6616597dyb; Fri, 5 Jan 2024 21:01:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IHBCfgLI2XzVVMNcd/vjTpWPpWFYNfMJZ2MsHHHwnJoCI+zq/2FGRm5I2W4v4RLP4Ahu7h5 X-Received: by 2002:a05:6e02:170a:b0:35f:f8e8:6c11 with SMTP id u10-20020a056e02170a00b0035ff8e86c11mr977455ill.85.1704517318296; Fri, 05 Jan 2024 21:01:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704517318; cv=none; d=google.com; s=arc-20160816; b=SObhdUPTsxTq2U5FM84SfEJVdILIOz4dLew9jP4W5XrU5iXM91PVIfgvXgCA6bKHiA tkJHDbnnw54Q/hkTTJlxA6HDDm9/ucu573/cUGXg2eaNC5QAOez13QJ9+cJUD/j52Xrr O8wmMFcSIrrq2BrJ5ipWt9Fg9C8FJ6kzMiawL62123s9YzaZjzSyMGKUbvPs5IzEW4Qi PHLJ6X7b6Aa/nc6khlDFlR+9RwyuvqoVh+dFzWBYSd6PgQeXtzI3fRmzecxaD3ewO/k/ +pL9KdpHiAYfYbOUVzyArtWIbwjwya9CdYNAGVsGPg1iBZwKoYbes9i7wm1lnRr/prhy 2jww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=MJ0H78UHHZfBubPdCEmrW7qODFgKoeU0EZzyOmoW/vM=; fh=Gt5JS598BYSpTXO95MfIQFb7GsHjBSuareMMdhO+8I8=; b=K/W030Fr58c1L6TRKBHWN40o+qL6fTbMFyA4lOyX5QJXEcKLFHdJUWC+EK84M7QBO1 t4tBuH1RDG6dhI+PwbO9vJR/qW4bemOIV72/pHssh5NQyiiMn6hc0XqUlX+/PVnlWCwX 6So1YLWmXXhjOMtiznRnvress9/tfo30dz2x/LabOPNMV3303OKbEzjwwdL03Ue7xSZY JYDo1BOqceQaFmS+2Bo4fiHFScvgLljzepjiJL45erSCOy5iIUOKr7SCkqgOE7kCN1Fm hT/xzh4CpG5P3qaocdZJzU1Co37Yop/+4Ym0YqU6T7PMnO0YLqg1nRByPCOzpxQg68uR lePg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=oq33Yq4E; spf=pass (google.com: domain of linux-kernel+bounces-18482-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18482-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id c13-20020a65420d000000b005ce0bdac9casi2447459pgq.262.2024.01.05.21.01.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 21:01:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18482-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=oq33Yq4E; spf=pass (google.com: domain of linux-kernel+bounces-18482-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18482-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 10F68284217 for ; Sat, 6 Jan 2024 05:01:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AEEFE46A6; Sat, 6 Jan 2024 05:01:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="oq33Yq4E" X-Original-To: linux-kernel@vger.kernel.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 89F8B1FAA; Sat, 6 Jan 2024 05:01:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=MJ0H78UHHZfBubPdCEmrW7qODFgKoeU0EZzyOmoW/vM=; b=oq33Yq4ElkA+BHqzwYqustEj4b tqa5TEvg+HA8uQtsytTTiYzigHB2ANGce+l3Rl201FUkzEYnxDkIZ0o6RFgJM7pktQmQTnstlUg0L Cci+hCd20/am6dv0Y84tS9NAv60fKtb/sGyt+N8xI2eeB5Q4UBMfXdf5BF55uL13MVrr1TvJ3hhCg oY1bZ5E6m14cHIje0TT21Dc97QemBwpPBpuuWiGQKDElzU5LqWfVem4ePQ+GCe45h6lT0riNbBq+C vtkC3rp2bhDtk0G2ayvGzUNPjTrGW1eRYoQlAnmEGWzohxzxOfsiA44ERqqaeDg+td6aavdIb+sup m2Skevdw==; Received: from [50.53.46.231] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1rLyoU-000kGv-0R; Sat, 06 Jan 2024 05:01:38 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Jonathan Corbet , linux-doc@vger.kernel.org Subject: [PATCH] doc-guide: kernel-doc: tell about object-like macros Date: Fri, 5 Jan 2024 21:01:37 -0800 Message-ID: <20240106050137.6445-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787315951649487320 X-GMAIL-MSGID: 1787315951649487320 Since 2014 kernel-doc has supported describing object-like macros macros but it is not documented anywhere. I should have required some documentation for it when I merged the patch. :( There are currently only 3 uses of this (all in DRM headers, in include/drm/*.h). There have recently been a few other attempts at using kernel-doc for object-like macros, but they didn't use the "define" keyword and I mistakenly told them that kernel-doc does not support such documentation. :( again. Add object-like kernel-doc documentation now so that more may know about it and use it. Fixes: cbb4d3e6510b ("scripts/kernel-doc: handle object-like macros") Signed-off-by: Randy Dunlap Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org --- Documentation/doc-guide/kernel-doc.rst | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff -- a/Documentation/doc-guide/kernel-doc.rst b/Documentation/doc-guide/kernel-doc.rst --- a/Documentation/doc-guide/kernel-doc.rst +++ b/Documentation/doc-guide/kernel-doc.rst @@ -341,6 +341,27 @@ Typedefs with function prototypes can al */ typedef void (*type_name)(struct v4l2_ctrl *arg1, void *arg2); +Object-like macro documentation +------------------------------- + +Object-like macros are distinct from function-like macros. They are +differentiated by whether the macro name is immediately followed by a +left parenthesis ('(') for function-like macros or not followed by one +for object-like macros. + +Function-like macros are handled like functions by ``scripts/kernel-doc``. +They may have a parameter list. Object-like macros have do not have a +parameter list. + +The general format of an object-like macro kernel-doc comment is:: + + /** + * define object_name - Brief description. + * + * Description of the object. + */ + + Highlights and cross-references -------------------------------