All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@suug.ch>
To: Andreas Mohr <andi@rhlx01.fht-esslingen.de>
Cc: Andrew Morton <akpm@osdl.org>, netfilter-devel@lists.netfilter.org
Subject: Re: [PATCH -mm] lib/ts_fsm.c: constify structs
Date: Fri, 1 Sep 2006 15:50:16 +0200	[thread overview]
Message-ID: <20060901135016.GJ3470@postel.suug.ch> (raw)
In-Reply-To: <20060901125158.GA17752@rhlx01.fht-esslingen.de>

* Andreas Mohr <andi@rhlx01.fht-esslingen.de> 2006-09-01 14:51
> Hi,
> 
> On Fri, Sep 01, 2006 at 01:31:37PM +0200, Thomas Graf wrote:
> > * Andreas Mohr <andi@rhlx01.fht-esslingen.de> 2006-08-31 20:27
> > > @@ -44,7 +44,7 @@
> > >  #define _W		0x200 /* wildcard */
> > >  
> > >  /* Map to _ctype flags and some magic numbers */
> > > -static u16 token_map[TS_FSM_TYPE_MAX+1] = {
> > > +static const u16 token_map[TS_FSM_TYPE_MAX+1] = {
> > >  	[TS_FSM_SPECIFIC] = 0,
> > >  	[TS_FSM_WILDCARD] = _W,
> > >  	[TS_FSM_CNTRL]	  = _C,
> > > @@ -61,7 +61,7 @@
> > >  	[TS_FSM_ASCII]	  = _A,
> > >  };
> > >  
> > > -static u16 token_lookup_tbl[256] = {
> > > +static const u16 token_lookup_tbl[256] = {
> > >  _W|_A|_C,      _W|_A|_C,     _W|_A|_C,     _W|_A|_C,		/*   0-  3 */
> > >  _W|_A|_C,      _W|_A|_C,     _W|_A|_C,     _W|_A|_C,		/*   4-  7 */
> > >  _W|_A|_C,      _W|_A|_C|_S,  _W|_A|_C|_S,  _W|_A|_C|_S,		/*   8- 11 */
> > 
> > You could mark them __read_mostly at this opportunity.
> 
> Thanks for the review!
> 
> However being const already implies __read_mostly if I'm not mistaken,
> due to its const nature which doesn't allow any modification. ;)

Right, not sure what I was thinking. ;) However, gcc probably already
put it into rodata for being static and only referenced for reading
so it probably doesn't make any difference.

  reply	other threads:[~2006-09-01 13:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-31 18:27 [PATCH -mm] lib/ts_fsm.c: constify structs Andreas Mohr
2006-09-01 11:31 ` Thomas Graf
2006-09-01 12:51   ` Andreas Mohr
2006-09-01 13:50     ` Thomas Graf [this message]
2006-09-01 14:09       ` Andreas Mohr

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=20060901135016.GJ3470@postel.suug.ch \
    --to=tgraf@suug.ch \
    --cc=akpm@osdl.org \
    --cc=andi@rhlx01.fht-esslingen.de \
    --cc=netfilter-devel@lists.netfilter.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.