lkml.org 
[lkml]   [2012]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3.7.0 5/9] i82975x_edac: optimise mode detection
On Sun, 16 Dec 2012 02:12:51 +0530 Arvind R <arvino55@gmail.com> 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@canb.auug.org.au
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2012-12-15 23:41    [W:0.073 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site