From patchwork Thu Mar 18 23:25:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 86831 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 o2INPqTX000854 for ; Thu, 18 Mar 2010 23:25:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751532Ab0CRXZg (ORCPT ); Thu, 18 Mar 2010 19:25:36 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:57895 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751203Ab0CRXZg (ORCPT ); Thu, 18 Mar 2010 19:25:36 -0400 Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [140.211.169.55]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id o2INPUTm001896 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Mar 2010 16:25:31 -0700 Received: from akpm.mtv.corp.google.com (localhost [127.0.0.1]) by imap1.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with SMTP id o2INPTuj021779; Thu, 18 Mar 2010 16:25:30 -0700 Date: Thu, 18 Mar 2010 16:25:29 -0700 From: Andrew Morton To: Julia Lawall Cc: Zhang Rui , Len Brown , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH 4/6] drivers/acpi: Use kasprintf Message-Id: <20100318162529.762251ef.akpm@linux-foundation.org> In-Reply-To: References: X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.9; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-Spam-Status: No, hits=-3.512 required=5 tests=AWL, BAYES_00, OSDL_HEADER_SUBJECT_BRACKETED X-Spam-Checker-Version: SpamAssassin 3.2.4-osdl_revision__1.47__ X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13 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]); Thu, 18 Mar 2010 23:25:52 +0000 (UTC) --- a/drivers/acpi/video.c~drivers-acpi-use-kasprintf-fix +++ a/drivers/acpi/video.c @@ -1006,9 +1006,10 @@ static void acpi_video_device_find_cap(s result = acpi_video_init_brightness(device); if (result) return; - name = kasprintf(GFP_KERNEL, "acpi_video%d", count++); + name = kasprintf(GFP_KERNEL, "acpi_video%d", count); if (!name) return; + count++; memset(&props, 0, sizeof(struct backlight_properties)); props.max_brightness = device->brightness->count - 3; @@ -1058,9 +1059,10 @@ static void acpi_video_device_find_cap(s if (device->cap._DCS && device->cap._DSS) { static int count; char *name; - name = kasprintf(GFP_KERNEL, "acpi_video%d", count++); + name = kasprintf(GFP_KERNEL, "acpi_video%d", count); if (!name) return; + count++; device->output_dev = video_output_register(name, NULL, device, &acpi_output_properties); kfree(name);