Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752847AbZAEXvd (ORCPT ); Mon, 5 Jan 2009 18:51:33 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750849AbZAEXvW (ORCPT ); Mon, 5 Jan 2009 18:51:22 -0500 Received: from acsinet12.oracle.com ([141.146.126.234]:62917 "EHLO acsinet12.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750812AbZAEXvV (ORCPT ); Mon, 5 Jan 2009 18:51:21 -0500 Message-ID: <49629CCA.90405@oracle.com> Date: Mon, 05 Jan 2009 15:50:34 -0800 From: Randy Dunlap User-Agent: Thunderbird 2.0.0.18 (X11/20081112) MIME-Version: 1.0 To: Timur Tabi CC: lkml Subject: Re: Can kernel-doc process simple macros? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Source-IP: acsmt704.oracle.com [141.146.40.82] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090209.49629CD4.0049:SCFSTAT928724,ss=1,fgs=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1278 Lines: 35 Timur Tabi wrote: > How can I get kernel-doc to document a line like this: > > #define MY_CONSTANT 10 > > The documentation doesn't say anything about macros, but Google > searches imply that there is some support for macros in kernel-doc. kernel-doc supports macros that look like functions. E.g., from include/linux/kernel.h: /** * container_of - cast a member of a structure out to the containing structure * @ptr: the pointer to the member. * @type: the type of the container struct this is embedded in. * @member: the name of the member within the struct. * */ #define container_of(ptr, type, member) ({ \ const typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );}) However, it does not supports simple macros that are just value names like your example. But it does support enums, so you could possibly change the #defined values to enums and have kernel-doc for them. Or we could see what it would take to support simple macro values in kernel-doc... ~Randy -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/