lkml.org 
[lkml]   [2007]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH -mm] kernel/module.c: make_driver_name() can use kasrpintf()
Date
Hello,

make_driver_name() wants kasprintf(). Compile tested, also boots fine.

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>

kernel/module.c | 68034 -> 67872 (-162 bytes)
kernel/module.o | 128520 -> 128328 (-192 bytes)

kernel/module.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)

--- linux-2.6.24-rc3-mm1-a/kernel/module.c 2007-11-21 17:38:25.000000000 +0100
+++ linux-2.6.24-rc3-mm1-b/kernel/module.c 2007-11-26 20:14:53.000000000 +0100
@@ -2497,15 +2497,7 @@ void print_modules(void)
#ifdef CONFIG_SYSFS
static char *make_driver_name(struct device_driver *drv)
{
- char *driver_name;
-
- driver_name = kmalloc(strlen(drv->name) + strlen(drv->bus->name) + 2,
- GFP_KERNEL);
- if (!driver_name)
- return NULL;
-
- sprintf(driver_name, "%s:%s", drv->bus->name, drv->name);
- return driver_name;
+ return kasprintf(GFP_KERNEL, "%s:%s", drv->bus->name, drv->name);
}

static void module_create_drivers_dir(struct module_kobject *mk)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2007-11-26 21:35    [W:0.019 / U:0.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site