* - power-use-kasprintf.patch removed from -mm tree
@ 2007-11-26 21:50 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2007-11-26 21:50 UTC (permalink / raw)
To: akinobu.mita, cbou, dwmw2, mm-commits
The patch titled
power: use kasprintf
has been removed from the -mm tree. Its filename was
power-use-kasprintf.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
Subject: power: use kasprintf
From: Akinobu Mita <akinobu.mita@gmail.com>
Use kasprintf instead of kmalloc()-strcpy()-strcat().
Cc: Anton Vorontsov <cbou@mail.ru>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/power/power_supply_leds.c | 25 +++++++------------------
1 file changed, 7 insertions(+), 18 deletions(-)
diff -puN drivers/power/power_supply_leds.c~power-use-kasprintf drivers/power/power_supply_leds.c
--- a/drivers/power/power_supply_leds.c~power-use-kasprintf
+++ a/drivers/power/power_supply_leds.c
@@ -10,6 +10,7 @@
* You may use this code as per GPL version 2
*/
+#include <linux/kernel.h>
#include <linux/power_supply.h>
#include "power_supply.h"
@@ -48,28 +49,20 @@ static int power_supply_create_bat_trigg
{
int rc = 0;
- psy->charging_full_trig_name = kmalloc(strlen(psy->name) +
- sizeof("-charging-or-full"), GFP_KERNEL);
+ psy->charging_full_trig_name = kasprintf(GFP_KERNEL,
+ "%s-charging-or-full", psy->name);
if (!psy->charging_full_trig_name)
goto charging_full_failed;
- psy->charging_trig_name = kmalloc(strlen(psy->name) +
- sizeof("-charging"), GFP_KERNEL);
+ psy->charging_trig_name = kasprintf(GFP_KERNEL,
+ "%s-charging", psy->name);
if (!psy->charging_trig_name)
goto charging_failed;
- psy->full_trig_name = kmalloc(strlen(psy->name) +
- sizeof("-full"), GFP_KERNEL);
+ psy->full_trig_name = kasprintf(GFP_KERNEL, "%s-full", psy->name);
if (!psy->full_trig_name)
goto full_failed;
- strcpy(psy->charging_full_trig_name, psy->name);
- strcat(psy->charging_full_trig_name, "-charging-or-full");
- strcpy(psy->charging_trig_name, psy->name);
- strcat(psy->charging_trig_name, "-charging");
- strcpy(psy->full_trig_name, psy->name);
- strcat(psy->full_trig_name, "-full");
-
led_trigger_register_simple(psy->charging_full_trig_name,
&psy->charging_full_trig);
led_trigger_register_simple(psy->charging_trig_name,
@@ -120,14 +113,10 @@ static int power_supply_create_gen_trigg
{
int rc = 0;
- psy->online_trig_name = kmalloc(strlen(psy->name) + sizeof("-online"),
- GFP_KERNEL);
+ psy->online_trig_name = kasprintf(GFP_KERNEL, "%s-online", psy->name);
if (!psy->online_trig_name)
goto online_failed;
- strcpy(psy->online_trig_name, psy->name);
- strcat(psy->online_trig_name, "-online");
-
led_trigger_register_simple(psy->online_trig_name, &psy->online_trig);
goto success;
_
Patches currently in -mm which might be from akinobu.mita@gmail.com are
git-battery.patch
fs-use-hlist_unhashed.patch
partitions-use-kasprintf.patch
fs-use-list_for_each_entry_reverse-and-kill-sb_entry.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-11-26 21:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-26 21:50 - power-use-kasprintf.patch removed from -mm tree akpm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.