linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Len Brown <lenb@kernel.org>
To: linux-acpi@vger.kernel.org, linux-pm@lists.linux-foundation.org
Cc: Len Brown <len.brown@intel.com>, Thomas Meyer <thomas@m3y3r.de>
Subject: [PATCH 03/14] ACPI: use kstrdup()
Date: Sun, 06 Nov 2011 23:11:53 -0500	[thread overview]
Message-ID: <581de59e8dff8eaa52809e768a585e9ef336aa4a.1320636776.git.len.brown@intel.com> (raw)
In-Reply-To: <1320639124-16178-1-git-send-email-lenb@kernel.org>
In-Reply-To: <aeae1e92daec5a38b40ad12598b97501b675a381.1320636776.git.len.brown@intel.com>

From: Thomas Meyer <thomas@m3y3r.de>

 Use kstrdup rather than duplicating its implementation

 The semantic patch that makes this output is available
 in scripts/coccinelle/api/kstrdup.cocci.

 More information about semantic patching is available at
 http://coccinelle.lip6.fr/

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/scan.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 449c556..8ab80ba 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1062,13 +1062,12 @@ static void acpi_add_id(struct acpi_device *device, const char *dev_id)
 	if (!id)
 		return;
 
-	id->id = kmalloc(strlen(dev_id) + 1, GFP_KERNEL);
+	id->id = kstrdup(dev_id, GFP_KERNEL);
 	if (!id->id) {
 		kfree(id);
 		return;
 	}
 
-	strcpy(id->id, dev_id);
 	list_add_tail(&id->list, &device->pnp.ids);
 }
 
-- 
1.7.7.rc0.72.g4b5ea

  parent reply	other threads:[~2011-11-07  4:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-07  4:11 ACPI & PM patch queue for Linux 3.2 Len Brown
2011-11-07  4:11 ` [PATCH 01/14] tools/power turbostat: less verbose debugging Len Brown
2011-11-07  4:11   ` [PATCH 02/14] mrst pmu: update comment Len Brown
2011-11-07  4:11   ` Len Brown [this message]
2011-11-07  4:11   ` [PATCH 04/14] ACPI: Fix possible recursive locking in hwregs.c Len Brown
2011-11-07  4:11   ` [PATCH 05/14] PNPACPI: Simplify disabled resource registration Len Brown
2011-11-07  4:11   ` [PATCH 06/14] ACPI atomicio: Convert width in bits to bytes in __acpi_ioremap_fast() Len Brown
2011-11-07  4:11   ` [PATCH 07/14] ACPI: Drop ACPI_NO_HARDWARE_INIT Len Brown
2011-11-07  4:11   ` [PATCH 08/14] thermal: Prevent polling from happening during system suspend Len Brown
2011-11-07  4:11   ` [PATCH 09/14] ACPI: Export FADT pm_profile integer value to userspace Len Brown
2011-11-07  4:12   ` [PATCH 10/14] ACPI: Fix CONFIG_ACPI_DOCK=n compiler warning Len Brown
2011-11-07  4:12   ` [PATCH 11/14] cpuidle: Move dev->last_residency update to driver enter routine; remove dev->last_state Len Brown
2011-11-07  4:12   ` [PATCH 12/14] cpuidle: Remove CPUIDLE_FLAG_IGNORE and dev->prepare() Len Brown
2011-11-07  4:12   ` [PATCH 13/14] cpuidle: Split cpuidle_state structure and move per-cpu statistics fields Len Brown
2011-11-07  4:12   ` [PATCH 14/14] cpuidle: Single/Global registration of idle states Len Brown
2011-11-08  0:16 ` ACPI & PM patch queue for Linux 3.2 Thomas Renninger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=581de59e8dff8eaa52809e768a585e9ef336aa4a.1320636776.git.len.brown@intel.com \
    --to=lenb@kernel.org \
    --cc=len.brown@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=thomas@m3y3r.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).