Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp534576rdb; Fri, 5 Jan 2024 21:01:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IGeZlEOw/YCa/QriK5gcRR/QMx43dR2rzjYsHYVxaA0a9S3/BNZep6jtRPje4Hs4r8hoSBa X-Received: by 2002:a05:600c:434b:b0:40c:26a3:d778 with SMTP id r11-20020a05600c434b00b0040c26a3d778mr150471wme.208.1704517311311; Fri, 05 Jan 2024 21:01:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704517311; cv=none; d=google.com; s=arc-20160816; b=u/G1srunfAwYSA897AVPKeuud4eq6cKg/z3SgQjPIVQTu+E8pWHFU6mjyZvFHq3tv/ UOxiE9ur3edFKCsLROGhHTzy8doY1664QHmi/xaX0qieF2w4/WmT66Tq2pnan8rEJdpA nR1hLMHSBzzkS/SB6V+0FO8JOksXqVBs783zZq3fiQxvtAbevtTVGXO3GVcSe2XXkDkQ +buZ0NwG9KeVp4c/ye3FiW8YymTMCEQvipByFjqeGlgQ0lmpjveyZVh+8sNXRnPZgGlw Imp778kkM1VcpJtJaSRep5YgVt5BEP9QxAyRrkYcHB5bTPVZgGH+NkK3Z17IwF/+PDR/ GF3g== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18482-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id f6-20020a170906560600b00a27ba441025si1129078ejq.167.2024.01.05.21.01.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 21:01:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18482-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18482-linux.lists.archive=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 085D61F23ACC for ; Sat, 6 Jan 2024 05:01:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C44C43C0B; Sat, 6 Jan 2024 05:01:43 +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 Content-Transfer-Encoding: 8bit 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 -------------------------------