From: Randy Dunlap <randy.dunlap@oracle.com>
To: Jan Engelhardt <jengelh@linux01.gwdg.de>
Cc: lkml <linux-kernel@vger.kernel.org>, akpm <akpm@linux-foundation.org>
Subject: Re: [PATCH] kernel-doc: handle spaces in array size
Date: Fri, 6 Apr 2007 16:03:35 -0700 [thread overview]
Message-ID: <20070406160335.e125e287.randy.dunlap@oracle.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0704062117460.6042@yvahk01.tjqt.qr>
On Fri, 6 Apr 2007 21:24:48 +0200 (MEST) Jan Engelhardt wrote:
> On Apr 6 2007 11:47, Randy Dunlap wrote:
> >
> >Unfortunately, kernel-doc has problems with a struct field like this:
> > uint8_t databuf[NAND_MAX_PAGESIZE + NAND_MAX_OOBSIZE];
> >
> >simply due to the spaces around the "+" sign, so drop all spaces inside
> >[...] so that parsing is done correctly (in some sense).
> >
...
>
> while($arg =~ s/\[(.*)\s+(.*)\]/[$1$2]/) {
> }
>
> should do it, and saves us the pre-matching. (Also note the + at \s)
> (No need to escape [ and ] in the target pattern.)
Yep, that works. Want to send it with sign-off or shall I just
send a new patch to akpm?
> I can also offer this gem which should do it the most saving way by
> matching the inside of [] exactly once, and otherwise
> matching/replacing only on \s:
>
> $arg =~ s{\[(.*)\]}{($_=$1)=~s/\s+//g;"[$_]"}e;
>
> (I already hear everyone screaming... ;-)
No, thanks.
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
next prev parent reply other threads:[~2007-04-06 23:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-06 18:47 Randy Dunlap
2007-04-06 19:24 ` Jan Engelhardt
2007-04-06 23:03 ` Randy Dunlap [this message]
2007-04-06 23:38 ` Jan Engelhardt
2007-04-07 0:53 ` [PATCH v2] " Randy Dunlap
2007-04-07 15:04 ` [PATCH] kernel-doc: handle arrays with arithmetic expressions as initializers <was Re: [PATCH v2] kernel-doc: handle spaces in array size> Borislav Petkov
2007-04-07 18:26 ` Randy Dunlap
2007-04-07 18:27 ` [PATCH v3] kernel-doc: handle arrays with arithmetic expressions as initializers Randy Dunlap
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=20070406160335.e125e287.randy.dunlap@oracle.com \
--to=randy.dunlap@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=jengelh@linux01.gwdg.de \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome