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:	Mon, 6 May 2013 19:47:17 +0200
From:	Jiri Olsa <jolsa@...hat.com>
To:	David Ahern <dsahern@...il.com>
Cc:	linux-kernel@...r.kernel.org, Andi Kleen <andi@...stfloor.org>,
	Corey Ashford <cjashfor@...ux.vnet.ibm.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...e.hu>,
	Namhyung Kim <namhyung@...nel.org>,
	Paul Mackerras <paulus@...ba.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Ulrich Drepper <drepper@...il.com>,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Will Deacon <will.deacon@....com>,
	Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 3/8] perf tools: Add formula-* parsing support for events

On Fri, May 03, 2013 at 09:07:56AM -0600, David Ahern wrote:
> On 5/1/13 9:15 AM, Jiri Olsa wrote:
> >+static char **formula_add(char **f, char *new)
> >+{
> >+	int i;
> >+#define FORMULAS_CNT 20
> >+
> >+	if (!f) {
> >+		f = zalloc(sizeof(char *) * FORMULAS_CNT + 1);
> >+		if (!f)
> >+			return NULL;
> >+	}
> >+
> >+	for (i = 0; f[i] && (i < FORMULAS_CNT); i++);
> >+
> >+	if (i == FORMULAS_CNT) {
> >+		pr_err("Too many formula defined, max = %d\n",
> >+		       FORMULAS_CNT);
> >+		return NULL;
> >+	}
> 
> Why have an array of arbitrary limit versus a linked list?

well, I dont need to define new struct, just an array
of string pointers..

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