aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/cpu/quark/mrc.c
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2015-03-10 18:31:20 +0800
committerSimon Glass <sjg@chromium.org>2015-03-24 21:22:37 -0600
commit312cc39e270170b37a992b2d57773c828dcb9c6b (patch)
tree6492fdb706088e6835b00772849f3d111666f449 /arch/x86/cpu/quark/mrc.c
parentb81bdf62e0cf9b5c64d30284d01658a851f142f7 (diff)
x86: quark: MRC codes clean up
This patch cleans up the quark MRC codes coding style by: - Remove BIT0/1../31 defines from mrc_util.h - Create names for the documented BITs and use them - For undocumented single BITs, use (1 << n) directly - For undocumented ORed BITs, use the hex number directly - Remove redundancy parenthesis all over the codes - Replace to use lower case hex numbers Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch/x86/cpu/quark/mrc.c')
-rw-r--r--arch/x86/cpu/quark/mrc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/x86/cpu/quark/mrc.c b/arch/x86/cpu/quark/mrc.c
index 7eb34c5302..65734e9456 100644
--- a/arch/x86/cpu/quark/mrc.c
+++ b/arch/x86/cpu/quark/mrc.c
@@ -105,8 +105,8 @@ static void mrc_adjust_params(struct mrc_params *mrc_params)
* Column: 11 for 8Gbx8, else 10
*/
mrc_params->column_bits[0] =
- ((dram_params[0].density == 4) &&
- (dram_width == X8)) ? (11) : (10);
+ (dram_params[0].density == 4) &&
+ (dram_width == X8) ? 11 : 10;
/*
* Determine row bits:
@@ -117,9 +117,9 @@ static void mrc_adjust_params(struct mrc_params *mrc_params)
* 4Gbx16=15 4Gbx8=16
* 8Gbx16=16 8Gbx8=16
*/
- mrc_params->row_bits[0] = 12 + (dram_params[0].density) +
- (((dram_params[0].density < 4) &&
- (dram_width == X8)) ? (1) : (0));
+ mrc_params->row_bits[0] = 12 + dram_params[0].density +
+ (dram_params[0].density < 4) &&
+ (dram_width == X8) ? 1 : 0;
/*
* Determine per-channel memory size:
@@ -137,7 +137,7 @@ static void mrc_adjust_params(struct mrc_params *mrc_params)
* 4Gb x16 0x040000000 (1024MB)
* 4Gb x8 0x080000000 (2048MB)
*/
- mrc_params->channel_size[0] = (1 << dram_params[0].density);
+ mrc_params->channel_size[0] = 1 << dram_params[0].density;
mrc_params->channel_size[0] *= (dram_width == X8) ? 2 : 1;
mrc_params->channel_size[0] *= (rank_enables == 0x3) ? 2 : 1;
mrc_params->channel_size[0] *= (channel_width == X16) ? 1 : 2;