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]
Message-ID: <5183D2CC.6050409@gmail.com>
Date:	Fri, 03 May 2013 09:07:56 -0600
From:	David Ahern <dsahern@...il.com>
To:	Jiri Olsa <jolsa@...hat.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 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?

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