linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Joe Perches <joe@perches.com>
Cc: dhowells@redhat.com, linux-kernel@vger.kernel.org,
	Amit Kumar Salecha <amit.salecha@qlogic.com>,
	linux-fbdev@vger.kernel.org, Greg Kroah-Hartman <gregkh@suse.de>,
	James Smart <james.smart@emulex.com>,
	linux-mips@linux-mips.org, "VMware, Inc." <pv-drivers@vmware.com>,
	PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com>,
	Shreyas Bhatewara <sbhatewara@vmware.com>,
	alsa-devel@alsa-project.org, Jaroslav Kysela <perex@perex.cz>,
	"J. Bruce Fields" <bfields@fieldses.org>,
	"James E.J. Bottomley" <James.Bottomley@suse.de>,
	Paul Mackerras <paulus@samba.org>,
	linux-i2c@vger.kernel.org, Brett Rudley <brudley@broadcom.com>,
	sparclinux@vger.kernel.org,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	devel@driverdev.osuosl.org, linux-s390@vger.kernel.org,
	linux-acpi@vger.kernel.org, linux-scsi@vger.kernel.org,
	Florian Tobias Schandinat <FlorianSchandinat@gmx.de>,
	e1000-devel@lists.sourceforge.net,
	Trond Myklebust <Trond.Myklebust@netapp.com>,
	Jesse Brandeburg <jesse.brandeburg@intel.com>,
	Neil Brown <neilb@suse.de>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
	linux-wireless@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	linux-usb@vger.kernel.org, Len Brown <lenb@kernel.org>,
	Alex Duyck <alexander.h.duyck@intel.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Henry Ptasinski <henryp@broadcom.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Thomas Winischhofer <thomas@winischhofer.net>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	"Jean Delvare \(PC drivers, core\)" <khali@linux-fr.org>,
	mjpeg-users@lists.sourceforge.net,
	"Ben Dooks \(embedded platforms\)" <ben-linux@fluff.org>,
	linux-nfs@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	Neela Syam Kolli <megaraidlinux@lsi.com>,
	Karsten Keil <isdn@linux-pingi.de>,
	Linus Walleij <linus.walleij@stericsson.com>,
	netdev@vger.kernel.org,
	Anirban Chakraborty <anirban.chakraborty@qlogic.com>,
	Bruce Allan <bruce.w.allan@intel.com>
Subject: (no subject)
Date: Tue, 14 Sep 2010 10:14:45 +0100	[thread overview]
Message-ID: <28081.1284455685@redhat.com> (raw)
In-Reply-To: <cover.1284406638.git.joe@perches.com>

Joe Perches <joe@perches.com> 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

WARNING: multiple messages have this Message-ID (diff)
From: David Howells <dhowells@redhat.com>
To: Joe Perches <joe@perches.com>
Cc: dhowells@redhat.com, linux-kernel@vger.kernel.org,
	Amit Kumar Salecha <amit.salecha@qlogic.com>,
	linux-fbdev@vger.kernel.org, Greg Kroah-Hartman <gregkh@suse.de>,
	James Smart <james.smart@emulex.com>,
	linux-mips@linux-mips.org, "VMware, Inc." <pv-drivers@vmware.com>,
	PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com>,
	Shreyas Bhatewara <sbhatewara@vmware.com>,
	alsa-devel@alsa-project.org, Jaroslav Kysela <perex@perex.cz>,
	"J. Bruce Fields" <bfields@fieldses.org>,
	"James E.J. Bottomley" <James.Bottomley@suse.de>,
	Paul Mackerras <paulus@samba.org>,
	linux-i2c@vger.kernel.org, Brett Rudley <brudley@broadcom.com>,
	sparclinux@vger.kernel.org,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	devel@driverdev.osuosl.org, linux-s390@vger.kernel.org,
	linux-acpi@vger.kernel.org, linux-scsi@vger.kernel.org,
	Florian Tobias Schandinat <FlorianSchandinat@gmx.de>,
	e1000-devel@lists.sourceforge.net,
	Trond Myklebust <Trond.Myklebust@netapp.com>,
	Jesse Brandeburg <jesse.brandeburg@intel.com>,
	Neil Brown <neilb@suse.de>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
	linux-wireless@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	linux-usb@vger.kernel.org, Len Brown <lenb@kernel.org>,
	Alex Duyck <alexander.h.duyck@intel.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Henry Ptasinski <henryp@broadcom.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Thomas Winischhofer <thomas@winischhofer.net>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	"Jean Delvare (PC drivers, core)" <khali@linux-fr.org>,
	mjpeg-users@lists.sourceforge.net,
	"Ben Dooks (embedded platforms)" <ben-linux@fluff.org>,
	linux-nfs@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	Neela Syam Kolli <megaraidlinux@lsi.com>,
	Karsten Keil <isdn@linux-pingi.de>,
	Linus Walleij <linus.walleij@stericsson.com>,
	netdev@vger.kernel.org,
	Anirban Chakraborty <anirban.chakraborty@qlogic.com>,
	Bruce Allan <bruce.w.allan@intel.com>
Subject: (no subject)
Date: Tue, 14 Sep 2010 10:14:45 +0100	[thread overview]
Message-ID: <28081.1284455685@redhat.com> (raw)
Message-ID: <20100914091445.2jM5LF2ohELD3LlFU8N8-E8ykQlOIFrpvc1E87-mOH4@z> (raw)
In-Reply-To: <cover.1284406638.git.joe@perches.com>

Joe Perches <joe@perches.com> 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

  parent reply	other threads:[~2010-09-14  9:16 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-13 19:47 [PATCH 00/25] treewide-next: Use static const char arrays Joe Perches
2010-09-13 19:47 ` [PATCH 01/25] arch/mips: " Joe Perches
2010-09-18 22:54   ` Ralf Baechle
2010-09-18 23:44     ` Joe Perches
2010-09-14  9:14 ` David Howells [this message]
2010-09-14  9:14   ` (no subject) David Howells
  -- strict thread matches above, loose matches on Subject: below --
2019-05-22  8:53 [No Subject] Gardner, Tim
2017-07-19 15:25 [PATCH 000/102] Convert drivers to explicit reset API Philipp Zabel
2017-07-20 20:32 ` (no subject) Heiko Stuebner
2017-07-20 20:32   ` Heiko Stuebner
2017-01-13 10:46 [PATCH v3 4/8] x86: stop exporting msr-index.h to userland Nicolas Dichtel
2017-01-13 10:46 [PATCH v3 1/8] arm: put types.h in uapi Nicolas Dichtel
2017-01-09 11:33 ` [PATCH v2 0/7] uapi: export all headers under uapi directories Arnd Bergmann
2017-01-13 10:46   ` [PATCH v3 0/8] " Nicolas Dichtel
2017-01-13 15:36     ` (no subject) David Howells
2017-01-13 15:43     ` David Howells
2012-10-05 11:48 ABN AMRO
2012-10-05 11:48 ` ABN AMRO
2008-02-01 18:14 veerasena reddy
2008-02-04  5:41 ` Ramgopal Kota
2008-01-22  0:00 Thiemo Seufer
2007-11-25  2:10 Thomas Bogendoerfer
2007-04-16  6:10 xfwolf
2004-06-07  9:37 "romio kasyanov" 
2004-04-06 19:56 Brian Murphy
2003-06-19 13:51 David Kesselring
2003-02-21 11:38 santosh kumar gowda
2003-02-21 18:37 ` Maciej W. Rozycki
2002-12-19  0:11 Kyle Mestery
2000-01-31 13:02 Alan McFaul

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=28081.1284455685@redhat.com \
    --to=dhowells@redhat.com \
    --cc=FlorianSchandinat@gmx.de \
    --cc=James.Bottomley@suse.de \
    --cc=Trond.Myklebust@netapp.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=amit.salecha@qlogic.com \
    --cc=anirban.chakraborty@qlogic.com \
    --cc=ben-linux@fluff.org \
    --cc=bfields@fieldses.org \
    --cc=bruce.w.allan@intel.com \
    --cc=brudley@broadcom.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=e1000-devel@lists.sourceforge.net \
    --cc=gregkh@suse.de \
    --cc=heiko.carstens@de.ibm.com \
    --cc=henryp@broadcom.com \
    --cc=isdn@linux-pingi.de \
    --cc=james.smart@emulex.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=joe@perches.com \
    --cc=khali@linux-fr.org \
    --cc=lenb@kernel.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=megaraidlinux@lsi.com \
    --cc=mingo@elte.hu \
    --cc=mjpeg-users@lists.sourceforge.net \
    --cc=neilb@suse.de \
    --cc=netdev@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=perex@perex.cz \
    --cc=peter.p.waskiewicz.jr@intel.com \
    --cc=pv-drivers@vmware.com \
    --cc=sbhatewara@vmware.com \
    --cc=schwidefsky@de.ibm.com \
    --cc=sparclinux@vger.kernel.org \
    --cc=thomas@winischhofer.net \
    /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).