Re: [PATCH v2 20/26] selftests/resctrl: Create struct for input parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux