mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PROPOSAL] MODULE_VERSION macro
@ 2003-03-27 20:14 Matthew Wilcox
  2003-03-28  0:25 ` Rusty Russell
  0 siblings, 1 reply; 2+ messages in thread
From: Matthew Wilcox @ 2003-03-27 20:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: Rusty Russell


A common question one needs to ask is "What version of that driver are
you using?".  It's not always immediately obvious where to find that
information, even if you have the source in front of you.  Some examples..

drivers/net/tulip/tulip_core.c:18:#define DRV_VERSION      "1.1.13"
drivers/net/e100/e100_main.c:140:char e100_driver_version[]="2.1.29-k4";
drivers/scsi/sym53c8xx.c:88:#define SCSI_NCR_DRIVER_NAME "sym53c8xx-1.7.3c-20010512"
drivers/scsi/aic7xxx_old.c:256:#define AIC7XXX_C_VERSION  "5.2.6"
drivers/serial/8250.c:2159:MODULE_DESCRIPTION("Generic 8250/16x50 serial driver $Revision: 1.90 $");

And I'm sure there are worse examples.  My proposal is simple:

#define MODULE_VERSION(version) \
	static const char __module_version[] \
		__attribute__((section(".init.version"), unused)) = version

and add the .init.version section to vmlinux.lds in the `freed after
init' section.

The tools can catch up to use this kind of thing later; we need to
standardise the source code to use this first.

-- 
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-03-28  0:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-27 20:14 [PROPOSAL] MODULE_VERSION macro Matthew Wilcox
2003-03-28  0:25 ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®