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:	Tue, 11 Sep 2012 12:42:23 +0100
From:	"David Laight" <David.Laight@...LAB.COM>
To:	"Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>,
	<davem@...emloft.net>, <nhorman@...driver.com>
Cc:	<john.r.fastabend@...el.com>, <gaofeng@...fujitsu.com>,
	<eric.dumazet@...il.com>, <mark.d.rustad@...el.com>,
	<lizefan@...wei.com>, <netdev@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 2/2] netprio_cgroup: Optimize the priomap copy loop slightly

> -	for (i = 0;
> -	     old_priomap && (i < old_priomap->priomap_len);
> -	     i++)
> -		new_priomap->priomap[i] = old_priomap->priomap[i];
> +	if (old_priomap) {
> +		old_len = old_priomap->priomap_len;
> +
> +		for (i = 0; i < old_len; i++)
> +			new_priomap->priomap[i] = old_priomap->priomap[i];
> +	}

Or:
	memcpy(new_priomap->priomap, old_priomap->priomap,
		old_priomap->priomap_len * sizeof old_priomap->priomap[0]);

	David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ