public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Wolfram Sang <w.sang@pengutronix.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] tracing/recordmount.pl: use apropriate perl-constructs
Date: Tue, 05 Jan 2010 14:24:15 -0500	[thread overview]
Message-ID: <1262719455.28171.1663.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <20100105191306.GA4848@pengutronix.de>

On Tue, 2010-01-05 at 20:13 +0100, Wolfram Sang wrote:
> > > -$objdump = "objdump" if ((length $objdump) == 0);
> > > -$objcopy = "objcopy" if ((length $objcopy) == 0);
> > > -$cc = "gcc" if ((length $cc) == 0);
> > > -$ld = "ld" if ((length $ld) == 0);
> > > -$nm = "nm" if ((length $nm) == 0);
> > > -$rm = "rm" if ((length $rm) == 0);
> > > -$mv = "mv" if ((length $mv) == 0);
> > > +$objdump ||= 'objdump';
> > > +$objcopy ||= 'objcopy';
> > > +$cc ||= 'gcc';
> > > +$ld ||= 'ld';
> > > +$nm ||= 'nm';
> > > +$rm ||= 'rm';
> > > +$mv ||= 'mv';
> > 
> > I purposely did not do it this way (I need to add a comment about this),
> > because most kernel developers are not perl programmers, and I wanted
> > this to be as easy as possible for a non-perl programmer to understand.
> > 
> > Even as a perl programmer it still looks funny to me with the:
> > 
> > 
> >   $x ||= 'x';
> > 
> 
> Yes, okay, it's an idiom one needs to know. While your point "be C-compatible"
> makes also sense to me (comment would be nice indeed), this should do it, too?
> 
> 	$cc = "gcc" if ($cc == '');

Yeah that looks better. You can also add a comment that says that this
code is trying to be C programmer friendly, and avoids the "$x ||= 'x'"
construct. Since this is the second or third time I had to deny that
change ;-)

> 
> > >  # Shut up recordmcount if user has older objcopy
> > > -my $quiet_recordmcount = ".tmp_quiet_recordmcount";
> > > -my $print_warning = 1;
> > > -$print_warning = 0 if ( -f $quiet_recordmcount);
> > > +my $quiet_recordmcount = '.tmp_quiet_recordmcount';
> > > +my $print_warning = (! -f $quiet_recordmcount);
> > 
> > Again, this is just using perl obfuscation for most C programmers to
> > understand.
> 
> Okay, mileages... :)
> 
> > I fine with this change too.
> 
> Shall I resend or will you just pick up the interesting parts?

Yes please resend!

Thanks,


-- Steve



  reply	other threads:[~2010-01-05 19:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-05 18:27 Minor improvements to recordmount.pl Wolfram Sang
2010-01-05 18:27 ` [PATCH 1/2] tracing/recordmount.pl: optimize offsets-handling Wolfram Sang
2010-01-05 18:27   ` [PATCH 2/2] tracing/recordmount.pl: use apropriate perl-constructs Wolfram Sang
2010-01-05 18:37     ` Steven Rostedt
2010-01-05 19:13       ` Wolfram Sang
2010-01-05 19:24         ` Steven Rostedt [this message]
2010-01-05 20:41           ` [PATCH V2] " Wolfram Sang
2010-01-13 10:23             ` [tip:tracing/core] tracing: Use appropriate perl constructs in recordmcount.pl tip-bot for Wolfram Sang
2010-01-05 18:39   ` [PATCH 1/2] tracing/recordmount.pl: optimize offsets-handling Steven Rostedt
2010-01-13 10:23   ` [tip:tracing/core] tracing: optimize recordmcount.pl for offsets-handling tip-bot for Wolfram Sang

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=1262719455.28171.1663.camel@gandalf.stny.rr.com \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=w.sang@pengutronix.de \
    /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