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] [day] [month] [year] [list]
Date:	Thu, 16 Nov 2006 16:02:31 +0200
From:	Heikki Orsila <shd@...alwe.fi>
To:	Maynard Johnson <maynardj@...ibm.com>
Cc:	cbe-oss-dev@...abs.org, linuxppc-dev@...abs.org,
	oprofile-list@...ts.sourceforge.net, linux-kernel@...r.kernel.org
Subject: Re: [RFC, Patch 1/1] OProfile for Cell: Initial profiling support -- new patch

On Wed, Nov 15, 2006 at 12:51:08PM -0600, Maynard Johnson wrote:
> +/* This function is called once for all cpus combined */
> +static void
> +cell_reg_setup(struct op_counter_config *ctr,
> +	       struct op_system_config *sys, int num_ctrs)
> +{
> [SNIP]
> +	for (i = 0; i < num_ctrs; ++i) {
> +
> +		if ((ctr[i].event >= 2100) && (ctr[i].event <= 2111))
> +			pmc_cntrl[1][i].evnts = ctr[i].event + 19;
> +		else if (ctr[i].event == 2203)
> +			pmc_cntrl[1][i].evnts = ctr[i].event;
> +		else if ((ctr[i].event >= 2200) && (ctr[i].event <= 2215))
> +			pmc_cntrl[1][i].evnts = ctr[i].event + 16;
> +		else
> +			pmc_cntrl[1][i].evnts = ctr[i].event;
> +

I think the previous code would be more readable with a switch() 
statement. 

	switch (ctr[i].event) {
	case 2100 ... 2111:
		pmc_cntrl[1][i] = ctr[i].event + 19;
		break;
	case 2200 ... 2202:
	case 2204 ... 2215:
		pmc_cntrl[1][i] = ctr[i].event + 16;
		break;
	default:
		pmc_cntrl[1][i] = ctr[i].event;
	}

 - Heikki
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ