Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp375218rdd; Tue, 9 Jan 2024 07:00:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IF1sZIKjQ/hIAA4fvMwnTNPWZx8xPpbknPX0XIJNzp3eKs+ppFtsePDq8PpQrE4fsc7QuSd X-Received: by 2002:a50:c341:0:b0:557:9ecf:cac3 with SMTP id q1-20020a50c341000000b005579ecfcac3mr1218349edb.75.1704812410242; Tue, 09 Jan 2024 07:00:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704812410; cv=none; d=google.com; s=arc-20160816; b=emHhYMNryCxh3e2KuM0hXKFiTCqDn/RC8RCUTUP1v7H37u3/KjSuNzxRclRaMzLVu4 z8z2WgmJ0OXY7qeEzt5RkEtOnCdJkArW/K2A4hQHIBwLH9DaSCCRv1BuKqtzstbNNFyN UBv9Arb0yq9EIkZDpmpwFbUMMhoWRtYfVRDPVQizyleA1QM1YXRcgJxzin2K9QCPghWN r+Ee2H4mrDjnq1s73RkUNMuy5IzlNWoAGn27n2O3jUTE6iRBwxfsCDL+UDPlAFipwALw oBRgLfRNPyub8uj/ntTKm5LvrJsL2ErALFnxB5qWOQqUQ0kwdVZRKWyvilagtpV08CPE 6gvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=RyKP7ndLV+Kcpm0EuaGv/5soSY6fBfB2g6ZMXyiQm6w=; fh=kxOFByF/nVJ70qT9HQS2rIaqqtWjf14R5G2nx2hqoDg=; b=pnfGhWcYtaUZVe+o/YUHB2HWVPT+rbeV+PGrDtn2HkIL4s1F4VaIA4yhKxu2vcWX6h 54ho95yPo1qtXc8pB88OVmSaaFoaI9Kq0oveJ2lTlRlNzLx568tMX0ZhtxhDeQDTWDQg EkeWXsL3FpsX4N8zTgVBOwhO67z4oJxQGwQrMwJN1hhc90BR2lbAKi3XVl3A7z79hn2P ceahhlBVAvF27QAPNypX+5S+MLXwodQsn1YtNTIbPf8y1WORDRcnm01KfQgyGj7JqhYB gq9k1QEq+BTMIRoD4YFvyV6IqBEHXoeWBrilG3yGbp6SUgwrQj1uK7QEfGCKB+WvU4M7 YNIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VoQnDp0G; spf=pass (google.com: domain of linux-kernel+bounces-21019-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21019-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id cy26-20020a0564021c9a00b0055490e36565si840572edb.55.2024.01.09.07.00.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 07:00:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21019-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=@gmail.com header.s=20230601 header.b=VoQnDp0G; spf=pass (google.com: domain of linux-kernel+bounces-21019-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21019-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 019641F25842 for ; Tue, 9 Jan 2024 15:00:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 05BF039AEC; Tue, 9 Jan 2024 15:00:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VoQnDp0G" Received: from mail-oa1-f50.google.com (mail-oa1-f50.google.com [209.85.160.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D49B12C865; Tue, 9 Jan 2024 15:00:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oa1-f50.google.com with SMTP id 586e51a60fabf-2053f5e97b2so2079932fac.3; Tue, 09 Jan 2024 07:00:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704812400; x=1705417200; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=RyKP7ndLV+Kcpm0EuaGv/5soSY6fBfB2g6ZMXyiQm6w=; b=VoQnDp0GgrI+Rfv70IoMhZc7Qy2b79/qoAQmtD030f9YlewByUb9KRxI+bhp0OIbsA ywX/httSYheMLVkEDvMs94IOQUQHHwmcEMRNf3GFdM+QUc2SFPQFLsZ58fUIu0f116+W 5zeG0fJ0Xs3h3xD0XH302jceryTm40oyC+9vMX8nF4MHPXv5W8vmD5aphNlyRMCgQurD irt+jNBdBA3tEVJlxhUdYPgS7OS7Pzi8RUywVdvgSgVAyh+wltMZrGEaGfdAXoqZ2vEZ NI0n3qUJve7gH27bIRtITtSFbMuziRIZUAu/b46RLbMDTq1DNTm7TR5SFJ3gUpOANpG+ adYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704812400; x=1705417200; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RyKP7ndLV+Kcpm0EuaGv/5soSY6fBfB2g6ZMXyiQm6w=; b=BdOKRl4wm/IWHPX4wlj78pY+p1L1emlydYGus5x6NOXn3AQnHnvKEjVeNQz04ZCsd4 hfbtwRFT554DraFAcrEcwriGUg++9cGZZw+pVjRsQE4C58iOl02Pa6S8AaZUTCuVUdOm ouPcEbBLDMZxgZPlhO1Opd3OsGkD/DOXYWM5+MxoX00pYNnG6S53ie+PWBFDvlde4hqc 0UCIZczjFSY+4+Xs4NcBWNH7iAc8YeUL+xDOle3qeYtWhFY15ehQmAJDI8u5aNeI18/n zR/zm5nIUvZNo+ORirm19XWZOKwi1C3aDRonophMPl5SAVW2hl+p3StHTCIUvSLomDEI KCcw== X-Gm-Message-State: AOJu0Yw+nDomnOSir6viO69X8FaRNy4N5fong6yVdb1Kf/iELCJ+cVg4 S0FUrwJGaUHNBUc5KRzATfk6RWKu9R3zXEbUWQw= X-Received: by 2002:a05:6871:8009:b0:204:1590:2044 with SMTP id sk9-20020a056871800900b0020415902044mr7142787oab.5.1704812399799; Tue, 09 Jan 2024 06:59:59 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240109140345.3344094-1-daniel.vetter@ffwll.ch> In-Reply-To: <20240109140345.3344094-1-daniel.vetter@ffwll.ch> From: Alex Deucher Date: Tue, 9 Jan 2024 09:59:48 -0500 Message-ID: Subject: Re: [PATCH] kernel-doc: document object-like preprocessor macros To: Daniel Vetter Cc: LKML , Jonathan Corbet , DRI Development , Randy Dunlap , linux-doc@vger.kernel.org, Maxime Ripard , "Steven Rostedt (Google)" , Thomas Zimmermann , Daniel Vetter Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jan 9, 2024 at 9:16=E2=80=AFAM Daniel Vetter wrote: > > I had no idea this exists, but Randy pointed out it's been added quite > a long time ago in cbb4d3e6510b ("scripts/kernel-doc: handle > object-like macros"). Definitely way before I started to write all the > drm docs sadly, so there's a few things where I skipped writing > kernel-doc since I didn't know it was possible. > > Fix this asap by documenting the two possible kernel-doc flavours for > preprocessor definitions. > > References: https://lore.kernel.org/dri-devel/dd917333-9ae8-4e76-991d-39b= 6229ba8ce@infradead.org/ > Cc: Randy Dunlap > Cc: Thomas Zimmermann > Cc: Maxime Ripard > Cc: Daniel Vetter > Cc: "Steven Rostedt (Google)" > Cc: Jonathan Corbet > Cc: linux-doc@vger.kernel.org > Signed-off-by: Daniel Vetter News to me as well. Acked-by: Alex Deucher > --- > Documentation/doc-guide/kernel-doc.rst | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) > > diff --git a/Documentation/doc-guide/kernel-doc.rst b/Documentation/doc-g= uide/kernel-doc.rst > index 6ad72ac6861b..a966f1fd5c30 100644 > --- a/Documentation/doc-guide/kernel-doc.rst > +++ b/Documentation/doc-guide/kernel-doc.rst > @@ -341,6 +341,32 @@ Typedefs with function prototypes can also be docume= nted:: > */ > typedef void (*type_name)(struct v4l2_ctrl *arg1, void *arg2); > > +Preprocessor defines documentation > +---------------------------------- > + > +There are two ways to document preprocessor defines. The first works mor= e or > +less like kernel-doc for functions, including parameters:: > + > + /** > + * FUNC_NAME() - Brief description > + * @arg1: description of arg1 > + * @arg2: description of arg2 > + * > + * Description of the preprocessor function, may have multiple paragra= phs. > + */ > + #define FUNC_NAME(arg1, arg2) > + > +The second type is different and for object-like preprocessor macros wit= hout any > +parameters:: > + > + /** > + * define MACRO - Brief description > + * > + * Description of the object-like preprocessor macro, may have multipl= e > + * paragraphs. > + */ > + #define MACRO > + > Highlights and cross-references > ------------------------------- > > -- > 2.43.0 >