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: <82eb1ef0-3818-425f-8a0c-90f58bb49913@intel.com>
Date:   Tue, 28 Nov 2023 14:18:29 -0800
From:   Reinette Chatre <reinette.chatre@...el.com>
To:     Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
        <linux-kselftest@...r.kernel.org>, Shuah Khan <shuah@...nel.org>,
        "Shaopeng Tan" <tan.shaopeng@...fujitsu.com>,
        Maciej Wieczór-Retman 
        <maciej.wieczor-retman@...el.com>,
        Fenghua Yu <fenghua.yu@...el.com>
CC:     <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 20/26] selftests/resctrl: Create struct for input
 parameters

Hi Ilpo,

On 11/20/2023 3:13 AM, Ilpo Järvinen wrote:

...

>  
> +static void init_user_params(struct user_params *uparams)
> +{
> +	uparams->cpu = 1;
> +	uparams->bits = 0;
> +}
> +
>  int main(int argc, char **argv)
>  {
>  	bool mbm_test = true, mba_test = true, cmt_test = true;
> -	const char *benchmark_cmd[BENCHMARK_ARGS] = {};
> -	int c, cpu_no = 1, i, no_of_bits = 0;
> +	struct user_params uparams = {};
>  	char *span_str = NULL;
>  	bool cat_test = true;
>  	int tests = 0;
> -	int ret;
> +	int ret, c, i;
> +
> +	init_user_params(&uparams);
>  

It is unexpected that this uses a combination of designated
initializer (via {}) as well as an explicit init function to
initialize the struct. I think it would be simpler to do
all initialization in the init function.

Reinette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ