lkml.org 
[lkml]   [2015]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC/PATCH 5/8] drivers/base/core.c: Use strreplace
Date
This eliminates a local variable and a little .text.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
drivers/base/core.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index 21d13038534e..01f2c1214f06 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1282,8 +1282,6 @@ const char *device_get_devnode(struct device *dev,
umode_t *mode, kuid_t *uid, kgid_t *gid,
const char **tmp)
{
- char *s;
-
*tmp = NULL;

/* the device type may provide a specific name */
@@ -1306,8 +1304,7 @@ const char *device_get_devnode(struct device *dev,
*tmp = kstrdup(dev_name(dev), GFP_KERNEL);
if (!*tmp)
return NULL;
- while ((s = strchr(*tmp, '!')))
- s[0] = '/';
+ strreplace((char *)*tmp, '!', '/');
return *tmp;
}

--
2.1.3


\
 
 \ /
  Last update: 2015-06-04 12:01    [W:0.128 / U:0.720 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site