public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lars Lindley <lindley@coyote.org>
To: Dan Carpenter <error27@gmail.com>,
	gregkh@suse.de, greg@kroah.com, penberg@cs.helsinki.fi,
	pavel@ucw.cz, harvey.harrison@gmail.com,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: strip_whitespace.pl
Date: Sun, 21 Mar 2010 16:31:26 +0100	[thread overview]
Message-ID: <4BA63BCE.9050802@coyote.org> (raw)
In-Reply-To: <20100321110758.GL5331@bicker>

Yes this seems like a good tool to use.
I will sure use it in the future..

/Lars


On 2010-03-21 12:07, Dan Carpenter wrote:
> On Sun, Mar 21, 2010 at 01:55:42PM +0300, Dan Carpenter wrote:
>> I've written a new script called strip_whitespace.pl (included).
>>
>> One bug is that, if you split or unsplit a string literal that
>> confuses it.  Otherwise it seems to work.
>>
>> strip_whitespace.pl drivers/staging/winbond/reg.c > before
>> apply patch
>> strip_whitespace.pl drivers/staging/winbond/reg.c > after
>>
>> `diff before after`.  If they are the same then resend the patch.
> 
> On further reflection your new patch looks fine, if you combine the two.  
> But next time could you use my script?
> 
> Acked-by:  Dan Carpenter <error27@gmail.com>
> 
> regards,
> dan carpenter
> 
>>
>> regards,
>> dan carpenter
>>
>> #!/usr/bin/perl
>>
>> use strict;
>>
>> my $file = shift();
>> open FILE, "<$file";
>> my $txt = do { local $/;  <FILE> };
>>
>> # strip C99 comments
>> $txt =~ s/\/\/.*//g;
>> # strip newlines
>> $txt =~ s/\n//g;
>> # strip remaining comments
>> $txt =~ s/\/\*.*?\*\///g;
>> # strip tabs
>> $txt =~ s/\t//g;
>> # strip spaces
>> $txt =~ s/ //g;
>> # add newlines again
>> $txt =~ s/;/;\n/g;
>>
>> print "$txt\n";
> 

      reply	other threads:[~2010-03-21 15:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-20 15:14 [PATCH] staging: winbond: reg.c Coding style fixes Lars Lindley
2010-03-20 16:24 ` Dan Carpenter
2010-03-20 19:21   ` Lars Lindley
2010-03-21  6:58     ` Pavel Machek
2010-03-21 12:39       ` Pekka Enberg
2010-03-21 15:40         ` Lars Lindley
2010-03-21  9:14     ` Dan Carpenter
2010-03-21 10:55     ` strip_whitespace.pl Dan Carpenter
2010-03-21 11:07       ` strip_whitespace.pl Dan Carpenter
2010-03-21 15:31         ` Lars Lindley [this message]

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=4BA63BCE.9050802@coyote.org \
    --to=lindley@coyote.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=error27@gmail.com \
    --cc=greg@kroah.com \
    --cc=gregkh@suse.de \
    --cc=harvey.harrison@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=penberg@cs.helsinki.fi \
    /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