From patchwork Wed Mar 10 21:16:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 84688 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2ALH9FK030694 for ; Wed, 10 Mar 2010 21:17:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754245Ab0CJVQ5 (ORCPT ); Wed, 10 Mar 2010 16:16:57 -0500 Received: from mgw1.diku.dk ([130.225.96.91]:37655 "EHLO mgw1.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752891Ab0CJVQ4 (ORCPT ); Wed, 10 Mar 2010 16:16:56 -0500 Received: from localhost (localhost [127.0.0.1]) by mgw1.diku.dk (Postfix) with ESMTP id 6F8E352C3ED; Wed, 10 Mar 2010 22:16:55 +0100 (CET) X-Virus-Scanned: amavisd-new at diku.dk Received: from mgw1.diku.dk ([127.0.0.1]) by localhost (mgw1.diku.dk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yTACkuWMV5m4; Wed, 10 Mar 2010 22:16:51 +0100 (CET) Received: from nhugin.diku.dk (nhugin.diku.dk [130.225.96.140]) by mgw1.diku.dk (Postfix) with ESMTP id 2729D52C3B1; Wed, 10 Mar 2010 22:16:51 +0100 (CET) Received: from ask.diku.dk (ask.diku.dk [130.225.96.225]) by nhugin.diku.dk (Postfix) with ESMTP id 16A4C6DFB75; Wed, 10 Mar 2010 22:11:06 +0100 (CET) Received: by ask.diku.dk (Postfix, from userid 3767) id 0E062200B0; Wed, 10 Mar 2010 22:16:51 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by ask.diku.dk (Postfix) with ESMTP id 084C5200AF; Wed, 10 Mar 2010 22:16:51 +0100 (CET) Date: Wed, 10 Mar 2010 22:16:51 +0100 (CET) From: Julia Lawall To: Zhang Rui , Len Brown , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 4/6] drivers/acpi: Use kasprintf Message-ID: MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 10 Mar 2010 21:17:10 +0000 (UTC) diff -u -p a/drivers/acpi/video.c b/drivers/acpi/video.c --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@ -1005,11 +1005,10 @@ static void acpi_video_device_find_cap(s result = acpi_video_init_brightness(device); if (result) return; - name = kzalloc(MAX_NAME_LEN, GFP_KERNEL); + name = kasprintf(GFP_KERNEL, "acpi_video%d", count++); if (!name) return; - sprintf(name, "acpi_video%d", count++); device->backlight = backlight_device_register(name, NULL, device, &acpi_backlight_ops); kfree(name); @@ -1056,10 +1055,9 @@ static void acpi_video_device_find_cap(s if (device->cap._DCS && device->cap._DSS) { static int count; char *name; - name = kzalloc(MAX_NAME_LEN, GFP_KERNEL); + name = kasprintf(GFP_KERNEL, "acpi_video%d", count++); if (!name) return; - sprintf(name, "acpi_video%d", count++); device->output_dev = video_output_register(name, NULL, device, &acpi_output_properties); kfree(name);