lkml.org 
[lkml]   [2003]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject[PROPOSAL] MODULE_VERSION macro

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
-
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/

\
 
 \ /
  Last update: 2005-03-22 13:34    [W:0.034 / U:0.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site