mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Prevent modpost from looking for a .cmd file for a static library linked into a module
@ 2008-10-07 18:26 Ashutosh Naik
  2008-10-10 23:01 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Ashutosh Naik @ 2008-10-07 18:26 UTC (permalink / raw)
  To: linux-kernel, stable, akpm, rusty, Karen Xie


This patch prevents modpost to look for a .cmd file when a module is
linked with a static library

Signed-off-by: Ashutosh Naik <ashutosh.naik@gmail.com>

diff -ruN linux-2.6.26.5/scripts/mod/sumversion.c
linux-2.6.26.5-mod/scripts/mod/sumversion.c
--- linux-2.6.26.5/scripts/mod/sumversion.c	2008-09-08
10:40:20.000000000 -0700
+++ linux-2.6.26.5-mod/scripts/mod/sumversion.c	2008-10-07
09:32:24.000000000 -0700
@@ -290,6 +290,15 @@
 	release_file(file, len);
 	return 1;
 }
+/* Check whether the file is a static library or not */
+static int is_static_library(const char *objfile)
+{
+	int len = strlen(objfile);
+	if((objfile[len -2]=='.') && (objfile[len - 1]=='a'))
+		return 1;
+	else
+		return 0;	
+}
 
 /* We have dir/file.o.  Open dir/.file.o.cmd, look for deps_ line to
  * figure out source file. */
@@ -420,7 +429,7 @@
 	while ((fname = strsep(&sources, " ")) != NULL) {
 		if (!*fname)
 			continue;
-		if (!parse_source_files(fname, &md))
+		if (!(is_static_library(fname)) &&
!parse_source_files(fname, &md))
 			goto release;
 	}

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

* Re: [PATCH] Prevent modpost from looking for a .cmd file for a static library linked into a module
  2008-10-07 18:26 [PATCH] Prevent modpost from looking for a .cmd file for a static library linked into a module Ashutosh Naik
@ 2008-10-10 23:01 ` Andrew Morton
  2008-10-11  1:15   ` Ashutosh Naik
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2008-10-10 23:01 UTC (permalink / raw)
  To: Ashutosh Naik; +Cc: linux-kernel, stable, rusty, kxie, Sam Ravnborg

On Tue, 7 Oct 2008 11:26:15 -0700
"Ashutosh Naik" <ashutosh@chelsio.com> wrote:

> 
> This patch prevents modpost to look for a .cmd file when a module is
> linked with a static library
> 
> Signed-off-by: Ashutosh Naik <ashutosh.naik@gmail.com>

What is the reason for this change?

Presumably there is some user-observeable behaviour which it corrects? 
What is it, and under what circumstances does it occur?


> diff -ruN linux-2.6.26.5/scripts/mod/sumversion.c
> linux-2.6.26.5-mod/scripts/mod/sumversion.c
> --- linux-2.6.26.5/scripts/mod/sumversion.c	2008-09-08
> 10:40:20.000000000 -0700
> +++ linux-2.6.26.5-mod/scripts/mod/sumversion.c	2008-10-07
> 09:32:24.000000000 -0700
> @@ -290,6 +290,15 @@
>  	release_file(file, len);
>  	return 1;
>  }
> +/* Check whether the file is a static library or not */
> +static int is_static_library(const char *objfile)
> +{
> +	int len = strlen(objfile);
> +	if((objfile[len -2]=='.') && (objfile[len - 1]=='a'))
> +		return 1;
> +	else
> +		return 0;	
> +}
>  
>  /* We have dir/file.o.  Open dir/.file.o.cmd, look for deps_ line to
>   * figure out source file. */
> @@ -420,7 +429,7 @@
>  	while ((fname = strsep(&sources, " ")) != NULL) {
>  		if (!*fname)
>  			continue;
> -		if (!parse_source_files(fname, &md))
> +		if (!(is_static_library(fname)) &&
> !parse_source_files(fname, &md))
>  			goto release;
>  	}

The patch was wordwrapped.  I fixed that and queued it for sending to
Sam.  Please send me an updated, complete changelog, thanks.


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

* RE: [PATCH] Prevent modpost from looking for a .cmd file for a static library linked into a module
  2008-10-10 23:01 ` Andrew Morton
@ 2008-10-11  1:15   ` Ashutosh Naik
  0 siblings, 0 replies; 3+ messages in thread
From: Ashutosh Naik @ 2008-10-11  1:15 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, stable, rusty, Karen Xie, Sam Ravnborg


On Tue, 7 Oct 2008 11:26:15 -0700
"Ashutosh Naik" <ashutosh@chelsio.com> wrote:

>> 
>> This patch prevents modpost to look for a .cmd file when a module is
>> linked with a static library
>> 
>> Signed-off-by: Ashutosh Naik <ashutosh.naik@gmail.com>

>What is the reason for this change?

>Presumably there is some user-observeable behaviour which it corrects? 
>What is it, and under what circumstances does it occur?

This fixes a Compile time Warning, whenever a static library is linked
into a kernel module. MODPOST tries to look for a ".<modulename>.cmd"
file to look for its dependencies, but that file doesn't exist or get
generated for static libraries. 


<snip>

>The patch was wordwrapped.  I fixed that and queued it for sending to
>Sam.  Please send me an updated, complete changelog, thanks.

Thanks for fixing the wordwrap.

Here is the changelog:
This fixes a Compile time Warning, whenever a static library is linked
into a kernel module. MODPOST tries to look for a ".<modulename>.cmd"
file to look for its dependencies, but that file doesn't  exist or get
generated for static libraries.

Many Thanks,
Ashutosh

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

end of thread, other threads:[~2008-10-11  1:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-07 18:26 [PATCH] Prevent modpost from looking for a .cmd file for a static library linked into a module Ashutosh Naik
2008-10-10 23:01 ` Andrew Morton
2008-10-11  1:15   ` Ashutosh Naik

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®