mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matt Domsch <Matt_Domsch@dell.com>
To: rusty@rustcorp.com.au, linux-kernel@vger.kernel.org
Subject: [RFC][PATCH 2.6.11-rc2] vmlinux: add SETUP_DESC() to describe __setup() options
Date: Mon, 31 Jan 2005 17:50:39 -0600	[thread overview]
Message-ID: <20050131235039.GD24164@lists.us.dell.com> (raw)

__setup() options are traditionally documented in
Documentation/kernel-parameters.txt.  However, it would be nice if
they could be documented alongside the implementation, similar to
MODULE_PARM_DESC() fields for modules, and if 'modinfo vmlinux' could
report such.

Patch below adds a new macro, SETUP_DESC(), which can be used to
document the use cases of __setup() options.  A usage example in
kernel/audit.c is provided as well.

$ modinfo vmlinux | grep setup_param
setup_param:    audit:0 = disable, 1 = enable (kernel/audit.c)

Feedback requested.

Thanks,
Matt

-- 
Matt Domsch
Software Architect
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com

===== include/linux/init.h 1.35 vs edited =====
--- 1.35/include/linux/init.h	2005-01-04 20:48:02 -06:00
+++ edited/include/linux/init.h	2005-01-31 17:22:41 -06:00
@@ -127,6 +127,15 @@
 		__attribute__((aligned((sizeof(long)))))	\
 		= { __setup_str_##unique_id, fn, early }
 
+#define __setup_cat(a) __setup_str_ ## a
+#define __SETUP_INFO(tag, name, info)					  \
+static const char __setup_cat(name)[]				          \
+  __attribute_used__							  \
+  __attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info " (" __FILE__ ")"
+
+#define SETUP_DESC(_parm, desc) \
+        __SETUP_INFO(setup_param, _parm, #_parm ":" desc)
+
 #define __setup_null_param(str, unique_id)			\
 	__setup_param(str, unique_id, NULL, 0)
 
@@ -202,6 +211,7 @@
 #define __setup_null_param(str, unique_id) 	/* nothing */
 #define __setup(str, func) 			/* nothing */
 #define __obsolete_setup(str) 			/* nothing */
+#define SETUP_DESC(_parm, desc)		        /* nothing */
 #endif
 
 /* Data marked not to be saved by software_suspend() */



===== kernel/audit.c 1.6 vs edited =====
--- 1.6/kernel/audit.c	2005-01-20 22:56:04 -06:00
+++ edited/kernel/audit.c	2005-01-31 15:55:43 -06:00
@@ -617,7 +617,7 @@
 }
 
 __setup("audit=", audit_enable);
-
+SETUP_DESC(audit, "0 = disable, 1 = enable");
 
 /* Obtain an audit buffer.  This routine does locking to obtain the
  * audit buffer, but then no locking is required for calls to

             reply	other threads:[~2005-02-01  0:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-31 23:50 Matt Domsch [this message]
2005-02-01  1:10 ` Rusty Russell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050131235039.GD24164@lists.us.dell.com \
    --to=matt_domsch@dell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome