public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Use formatting of module name in SUNRPC
@ 2009-05-27 17:59 Alex Riesen
  2009-06-02 17:41 ` Tom Talpey
  2009-06-23  8:55 ` Jiri Kosina
  0 siblings, 2 replies; 3+ messages in thread
From: Alex Riesen @ 2009-05-27 17:59 UTC (permalink / raw)
  To: trivial; +Cc: linux-kernel, Tom Talpey, Trond Myklebust

Besides, the old code caused gcc-4.3.3 to produce the warning:
  "format not a string literal and no format arguments"

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
 net/sunrpc/xprt.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 06ca058..82f62fd 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -162,7 +162,6 @@ EXPORT_SYMBOL_GPL(xprt_unregister_transport);
 int xprt_load_transport(const char *transport_name)
 {
 	struct xprt_class *t;
-	char module_name[sizeof t->name + 5];
 	int result;
 
 	result = 0;
@@ -174,9 +173,7 @@ int xprt_load_transport(const char *transport_name)
 		}
 	}
 	spin_unlock(&xprt_list_lock);
-	strcpy(module_name, "xprt");
-	strncat(module_name, transport_name, sizeof t->name);
-	result = request_module(module_name);
+	result = request_module("xprt%s", transport_name);
 out:
 	return result;
 }
-- 
1.6.3.1.197.g41544



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

* Re: [PATCH] Use formatting of module name in SUNRPC
  2009-05-27 17:59 [PATCH] Use formatting of module name in SUNRPC Alex Riesen
@ 2009-06-02 17:41 ` Tom Talpey
  2009-06-23  8:55 ` Jiri Kosina
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Talpey @ 2009-06-02 17:41 UTC (permalink / raw)
  To: Alex Riesen; +Cc: trivial, linux-kernel, Trond Myklebust

On 5/27/2009 1:59 PM, Alex Riesen wrote:
> Besides, the old code caused gcc-4.3.3 to produce the warning:
>    "format not a string literal and no format arguments"
>
> Signed-off-by: Alex Riesen<raa.lkml@gmail.com>
> ---
>   net/sunrpc/xprt.c |    5 +----
>   1 files changed, 1 insertions(+), 4 deletions(-)
>
> diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
> index 06ca058..82f62fd 100644
> --- a/net/sunrpc/xprt.c
> +++ b/net/sunrpc/xprt.c
> @@ -162,7 +162,6 @@ EXPORT_SYMBOL_GPL(xprt_unregister_transport);
>   int xprt_load_transport(const char *transport_name)
>   {
>   	struct xprt_class *t;
> -	char module_name[sizeof t->name + 5];
>   	int result;
>
>   	result = 0;
> @@ -174,9 +173,7 @@ int xprt_load_transport(const char *transport_name)
>   		}
>   	}
>   	spin_unlock(&xprt_list_lock);
> -	strcpy(module_name, "xprt");
> -	strncat(module_name, transport_name, sizeof t->name);
> -	result = request_module(module_name);
> +	result = request_module("xprt%s", transport_name);
>   out:
>   	return result;
>   }

Never saw the warning while compiling, but I'm fine with the
proposed change, besides, it's cleaner. Ack.

Tom.


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

* Re: [PATCH] Use formatting of module name in SUNRPC
  2009-05-27 17:59 [PATCH] Use formatting of module name in SUNRPC Alex Riesen
  2009-06-02 17:41 ` Tom Talpey
@ 2009-06-23  8:55 ` Jiri Kosina
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Kosina @ 2009-06-23  8:55 UTC (permalink / raw)
  To: Alex Riesen; +Cc: linux-kernel, Tom Talpey, Trond Myklebust

On Wed, 27 May 2009, Alex Riesen wrote:

> Besides, the old code caused gcc-4.3.3 to produce the warning:
>   "format not a string literal and no format arguments"
> 
> Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
> ---
>  net/sunrpc/xprt.c |    5 +----
>  1 files changed, 1 insertions(+), 4 deletions(-)
> 
> diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
> index 06ca058..82f62fd 100644
> --- a/net/sunrpc/xprt.c
> +++ b/net/sunrpc/xprt.c
> @@ -162,7 +162,6 @@ EXPORT_SYMBOL_GPL(xprt_unregister_transport);
>  int xprt_load_transport(const char *transport_name)
>  {
>  	struct xprt_class *t;
> -	char module_name[sizeof t->name + 5];
>  	int result;
>  
>  	result = 0;
> @@ -174,9 +173,7 @@ int xprt_load_transport(const char *transport_name)
>  		}
>  	}
>  	spin_unlock(&xprt_list_lock);
> -	strcpy(module_name, "xprt");
> -	strncat(module_name, transport_name, sizeof t->name);
> -	result = request_module(module_name);
> +	result = request_module("xprt%s", transport_name);
>  out:
>  	return result;
>  }

Trond, are you planning to take this one through your tree?

Thanks,

-- 
Jiri Kosina
SUSE Labs


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

end of thread, other threads:[~2009-06-23  8:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-27 17:59 [PATCH] Use formatting of module name in SUNRPC Alex Riesen
2009-06-02 17:41 ` Tom Talpey
2009-06-23  8:55 ` Jiri Kosina

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