lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 05 Jan 2010 14:24:15 -0500
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Wolfram Sang <w.sang@...gutronix.de>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] tracing/recordmount.pl: use apropriate
 perl-constructs

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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ