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