Skip to contentSkip to conversation

iwlwifi: remove generated/utsrelease.h dependency

PATCH In review Zhu Yi 5 participants 6 messages Dec 24, 2009 – Jan 6, 2010 Networking drivers (wireless)

lore
Share & tools
lore

Zhu Yi

author
#0 lore raw

PATCH 1/1 iwlwifi: remove generated/utsrelease.h dependency

Commit 900bb717424e5df12b1ef7ebb017be2a8915b806 uses UTS_RELEASE as the the in-tree iwlwifi driver version. However the inclusion of generated/utsrelease.h makes it a unpleasant behaviour to recompile the driver everytime when utsrelease.h is updated. In fact, the driver module is already built with the UTS_RELEASE information via vermagic of modinfo. Mark the in-tree driver with the version string "in-tree" to distinguish with those old out-of-tree drivers.

---
 drivers/net/wireless/iwlwifi/iwl-core.h |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/net/wireless/iwlwifi/iwl-core.h +1 -3
index 308f679..375226b 100644
@@ -63,8 +63,6 @@
 #ifndef __iwl_core_h__
 #define __iwl_core_h__
 
-#include <generated/utsrelease.h>
-
 /************************
  * forward declarations *
  ************************/
@@ -72,7 +70,7 @@ struct iwl_host_cmd;
 struct iwl_cmd;
 
 
-#define IWLWIFI_VERSION UTS_RELEASE "-k"
+#define IWLWIFI_VERSION "in-tree:"
 #define DRV_COPYRIGHT	"Copyright(c) 2003-2009 Intel Corporation"
 #define DRV_AUTHOR     "<[email protected]>"
 
Signature · 1 line
1.6.3.3
#1 lore raw
Quoted 29 lines · Zhu Yi

Commit 900bb717424e5df12b1ef7ebb017be2a8915b806 uses UTS_RELEASE as the the in-tree iwlwifi driver version. However the inclusion of generated/utsrelease.h makes it a unpleasant behaviour to recompile the driver everytime when utsrelease.h is updated. In fact, the driver module is already built with the UTS_RELEASE information via vermagic of modinfo. Mark the in-tree driver with the version string "in-tree" to distinguish with those old out-of-tree drivers.

---
 drivers/net/wireless/iwlwifi/iwl-core.h |    4 +---

 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/net/wireless/iwlwifi/iwl-core.h +0 -2
index 308f679..375226b 100644
@@ -63,8 +63,6 @@
  #ifndef __iwl_core_h__
  #define __iwl_core_h__
 
-#include <generated/utsrelease.h>
-
  /************************
  * forward declarations *
  ************************/

drivers/net/wireless/iwlwifi/iwl-core.h struct iwl_host_cmd; · line 75

Quoted 7 lines
drivers/net/wireless/iwlwifi/iwl-core.h +1 -1
@@ -72,7 +70,7 @@ struct iwl_host_cmd;
  struct iwl_cmd;
 
 
-#define IWLWIFI_VERSION UTS_RELEASE "-k"
+#define IWLWIFI_VERSION "in-tree:"
  #define DRV_COPYRIGHT  "Copyright(c) 2003-2009 Intel Corporation"
  #define DRV_AUTHOR     "<[email protected]>"

Why is a version even needed?

Luis

author
#2 lore raw

RnJvbTogTHVpcyBSLiBSb2RyaWd1ZXogW21haWx0bzptY2dyb2ZAZ21haWwuY29tXSANCg0KPiBX aHkgaXMgYSB2ZXJzaW9uIGV2ZW4gbmVlZGVkPw0KDQpUaGUgcmVhc29uIGlzIHdlIHdhbnQgdG8g Z2V0IHRoZSBkcml2ZXIgY29uZmlnIG9wdGlvbnMgZWFzaWx5IGZyb20gYSBidWcgcmVwb3J0LiBG b3INCmV4YW1wbGUsIENPTkZJR19JV0xXSUZJX0RFQlVHLCBTUEVDVFJVTV9NRUFTVVJFTUVOVCwg ZXRjLiBTb21ldGltZXMgdGhleQ0KYXJlIG5vdCB2ZXJ5IGVhc3kgdG8gdGVsbCBmb3IgYW4gT1NE IHByb3ZpZGVkIGRyaXZlci4NCg0KVGhhbmtzLA0KLXlpDQo=

#3 lore raw

PATCH 1/1 iwlwifi: remove IWLWIFI_VERSION

Also remove the MODULE_VERSION macros using IWLWIFI_VERSION. Those places using IWLWIFI_VERSION at runtime are modified to use init_utsname()->release instead.

---
How about this as a compromise?

 drivers/net/wireless/iwlwifi/iwl-agn.c      |    7 ++++---
 drivers/net/wireless/iwlwifi/iwl-core.c     |    1 -
 drivers/net/wireless/iwlwifi/iwl-core.h     |    1 -
 drivers/net/wireless/iwlwifi/iwl3945-base.c |    7 ++++---
 4 files changed, 8 insertions(+), 8 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn.c +4 -3
index 771b03c..f5522f0 100644
@@ -40,6 +40,7 @@
 #include <linux/firmware.h>
 #include <linux/etherdevice.h>
 #include <linux/if_arp.h>
+#include <linux/utsname.h>
 
 #include <net/mac80211.h>
 
@@ -79,11 +80,10 @@
 #define VS
 #endif
 
-#define DRV_VERSION     IWLWIFI_VERSION VD VS
+#define DRV_VERSION     VD VS
 
 
 MODULE_DESCRIPTION(DRV_DESCRIPTION);
-MODULE_VERSION(DRV_VERSION);
 MODULE_AUTHOR(DRV_COPYRIGHT " " DRV_AUTHOR);
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("iwl4965");
@@ -3884,7 +3884,8 @@ static int __init iwl_init(void)
 {
 
 	int ret;
-	printk(KERN_INFO DRV_NAME ": " DRV_DESCRIPTION ", " DRV_VERSION "\n");
+	printk(KERN_INFO DRV_NAME ": " DRV_DESCRIPTION ", %s-" DRV_VERSION "\n",
+		init_utsname()->release);
 	printk(KERN_INFO DRV_NAME ": " DRV_COPYRIGHT "\n");
 
 	ret = iwlagn_rate_control_register();
drivers/net/wireless/iwlwifi/iwl-core.c +0 -1
index 14f4829..756c49a 100644
@@ -43,7 +43,6 @@
 
 
 MODULE_DESCRIPTION("iwl core");
-MODULE_VERSION(IWLWIFI_VERSION);
 MODULE_AUTHOR(DRV_COPYRIGHT " " DRV_AUTHOR);
 MODULE_LICENSE("GPL");
 
drivers/net/wireless/iwlwifi/iwl-core.h +0 -1
index 1728f96..106651b 100644
@@ -72,7 +72,6 @@ struct iwl_host_cmd;
 struct iwl_cmd;
 
 
-#define IWLWIFI_VERSION UTS_RELEASE "-k"
 #define DRV_COPYRIGHT	"Copyright(c) 2003-2009 Intel Corporation"
 #define DRV_AUTHOR     "<[email protected]>"
 
drivers/net/wireless/iwlwifi/iwl3945-base.c +4 -3
index 10b0aa8..8b5ffff 100644
@@ -40,6 +40,7 @@
 #include <linux/firmware.h>
 #include <linux/etherdevice.h>
 #include <linux/if_arp.h>
+#include <linux/utsname.h>
 
 #include <net/ieee80211_radiotap.h>
 #include <net/mac80211.h>
@@ -76,12 +77,11 @@
 #define VS
 #endif
 
-#define DRV_VERSION  IWLWIFI_VERSION VD VS
+#define DRV_VERSION  VD VS
 #define DRV_COPYRIGHT	"Copyright(c) 2003-2009 Intel Corporation"
 #define DRV_AUTHOR     "<[email protected]>"
 
 MODULE_DESCRIPTION(DRV_DESCRIPTION);
-MODULE_VERSION(DRV_VERSION);
 MODULE_AUTHOR(DRV_COPYRIGHT " " DRV_AUTHOR);
 MODULE_LICENSE("GPL");
 
@@ -4279,7 +4279,8 @@ static int __init iwl3945_init(void)
 {
 
 	int ret;
-	printk(KERN_INFO DRV_NAME ": " DRV_DESCRIPTION ", " DRV_VERSION "\n");
+	printk(KERN_INFO DRV_NAME ": " DRV_DESCRIPTION ", %s-" DRV_VERSION "\n",
+		init_utsname()->release);
 	printk(KERN_INFO DRV_NAME ": " DRV_COPYRIGHT "\n");
 
 	ret = iwl3945_rate_control_register();
Signature · 1 line
1.6.2.5
#4 lore raw

Re: [PATCH] iwlwifi: remove IWLWIFI_VERSION

Hi John,

Quoted 7 lines · John W. Linville

Also remove the MODULE_VERSION macros using IWLWIFI_VERSION. Those places using IWLWIFI_VERSION at runtime are modified to use init_utsname()->release instead.

---
How about this as a compromise?

Thank you for looking at this.

I do think it is valuable for a user to see the parameters the module was compiled with when running "modinfo". I thus would like the MODULE_VERSION to stay. Including the kernel version number at runtime seems fine. The version number display may be a bit strange when a user did not compile with any of the options since the version number will then end with "-".

Reinette

#5 lore raw
In reply to Zhu Yi

Note:
This patch is for upstream (2.6.33) and occured after having merged linux-kbuild tree [1] in linus-tree.

- Sedat -

[1] http://repo.or.cz/w/linux-kbuild.git

Quoted 45 lines · Zhu Yi

Commit 900bb717424e5df12b1ef7ebb017be2a8915b806 uses UTS_RELEASE as the the in-tree iwlwifi driver version. However the inclusion of generated/utsrelease.h makes it a unpleasant behaviour to recompile the driver everytime when utsrelease.h is updated. In fact, the driver module is already built with the UTS_RELEASE information via vermagic of modinfo. Mark the in-tree driver with the version string "in-tree" to distinguish with those old out-of-tree drivers.

---
 drivers/net/wireless/iwlwifi/iwl-core.h |    4 +---

 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/net/wireless/iwlwifi/iwl-core.h +1 -4
index 308f679..375226b 100644
@@ -63,8 +63,6 @@
  #ifndef __iwl_core_h__
  #define __iwl_core_h__
 
-#include <generated/utsrelease.h>
-
  /************************
  * forward declarations *
  ************************/
@@ -72,7 +70,7 @@ struct iwl_host_cmd;
  struct iwl_cmd;
 
 
-#define IWLWIFI_VERSION UTS_RELEASE "-k"
+#define IWLWIFI_VERSION "in-tree:"
  #define DRV_COPYRIGHT  "Copyright(c) 2003-2009 Intel Corporation"
  #define DRV_AUTHOR     "<[email protected]>"
 
--

1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html