2009-12-24 07:31:16

by Zhu Yi

[permalink] [raw]
Subject: [PATCH] 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.

Reported-by: David Miller <[email protected]>
Signed-off-by: Zhu Yi <[email protected]>
---
drivers/net/wireless/iwlwifi/iwl-core.h | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index 308f679..375226b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -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



2009-12-24 07:44:01

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH] iwlwifi: remove generated/utsrelease.h dependency

On Wed, Dec 23, 2009 at 11:31 PM, Zhu Yi <[email protected]> wrote:
> 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.
>
> Reported-by: David Miller <[email protected]>
> Signed-off-by: Zhu Yi <[email protected]>
> ---
>  drivers/net/wireless/iwlwifi/iwl-core.h |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
> index 308f679..375226b 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-core.h
> +++ b/drivers/net/wireless/iwlwifi/iwl-core.h
> @@ -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]>"

Why is a version even needed?

Luis

2009-12-24 08:20:05

by Sedat Dilek

[permalink] [raw]
Subject: Re: [PATCH] iwlwifi: remove generated/utsrelease.h dependency

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

On Thu, Dec 24, 2009 at 8:31 AM, Zhu Yi <[email protected]> wrote:
> 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.
>
> Reported-by: David Miller <[email protected]>
> Signed-off-by: Zhu Yi <[email protected]>
> ---
>  drivers/net/wireless/iwlwifi/iwl-core.h |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
> index 308f679..375226b 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-core.h
> +++ b/drivers/net/wireless/iwlwifi/iwl-core.h
> @@ -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
>

2009-12-25 01:46:39

by Zhu Yi

[permalink] [raw]
Subject: RE: [PATCH] iwlwifi: remove generated/utsrelease.h dependency

RnJvbTogTHVpcyBSLiBSb2RyaWd1ZXogW21haWx0bzptY2dyb2ZAZ21haWwuY29tXSANCg0KPiBX
aHkgaXMgYSB2ZXJzaW9uIGV2ZW4gbmVlZGVkPw0KDQpUaGUgcmVhc29uIGlzIHdlIHdhbnQgdG8g
Z2V0IHRoZSBkcml2ZXIgY29uZmlnIG9wdGlvbnMgZWFzaWx5IGZyb20gYSBidWcgcmVwb3J0LiBG
b3INCmV4YW1wbGUsIENPTkZJR19JV0xXSUZJX0RFQlVHLCBTUEVDVFJVTV9NRUFTVVJFTUVOVCwg
ZXRjLiBTb21ldGltZXMgdGhleQ0KYXJlIG5vdCB2ZXJ5IGVhc3kgdG8gdGVsbCBmb3IgYW4gT1NE
IHByb3ZpZGVkIGRyaXZlci4NCg0KVGhhbmtzLA0KLXlpDQo=

2010-01-06 00:08:16

by Reinette Chatre

[permalink] [raw]
Subject: Re: [PATCH] iwlwifi: remove IWLWIFI_VERSION

Hi John,

On Tue, 2010-01-05 at 13:54 -0800, John W. Linville wrote:
> Also remove the MODULE_VERSION macros using IWLWIFI_VERSION. Those
> places using IWLWIFI_VERSION at runtime are modified to use
> init_utsname()->release instead.
>
> Signed-off-by: John W. Linville <[email protected]>
> ---
> 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



2010-01-05 22:00:27

by John W. Linville

[permalink] [raw]
Subject: [PATCH] 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.

Signed-off-by: John W. Linville <[email protected]>
---
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(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 771b03c..f5522f0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -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();
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 14f4829..756c49a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -43,7 +43,6 @@


MODULE_DESCRIPTION("iwl core");
-MODULE_VERSION(IWLWIFI_VERSION);
MODULE_AUTHOR(DRV_COPYRIGHT " " DRV_AUTHOR);
MODULE_LICENSE("GPL");

diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index 1728f96..106651b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -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]>"

diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 10b0aa8..8b5ffff 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -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();
--
1.6.2.5