From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Howells Subject: (unknown) Date: Tue, 14 Sep 2010 10:14:45 +0100 Message-ID: <28081.1284455685@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: devel-bounces@linuxdriverproject.org Errors-To: devel-bounces@linuxdriverproject.org To: Joe Perches Cc: Amit Kumar Salecha , linux-fbdev@vger.kernel.org, linux-usb@vger.kernel.org, Karsten Keil , James Smart , linux-mips@linux-mips.org, "VMware, Inc." , Bruce Allan , PJ Waskiewicz , Shreyas Bhatewara , alsa-devel@alsa-project.org, Jaroslav Kysela , dhowells@redhat.com, "James E.J. Bottomley" , Paul Mackerras , linux-i2c@vger.kernel.org, Brett Rudley , sparclinux@vger.kernel.org, devel@driverdev.osuosl.org, linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org, Florian Tobias Schandinat , e1000-devel@lists.sourceforge.net, Jesse Brandeburg , linux-acpi@vger.kernel.org List-Id: alsa-devel@alsa-project.org Joe Perches wrote: > Using static const char foo[] = "bar" can save some > code and text space, so change the places where it's possible. That's reasonable. > Also change the places that use > char foo[] = "barX"; > ... > foo[3] = value + '0'; > where X is typically changed > char foo[sizeof("barX")]; > ... > sprintf(foo, "bar%c", value + '0'); You haven't said what this gains. I can see what it may cost, though (depending on how gcc loads foo[]). David From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 14 Sep 2010 11:16:47 +0200 (CEST) Received: from mx1.redhat.com ([209.132.183.28]:44786 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S1491095Ab0INJQn (ORCPT ); Tue, 14 Sep 2010 11:16:43 +0200 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8E9FElb031305 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 14 Sep 2010 05:15:14 -0400 Received: from redhat.com ([10.3.112.2]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8E9EjUt018637; Tue, 14 Sep 2010 05:14:46 -0400 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: To: Joe Perches Cc: dhowells@redhat.com, linux-kernel@vger.kernel.org, Amit Kumar Salecha , linux-fbdev@vger.kernel.org, Greg Kroah-Hartman , James Smart , linux-mips@linux-mips.org, "VMware, Inc." , PJ Waskiewicz , Shreyas Bhatewara , alsa-devel@alsa-project.org, Jaroslav Kysela , "J. Bruce Fields" , "James E.J. Bottomley" , Paul Mackerras , linux-i2c@vger.kernel.org, Brett Rudley , sparclinux@vger.kernel.org, Martin Schwidefsky , devel@driverdev.osuosl.org, linux-s390@vger.kernel.org, linux-acpi@vger.kernel.org, linux-scsi@vger.kernel.org, Florian Tobias Schandinat , e1000-devel@lists.sourceforge.net, Trond Myklebust , Jesse Brandeburg , Neil Brown , Jeff Kirsher , linux-wireless@vger.kernel.org, Ingo Molnar , linux-usb@vger.kernel.org, Len Brown , Alex Duyck , Peter Zijlstra , Henry Ptasinski , Heiko Carstens , Thomas Winischhofer , Mauro Carvalho Chehab , Arnaldo Carvalho de Melo , "Jean Delvare \(PC drivers, core\)" , mjpeg-users@lists.sourceforge.net, "Ben Dooks \(embedded platforms\)" , linux-nfs@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Neela Syam Kolli , Karsten Keil , Linus Walleij , netdev@vger.kernel.org, Anirban Chakraborty , Bruce Allan Date: Tue, 14 Sep 2010 10:14:45 +0100 Message-ID: <28081.1284455685@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-archive-position: 27752 Subject: (no subject) X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: dhowells@redhat.com Precedence: bulk X-list: linux-mips Return-Path: X-Keywords: X-UID: 10737 Joe Perches wrote: > Using static const char foo[] = "bar" can save some > code and text space, so change the places where it's possible. That's reasonable. > Also change the places that use > char foo[] = "barX"; > ... > foo[3] = value + '0'; > where X is typically changed > char foo[sizeof("barX")]; > ... > sprintf(foo, "bar%c", value + '0'); You haven't said what this gains. I can see what it may cost, though (depending on how gcc loads foo[]). David From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx1.redhat.com ([209.132.183.28]:44786 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S1491095Ab0INJQn (ORCPT ); Tue, 14 Sep 2010 11:16:43 +0200 From: David Howells In-Reply-To: References: Date: Tue, 14 Sep 2010 10:14:45 +0100 Message-ID: <28081.1284455685@redhat.com> Subject: (no subject) Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org Return-Path: To: Joe Perches Cc: dhowells@redhat.com, linux-kernel@vger.kernel.org, Amit Kumar Salecha , linux-fbdev@vger.kernel.org, Greg Kroah-Hartman , James Smart , linux-mips@linux-mips.org, "VMware, Inc." , PJ Waskiewicz , Shreyas Bhatewara , alsa-devel@alsa-project.org, Jaroslav Kysela , "J. Bruce Fields" , "James E.J. Bottomley" , Paul Mackerras , linux-i2c@vger.kernel.org, Brett Rudley , sparclinux@vger.kernel.org, Martin Schwidefsky , devel@driverdev.osuosl.org, linux-s390@vger.kernel.org, linux-acpi@vger.kernel.org, linux-scsi@vger.kernel.org, Florian Tobias Schandinat , e1000-devel@lists.sourceforge.net, Trond Myklebust , Jesse Brandeburg , Neil Brown , Jeff Kirsher , linux-wireless@vger.kernel.org, Ingo Molnar , linux-usb@vger.kernel.org, Len Brown , Alex Duyck , Peter Zijlstra , Henry Ptasinski , Heiko Carstens , Thomas Winischhofer , Mauro Carvalho Chehab , Arnaldo Carvalho de Melo , "Jean Delvare (PC drivers, core)" , mjpeg-users@lists.sourceforge.net, "Ben Dooks (embedded platforms)" , linux-nfs@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Neela Syam Kolli , Karsten Keil , Linus Walleij , netdev@vger.kernel.org, Anirban Chakraborty , Bruce Allan Message-ID: <20100914091445.2jM5LF2ohELD3LlFU8N8-E8ykQlOIFrpvc1E87-mOH4@z> Joe Perches wrote: > Using static const char foo[] = "bar" can save some > code and text space, so change the places where it's possible. That's reasonable. > Also change the places that use > char foo[] = "barX"; > ... > foo[3] = value + '0'; > where X is typically changed > char foo[sizeof("barX")]; > ... > sprintf(foo, "bar%c", value + '0'); You haven't said what this gains. I can see what it may cost, though (depending on how gcc loads foo[]). David