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] [day] [month] [year] [list]
Date:	Tue, 18 Mar 2014 11:18:11 -0300
From:	Arnaldo Carvalho de Melo <acme@...hat.com>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	Namhyung Kim <namhyung@...nel.org>,
	Ramkumar Ramachandra <artagnon@...il.com>,
	LKML <linux-kernel@...r.kernel.org>, Jiri Olsa <jolsa@...hat.com>
Subject: Re: [PATCH 3/5] tools lib traceevent: use else-if cascade, not
 separate ifs

Em Tue, Mar 18, 2014 at 09:30:06AM -0400, Steven Rostedt escreveu:
> On Tue, 18 Mar 2014 10:10:48 -0300 Arnaldo Carvalho de Melo <acme@...hat.com> wrote:
> > Em Tue, Mar 18, 2014 at 05:02:09PM +0900, Namhyung Kim escreveu:
> > > On Mon, 17 Mar 2014 18:26:36 -0400, Ramkumar Ramachandra wrote:
> > > > When token cannot be more than one value, it seems wasteful to go
> > > > through all the strcmp() calls. Use an else-if cascade instead.

> > > I think the end result will be same since it returns from inside the
> > > block, right?
> > 
> > Exactly :-)
> > 
> > We could have it changed to something like:
> > 
> > 	if (strcmp()) {
> > 		ret = bla();
> > 		goto out_free_token;
> > 	}
> > .
> > .
> > .
> > out_free_token:
> > 	free_token(token);
> > 	return ret;

> Honestly, I prefer the original, thus I would add a NAK to this patch.

No problem with that, if I had written that code, I'd prefer the gotos,
but that is kinda personal preference.

Yeah, I'd nack that patch as well, changes nothing.

- Arnaldo
--
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