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:   Wed, 20 Dec 2017 21:21:51 +0200
From:   Mark Bloch <markb@...lanox.com>
To:     David Miller <davem@...emloft.net>, saeedm@...lanox.com
Cc:     dledford@...hat.com, netdev@...r.kernel.org,
        linux-rdma@...r.kernel.org, leonro@...lanox.com
Subject: Re: [for-next 01/11] net/mlx5: E-Switch, Refactor vport representors
 initialization



On 20/12/2017 19:57, David Miller wrote:
> From: Saeed Mahameed <saeedm@...lanox.com>
> Date: Tue, 19 Dec 2017 12:33:30 -0800
> 
>> +int esw_offloads_init_reps(struct mlx5_eswitch *esw)
>> +{
>> +	struct mlx5_core_dev *dev = esw->dev;
>> +	struct mlx5_esw_offload *offloads;
>> +	struct mlx5_eswitch_rep *rep;
>> +	int total_vfs = MLX5_TOTAL_VPORTS(dev);
>> +	u8 hw_id[ETH_ALEN];
>> +	int vport;
> 
> Reverse christmas-tree please.
we need dev for  MLX5_TOTAL_VPORTS, so we can't have proper reverse christms-tree,
I'll just remove the initialization of total_vfs and do it after the declarations,
and switch between total_vfs and hw_id. 

> 
>> +	esw->offloads.vport_reps =
>> +		kcalloc(total_vfs, sizeof(struct mlx5_eswitch_rep),
>> +			GFP_KERNEL);
> 
> That looks really unpleasant:
> 
> 	x = kcalloc(y,
> 		    z, GFP_KERNEL);
> 
> would look so much nicer.
> 
No problem.

Thanks,
Mark.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ