Re: [PATCH 3.7.0 5/9] i82975x_edac: optimise mode detection

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

 



On Sun, 16 Dec 2012 02:12:51 +0530 Arvind R <arvino55@xxxxxxxxx> wrote:
>
> Subject: [PATCH 3.7.0 5/9] i82975x_edac: optimise mode detection
> 
> Minor optimisation of dual channel symmetric operation. Return
> value changed to bool.

And you moved the function for no reason that is obvious form the patch.

> +/* Return 1 if dual channel mode is active.  Else return 0. */

The comment is no longer correct i.e. you are no returning true/false not
0/1.

> +static bool dual_channel_active(void __iomem *mch_window)
> +{
> +	/*
> +	 * We treat interleaved-symmetric configuration as dual-channel.
> +	 * All other configurations are virtual single channel mode.
> +	 * bit-0 of EAP always provides the real channel in error.
> +	 */
> +	u8	drb[2];
> +	int	row;
> +	bool    dualch;
> +
> +	for (dualch = 1, row = 0; dualch &&

um	dualch = true

> +			(row < I82975X_NR_CSROWS_PER_CHANNEL); row++) {
> +		drb[0] = readb(mch_window + I82975X_DRB + row);
> +		drb[1] = readb(mch_window + I82975X_DRB + row + 0x80);
> +		dualch &= (drb[0] == drb[1]);

Don't do bit operations on a bool.

> +	}
> +	return dualch;
> +}

-- 
Cheers,
Stephen Rothwell                    sfr@xxxxxxxxxxxxxxxx

Attachment: pgpPBXyw7jaDT.pgp
Description: PGP signature


[Index of Archives]     [Linux Kernel]     [Linux USB Development]     [Yosemite News]     [Linux SCSI]

  Powered by Linux