[<prev] [next>] [day] [month] [year] [list]
Message-Id: <200711262132.46615.m.kozlowski@tuxland.pl>
Date: Mon, 26 Nov 2007 21:32:45 +0100
From: Mariusz Kozlowski <m.kozlowski@...land.pl>
To: linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH -mm] kernel/module.c: make_driver_name() can use kasrpintf()
Hello,
make_driver_name() wants kasprintf(). Compile tested, also boots fine.
Signed-off-by: Mariusz Kozlowski <m.kozlowski@...land.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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists