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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 31 May 2016 07:21:12 +0900
From:	Taeung Song <treeze.taeung@...il.com>
To:	Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
Cc:	linux-kernel@...r.kernel.org, Jiri Olsa <jolsa@...nel.org>,
	Namhyung Kim <namhyung@...nel.org>,
	Ingo Molnar <mingo@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
	Masami Hiramatsu <mhiramat@...nel.org>,
	Jiri Olsa <jolsa@...hat.com>, Wang Nan <wangnan0@...wei.com>,
	Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH v3 4/7] perf config: Reimplement perf_config() using
 perf_config_set__iter()



On 05/31/2016 04:32 AM, Arnaldo Carvalho de Melo wrote:
> Em Tue, May 31, 2016 at 01:44:08AM +0900, Taeung Song escreveu:
>> +static int perf_config_set__iter(struct perf_config_set *set, config_fn_t fn, void *data)
>> +{
>> +	struct perf_config_section *section;
>> +	struct perf_config_item *item;
>> +	struct list_head *sections;
>> +	char key[BUFSIZ];
>> +
>> +	if (set == NULL)
>> +		return -1;
> <SNIP>
>> +	return 0;
>> +}
>> +int perf_config(config_fn_t fn, void *data)
>> +{
>> +	if (perf_config_set__check() < 0)
>> +		return -1;
>> +	return perf_config_set__iter(config_set, fn, data);
>> +}
>
> "check" looks too vague, this is equivalent, no?
>
> int perf_config(config_fn_t, void *data)
> {
> 	if (config_set == NULL)
> 		config_set = perf_config_set__new();
> 	
> 	return perf_config_set__iter(config_set, fn, data);
> }
>

I understood it! I thought __check() function is needed for readability.
But I'll remove __check() because it would seem that the function isn't 
needed as you said.

Thanks,
Taeung

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ